-
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
Support for ASG scaling notification configuration (SNS) #1419
Comments
+1 |
2 similar comments
+1 |
👍 |
I'm working on this now. Technically I'm adding sns_topic resources, but will be rolling up the AS group change as well. Expect a PR in a couple days or early next week. |
+1 |
#1974 is currently the leading PR for this. Please subscribe to that issue if you'd like to keep informed or see when it's merged. Closing this, thanks! |
Or maybe that PR is still a work in progress... 😧 |
+1 |
1 similar comment
+1 |
I have been trying to follow all the alternative threads for ASG notifications. I know that new features (SNS_TOPIC and SNS_TOPIC_DESCRIPTION) have been added but the support for ASG notifications still doesn't seem to exist I think this issue should be reopened |
Hey all – yeah looks like I closed this prematurely. For ASG notifications, I'm envisioning a new resource: resource "aws_autoscaling_notification" "example" {
group_name = "${aws_autoscaling_group.asg_example.name}"
notifications = ["EC2_INSTANCE_LAUNCH", "EC2_INSTANCE_TERMINATE"]
topic_arn = "${aws_sns_topic.some_topic.arn}"
} Does that sound in-line with what you're thinking? |
@catsby -- why not just embed it within the aws_autoscaling_group like an SG's ingress / egress rules or the like? I'm not sure there's really any utility with having it outside the resource. Since you have to map it to an ASG anyway, it's not like you could use it for multiple ASG's. It just feels a little weird to do this in the config:
rather than:
|
@ctiwald we're kind of trying to move away from that model (sub resources). They get hairy as they're currently handled. We have plans to re-work it and make them a better citizen, but it's a ways off. For example, we recently broke out security group rules into their own top level resource,
My suggested syntax does not support multiple ASGs, but it's not immediately apparent that we couldn't manage it that way in the future. There is no limitation (that I can see) on AWS that enforces a 1 to 1 here. I just created two ASGs and applied identical notifications to them. |
I would do it that way, for the reason of opening up to apply to multiple ASGs in the future, primarily. Unless you see something in the API docs that limit this that I'm not seeing? 😄 I welcome other opinions here as well, if anyone has them. The plan isn't set in stone, but I'm still leaning towards a separate resource. |
The other benefit of a top level resource is that it doesn't dictate that all notifications be known at ASG definition time - it opens up the possibility for a module author to yield and ASG and for a module consumer to add notifications to said ASG. I'm hoping that we'll be able to circle back and reimplement the sub-resource config style as syntactic sugar, but in order to do that we'll need to lean towards top level resources for now. |
I opened #2197 as a proposal , and to track development |
Nah that makes sense to me. Having grappled with the code around sub-resources I'm not particularly envious of you extending them that way anyway. I thought I saw 1:1 mapping between them in some doc somewhere @catsby, but now that I look around I can't seem to find it. All of that makes sense to me. |
Haha, thanks @catsby. I'll leave this one for you guys. Truth be told I actually looked to implement this a few weeks back, cracked open From my limited "programming on terraform" perspective, +1 for top level resources. |
Hey all – #2197 has been implemented, tested, and now documented. |
I just merged #2197 to add this feature. |
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. |
It would be great if the aws_autoscaling_group implemented support for scaling notifications via SNS as would normally be done with the autoscaling: PutNotificationConfiguration API. Still requires some external setup for the SNS topic, but when Terraform supports SNS/SQS the SNS topic ARN could simply be a aws_sns_topic resource.
Here is a straw man for a possible format for the notification:
I'm not sure whether autoscaling groups support multiple notification configurations being attached to a single group.
The text was updated successfully, but these errors were encountered: