Like below is the example of target tracking ASG policy in TF docs :
resource "aws_autoscaling_policy" "example" {
# ... other configuration ...
target_tracking_configuration {
predefined_metric_specification {
predefined_metric_type = "ASGAverageCPUUtilization"
}
target_value = 40.0
}
target_tracking_configuration {
customized_metric_specification {
metric_dimension {
name = "fuga"
value = "fuga"
}
metric_name = "hoge"
namespace = "hoge"
statistic = "Average"
}
target_value = 40.0
}
}
I want to create a step scaling policy which also has definition of custom metric like in this block and i am using the below code but getting error saying THIS BLOCK DOES NOT EXIST.
resource "aws_autoscaling_policy" "contentworker_inbound_step_scaling_policy" {
name = "${var.host_group}-${var.stack}-step-scaling-policy"
policy_type = "StepScaling"
autoscaling_group_name = aws_autoscaling_group.contentworker_inbound_asg.name
estimated_instance_warmup = 300
step_configuration {
customized_metric_specification {
metric_dimension {
name = "test"
value = “Size”
}
metric_name = "anything"
namespace = "test"
statistic = "Average"
unit = "None"
}
step_adjustment {
adjustment_type = "PercentChangeInCapacity"
scaling_adjustment = 10
metric_interval_lower_bound = 10
metric_interval_upper_bound = 25
}
}
}
I have the custom metric working fine with the target tracking policy, but not with the step scaling.
Any suggestions how can I setup a step scaling policy for my custom metric