terraform-aws-modules / terraform-aws-autoscaling

Terraform module to create AWS Auto Scaling resources πŸ‡ΊπŸ‡¦
https://registry.terraform.io/modules/terraform-aws-modules/autoscaling/aws
Apache License 2.0
292 stars 556 forks source link

Cannot create a predictive scaling policy #178

Closed ac-ggraham closed 2 years ago

ac-ggraham commented 2 years ago

Description

When I run the example "complete_lt" configuration, the module does not create the predictive scaling policy.

⚠️ Note

Before you submit an issue, please perform the following first:

  1. Remove the local .terraform directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!): rm -rf .terraform/
  2. Re-initialize the project root to pull down modules: terraform init
  3. Re-attempt your terraform plan or apply and check if the issue still persists

Versions

Reproduction

Steps to reproduce the behavior:

yes I am using workspaces

yes I have cleared the cache

Expected behavior

I should be able to create an ASG with the defined predictive scaling policy.

Actual behavior

When creating the policy the apply halts and prints the error below.

β”‚ Error: Invalid function argument
β”‚ 
β”‚   on .terraform/modules/complete_lt/main.tf line 566, in resource "aws_autoscaling_policy" "this":
β”‚  566:             for_each = lookup(metric_specification.value, "predefined_scaling_metric_specification", null) != null ? [metric_specification.value.predefined_scaling_metric_specification] : []
β”‚     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚     β”‚ metric_specification.value is 32
β”‚ 
β”‚ Invalid value for "inputMap" parameter: lookup() requires a map as the first argument.
bryantbiggs commented 2 years ago

this should be resolved now. please update to latest and let me know if you still see any issues - thanks!

github-actions[bot] commented 1 year ago

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.