Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scaling_policies doesn't allow for multiple step_adjustments #236

Closed
emoshaya opened this issue Jul 10, 2023 · 4 comments · Fixed by #204
Closed

scaling_policies doesn't allow for multiple step_adjustments #236

emoshaya opened this issue Jul 10, 2023 · 4 comments · Fixed by #204
Labels

Comments

@emoshaya
Copy link

I'm trying to import the follow resource into this module but it seems I'm unable to pass in multiple step_adjustment blocks as in the example below:

`resource "aws_autoscaling_policy" "this" {
  name = "scale-out"

  adjustment_type           = "ExactCapacity"
  policy_type               = "StepScaling"
  estimated_instance_warmup = 60

  step_adjustment {
    scaling_adjustment          = 1
    metric_interval_lower_bound = 1.0
    metric_interval_upper_bound = 10.0
  }
  step_adjustment {
    scaling_adjustment          = 2
    metric_interval_lower_bound = 10.0
    metric_interval_upper_bound = 20.0
  }
  step_adjustment {
    scaling_adjustment          = 3
    metric_interval_lower_bound = 20.0
    metric_interval_upper_bound = 30.0
  }
  step_adjustment {
    scaling_adjustment          = 4
    metric_interval_lower_bound = 30.0
    metric_interval_upper_bound = 50.0
  }
  step_adjustment {
    scaling_adjustment          = 5
    metric_interval_lower_bound = 50.0
    metric_interval_upper_bound = 75.0
  }
  step_adjustment {
    scaling_adjustment          = 6
    metric_interval_lower_bound = 75.0
    metric_interval_upper_bound = 100.0
  }
  step_adjustment {
    scaling_adjustment          = 7
    metric_interval_lower_bound = 100.0
    metric_interval_upper_bound = 150.0
  }
  step_adjustment {
    scaling_adjustment          = 8
    metric_interval_lower_bound = 150.0
    metric_interval_upper_bound = 200.0
  }
  step_adjustment {
    scaling_adjustment          = 9
    metric_interval_lower_bound = 200.0
    metric_interval_upper_bound = 300.0
  }
  step_adjustment {
    scaling_adjustment          = 10
    metric_interval_lower_bound = 300.0
  }

  autoscaling_group_name = aws_autoscaling_group.this.name
}`

When I try the following config:

scaling_policies = {
  scale_up = {
    name             = "scale-up"
    adjustment_type         = "ExactCapacity"
    policy_type                  = "StepScaling"
    estimated_instance_warmup = 60
    step_adjustment = [
      {
          scaling_adjustment          = 1
          metric_interval_lower_bound = 1.0
          metric_interval_upper_bound = 10.0
      },
      {
          scaling_adjustment          = 2
          metric_interval_lower_bound = 10.0
          metric_interval_upper_bound = 20.0
      }
    ]
  }
}

I get the following error:

│ Error: Unsupported attribute │ │ on .terraform/modules/aws.autoscaling/main.tf line 915, in resource "aws_autoscaling_policy" "this": │ 915: scaling_adjustment = step_adjustment.value.scaling_adjustment │ ├──────────────── │ │ step_adjustment.value is tuple with 2 elements │ │ This value does not have any attributes.

@github-actions
Copy link

This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days

@github-actions github-actions bot added the stale label Aug 10, 2023
@github-actions
Copy link

This issue was automatically closed because of stale in 10 days

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 21, 2023
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
@antonbabenko
Copy link
Member

This issue has been resolved in version 7.0.0 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.