You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
resource/aws_autoscaling_policy: Add `customized_capacity_metric_specification`, `customized_load_metric_specification` and `customized_scaling_metric_specification` to the `predictive_scaling_configuration.metric_specification` argument
### Create predictive scaling policy using customized scaling and predefined load metric
98
+
99
+
```terraform
100
+
resource "aws_autoscaling_policy" "example" {
101
+
autoscaling_group_name = "my-test-asg"
102
+
name = "foo"
103
+
policy_type = "PredictiveScaling"
104
+
predictive_scaling_configuration {
105
+
metric_specification {
106
+
target_value = 10
107
+
predefined_load_metric_specification {
108
+
predefined_metric_type = "ASGTotalCPUUtilization"
109
+
resource_label = "testLabel"
110
+
}
111
+
customized_scaling_metric_specification {
112
+
metric_data_queries {
113
+
id = "scaling"
114
+
metric_stat {
115
+
metric {
116
+
metric_name = "CPUUtilization"
117
+
namespace = "AWS/EC2"
118
+
dimensions {
119
+
name = "AutoScalingGroupName"
120
+
value = "my-test-asg"
121
+
}
122
+
}
123
+
stat = "Average"
124
+
}
125
+
}
126
+
}
127
+
}
128
+
}
129
+
}
130
+
```
131
+
44
132
## Argument Reference
45
133
46
134
*`name` - (Required) The name of the policy.
@@ -161,9 +249,12 @@ The following arguments are supported:
161
249
162
250
The following arguments are supported:
163
251
164
-
*`predefined_load_metric_specification` - (Optional) The load metric specification.
252
+
*`customized_capacity_metric_specification` - (Optional) The customized capacity metric specification. The field is only valid when you use `customized_load_metric_specification`
253
+
*`customized_load_metric_specification` - (Optional) The customized load metric specification.
254
+
*`customized_scaling_metric_specification` - (Optional) The customized scaling metric specification.
255
+
*`predefined_load_metric_specification` - (Optional) The predefined load metric specification.
165
256
*`predefined_metric_pair_specification` - (Optional) The metric pair specification from which Amazon EC2 Auto Scaling determines the appropriate scaling metric and load metric to use.
166
-
*`predefined_scaling_metric_specification` - (Optional) The scaling metric specification.
257
+
*`predefined_scaling_metric_specification` - (Optional) The predefined scaling metric specification.
167
258
168
259
##### predefined_load_metric_specification
169
260
@@ -186,6 +277,50 @@ The following arguments are supported:
186
277
*`predefined_metric_type` - (Required) Describes a scaling metric for a predictive scaling policy. Valid values are `ASGAverageCPUUtilization`, `ASGAverageNetworkIn`, `ASGAverageNetworkOut`, or `ALBRequestCountPerTarget`.
187
278
*`resource_label` - (Required) A label that uniquely identifies a specific Application Load Balancer target group from which to determine the request count served by your Auto Scaling group.
188
279
280
+
##### customized_scaling_metric_specification
281
+
The following arguments are supported:
282
+
283
+
*`metric_data_queries` - (Required) A list of up to 10 structures that defines custom scaling metric in predictive scaling policy
284
+
285
+
##### customized_load_metric_specification
286
+
The following arguments are supported:
287
+
288
+
*`metric_data_queries` - (Required) A list of up to 10 structures that defines custom load metric in predictive scaling policy
289
+
290
+
##### customized_capacity_metric_specification
291
+
The following arguments are supported:
292
+
293
+
*`metric_data_queries` - (Required) A list of up to 10 structures that defines custom capacity metric in predictive scaling policy
294
+
295
+
##### metric_data_queries
296
+
The following arguments are supported:
297
+
298
+
*`expression` - (Optional) The math expression used on the returned metric. You must specify either `expression` or `metric_stat`, but not both.
299
+
*`id` - (Required) A short name for the metric used in predictive scaling policy.
300
+
*`metric_stat` - (Optional) A structure that defines CloudWatch metric to be used in predictive scaling policy. You must specify either `expression` or `metric_stat`, but not both.
301
+
*`label` - (Optional) A human-readable label for this metric or expression.
302
+
*`return_data` - (Optional) A boolean that indicates whether to return the timestamps and raw data values of this metric, the default it true
303
+
304
+
##### metric_stat
305
+
The following arguments are supported:
306
+
307
+
*`metric` - (Required) A structure that defines the CloudWatch metric to return, including the metric name, namespace, and dimensions.
308
+
*`stat` - (Required) The statistic of the metrics to return.
309
+
*`unit` - (Optional) The unit of the metrics to return.
310
+
311
+
##### metric
312
+
The following arguments are supported:
313
+
314
+
*`dimensions` - (Optional) The dimensions of the metric.
315
+
*`metric_name` - (Required) The name of the metric.
316
+
*`namespace` - (Required) The namespace of the metric.
317
+
318
+
##### dimensions
319
+
The following arguments are supported:
320
+
321
+
*`name` - (Required) The name of the dimension.
322
+
*`value` - (Required) The value of the dimension.
323
+
189
324
## Attributes Reference
190
325
191
326
In addition to all arguments above, the following attributes are exported:
0 commit comments