-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
No reference of how to specify cloudwatch metrics for autoscaling #18
Comments
@mamccormick isn't that what the following does ?
terraform-aws-ecs-cloudwatch-autoscaling/main.tf Lines 24 to 29 in 7a9c37e
terraform-aws-ecs-cloudwatch-autoscaling/main.tf Lines 43 to 48 in 7a9c37e
|
If this module is consumed without using the outputs incomplete monitors will be created: If you click through the AWS console wizard it instructs you to create or target a CloudWatch alarm. The Terraform within this module doesn't provide any context on what to scale on, just how to scale. Looks like the outputs should be wired into alerts to create functional monitors. |
Ah then you probably need to use this module with the ecs sns module https://github.com/cloudposse/terraform-aws-ecs-cloudwatch-sns-alarms |
As @gausnes already mentioned. This module won't create the autoscaling action by itself. What we need to do is combine the outputs (up and down) with a CloudWatch alarm. One example that works for me:
The differences in this above sample and the default example are the cpu_utilization_high_alarm_actions, cpu_utilization_low_alarm_actions, memory_utilization_high_alarm_actions, memory_utilization_low_alarm_actions we need to pass the outputs from autoscaling module (scale_up_policy_arn and scale_down_policy_arn) to the alarm actions we want. This configuration will produce the expected behaviour, something like this: |
Awesome. Thanks for figuring it out @daltonsena ! Perhaps one of you could put in a PR to update our |
When I do this, the ECS UI shows that I only get scaling on CPU. Shouldn't there be a |
AWS will not allow you to use 2 alerts/metrics to control 1 That means that we required 4 This Module however only gives us 2 and since it try to create the Maybe we should update the module and make the creation of |
Found a bug? Maybe our Slack Community can help.
Describe the Bug
Hi there, I have a query regarding this terraform module, for reference:
The following terraform module:
The description is as follows:
The module itself seems to define the criteria for the auto-scaling, such as minimum and maximum amount of tasks, however I don't see any info or arguments to specify the Cloudwatch metric(s) to associate with. i.e how do we use this module to setup autoScaling with a Cloudwatch metric, such as CPU or memory utilisation, whenever there are no arguments to support this.
As an example, if I were to do this utilising the built-in terraform modules, i'd first look at leveraging the following to create a target:
Then i'd attach a policy to it, with the targeted CloudWatch metric utilising:
Expected Behavior
Given the description of this module states that it is for creating ECS auto-scaling based on Cloudwatch metrics, id expect that it would allow me to specify the Cloudwatch metric to associate with it.
Steps to Reproduce
N/A - but details above
Screenshots
N/A - detail above.
Environment (please complete the following information):
N/A - details above
The text was updated successfully, but these errors were encountered: