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
289 stars 553 forks source link

fix: Issue with aws_autoscaling_policy SimpleScaling #184

Closed eduoral closed 2 years ago

eduoral commented 2 years ago

Description

We currently create a new module for creating a new ECS cluster in AWS. When we set the autoscaling group, we found one problem with aws_autoscaling_policy. We need to create a SimpleScaling policy. When that, we receive a terraform error.

Motivation and Context

Create a new autoscalling group with scalling_policies like use SimpleScaling policy type.

Code Snippet to Reproduce

### scaling_policies 
  scaling_policies = {
    cpu_high = {
      adjustment_type    = "ChangeInCapacity"
      policy_type        = "SimpleScaling"
      cooldown           = "300"
      scaling_adjustment = "1"
    },
    cpu_low = {
      adjustment_type    = "ChangeInCapacity"
      policy_type        = "SimpleScaling"
      cooldown           = "300"
      scaling_adjustment = "-1"
    }
  }

Terminal Output Screenshot(s)

module.asg.aws_autoscaling_policy.this["cpu_high"]: Creating...
╷
│ Error: scaling_adjustment is required for policy type SimpleScaling
│ 
│   with module.asg.aws_autoscaling_policy.this["cpu_high"],
│   on ../../modules/AWS/terraform-aws-autoscaling/main.tf line 537, in resource "aws_autoscaling_policy" "this":
│  537: resource "aws_autoscaling_policy" "this" {
│ 
╵
ERRO[0015] 1 error occurred:
    * exit status 1
bryantbiggs commented 2 years ago

hi @eduoral - thanks for the PR! we should add a test/example for this so we can validate/verify in the future

antonbabenko commented 2 years ago

This issue has been resolved in version 6.0.0 :tada:

github-actions[bot] commented 1 year ago

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.