Closed obi-juan1971 closed 2 years ago
hi @obi-juan1971 - we'll need a reproduction to troubleshoot
hi @obi-juan1971 - we'll need a reproduction to troubleshoot
Hi @bryantbiggs I hope this help. Using your complete example, just add a scaling_policy like this and you'll get the error:
request-count-per-target = {
policy_type = "TargetTrackingScaling"
estimated_instance_warmup = 120
target_tracking_configuration = {
predefined_metric_specification = {
predefined_metric_type = "ALBRequestCountPerTarget"
resource_label = "${module.alb.lb_arn_suffix}/${module.alb.target_group_arn_suffixes[0]}"
}
target_value = 800
}
},
I have the exact same issue with the following versions:
"terraform_version": "1.1.9",
module "autoscaling" {
source = "terraform-aws-modules/autoscaling/aws"
version = "6.3.0"
module "alb" {
source = "terraform-aws-modules/alb/aws"
version = "6.10.0"
Tried to make sure the resource_label is in the format of: app/my-alb/id-xxx/targetgroup/my-alb-target-group/id-yyy
Everything seems ok except when trying to add the ALBRequestCountPerTarget.
│ Error: Error putting scaling policy: ValidationError: Resource label should be specified for predefined metric type ALBRequestCountPerTarget
│ status code: 400, request id: 3479e05e-bc3a-4419-87b1-74743363d8ec
│
│ with module.autoscaling.aws_autoscaling_policy.this["alb-target-requests-greater-than-yy"],
│ on .terraform/modules/autoscaling/main.tf line 570, in resource "aws_autoscaling_policy" "this":
│ 570: resource "aws_autoscaling_policy" "this" {
Thanks @obi-juan1971 for the repro - fix is coming shortly!
This issue has been resolved in version 6.5.0 :tada:
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Description
When you set a scaling_policy of type ALBRequestCountPerTarget you need to specify a Resource Label and this in not consider in code, so this module fail to create the resource aws_autoscaling_policy.this
⚠️ Note
Before you submit an issue, please perform the following first:
.terraform
directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!):rm -rf .terraform/
terraform init
Versions
Module version 6.3.0:
Terraform version: Terraform v1.0.6 on linux_amd64
Provider version(s): provider registry.terraform.io/hashicorp/aws v4.8.0
Reproduction Code [Required]
Steps to reproduce the behavior:
no yesExpected behavior
I expect to be able to create an aws_autoscaling_policy if type ALBRequestCountPerTarget like this
Actual behavior
It can't be created.
Terminal Output Screenshot(s)
Additional context