-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
AWS: Scaling Policies / CloudWatch Metric Alarms #1585
Conversation
@xaptronic thanks for this! Trying your work out atm. |
Great, looking forward to your feedback. |
Cloudwatch Updates - Fixes some naming inconsistencies (cloudwatch/cloud_watch, dimensions/dimenion) - Adds ForceNew on alarm names (removes old and creates new)
Nice! |
@xaptronic did the commits from my PR on your fork get updated here? |
@xaptronic it looks like you'll need to merge master into this branch. I've kept a branch up to date on the Banno org if you want a reference. |
@nicgrayson Branches are all up to date and your changes are merged in. |
…sufficient_data_actions and ok_actions)
@catsby I added a section to the documentation page that shows how to use |
Just a few questions/suggestions regarding the DSL:
|
can't wait to have this merged 🍨 |
Thanks for adding error checking in 3780afa, much appreciated.
You can address this by converting them: var actionList []string
for _,action := range a.AlarmActions{
actionList = append(actionList, *action)
}
if err := d.Set("alarm_actions", actionList); err !=nil {
// log
} That should do the trick |
@catsby Thanks for the example, I was a bit stumped on this. This is my first foray into writing Go :). I'll update my code and update the PR. |
Any other comments on suggestions from @radeksimko? I based the naming on documentation from AWS, but these suggestions seem like they would make naming shorter and more clear. |
@xaptronic Based on recent discussion in here: #1974 (comment) I may take back second part of my 2nd point (why not use ARN as ID instead of name as ID), but otherwise I believe the other parameters should be renamed unless someone can convince me it's a bad idea? 😃 |
@radeksimko I am going to make these changes tomorrow morning unless I hear any reason not to. I like the shorter variations. @catsby I added a helper function to do the []*string to []string conversion. I ran plan/apply with TF_LOG and do not see that warning statement any longer. |
@radeksimko I've updated the DSL to reflect your comments about shorter naming. I chose, however, not to rename |
That's fair enough. I just like to be explicit sometimes as it saves people time since they don't have to lookup if number of minutes or seconds or even hours is expected as input. That said, I'd love to see this in the AWS API/SDK in the first place. The motivation is mostly coming from The Clean Code, TL;DR version of relevant chapter here: http://blog.goyello.com/2013/05/17/express-names-in-code-bad-vs-clean/ Nonetheless the consistency with existing DSL is equally important (thanks for pointing it out 👍 ), so I'm totally fine with keeping it. I can give this a more thorough review this weekend and eventually merge, unless @catsby will be quicker and/or wants to merge this sooner. Looking at your 39 commits in total, it would be nice if you could squash these into 1 or 2 (functionality + docs). I believe that any reviewer will benefit from cleaner log, but if you will struggle doing that, we can deal with it. 😺 I usually use combination of |
Great, sounds good. I'll take a shot at squashing. |
My attempt at git rebase seems to have failed. Will the fact that I have done various upstream merges make this more complicated? |
@xaptronic No worries then! Just keep it as it is. Still better to have something that works than a nice git history. 😃 |
Sorry, I didn't have time to review this during the weekend, I was busy with a few other of my own PRs here. I'm leaving it for someone else to review. Although I'd really like to have scaling policies + CloudWatch metrics in Terraform. 😉 |
All in good time :) |
Closing in favour of #2201 |
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. |
Hello, This commit adds Autoscaling Scaling Policies and CloudWatch metric alarms as per this guide: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/policy_creating.html, see the section titled "Scaling with Metrics Using the AWS CLI". In particular I wanted these features in terraform in order to add metric based scaling to my infrastructure, however, I may continue to work on this area and add other features of autoscaling and cloudwatch.
I've added a few elementary TestAcc* cases.
I'm a bit new to this way of working so if you need any other information or if I'm missing some major pieces, by all means, let me know. I am looking for some initial feedback and then will begin to fill out the documentation pieces.
Thanks!