Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport for ASG scaling notification configuration (SNS) #1419
Comments
mitchellh
added
enhancement
provider/aws
labels
Apr 9, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
matthewford
commented
Apr 16, 2015
|
+1 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
+1 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ctiwald
May 7, 2015
Contributor
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.
|
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
+1 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
catsby
May 18, 2015
Member
#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!
|
#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! |
catsby
closed this
May 18, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Or maybe that PR is still a work in progress... |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nelg
commented
May 21, 2015
|
+1 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
+1 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stack72
Jun 1, 2015
Contributor
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
|
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 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
catsby
Jun 2, 2015
Member
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?
|
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
reopened this
Jun 2, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ctiwald
Jun 2, 2015
Contributor
@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:
resource "some_thing" "my_thing" {
name = "my_thing"
}
resource "other_thing_that_only_exists_in_the_context_of_some_thing" "another_thing" {
some_thing = "${some_thing.my_thing.name}"
}
rather than:
resource "some_thing" "my_thing" {
name = "my_thing"
other_thing {
...
}
}
|
@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:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
catsby
Jun 2, 2015
Member
@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, aws_security_group_rule.
Since you have to map it to an ASG anyway, it's not like you could use it for multiple ASG's.
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.
|
@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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
catsby
Jun 2, 2015
Member
It just feels a little weird to do this in the config:
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.
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
phinze
Jun 2, 2015
Member
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.
|
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
I opened #2197 as a proposal , and to track development |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ctiwald
Jun 2, 2015
Contributor
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.
|
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ctiwald
Jun 2, 2015
Contributor
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 resource_aws_autoscaling_group.go, stared down the idea of implementing the sub-resource and then... I dunno. I think went hiking or to the bar or something.
From my limited "programming on terraform" perspective, +1 for top level resources.
|
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
catsby
Jun 5, 2015
Member
Hey all – #2197 has been implemented, tested, and now documented.
If you can, please review and test out. Thanks!
|
Hey all – #2197 has been implemented, tested, and now documented. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
catsby
Jun 5, 2015
Member
I just merged #2197 to add this feature.
Let me know if you need anything else!
|
I just merged #2197 to add this feature. |
willmcg commentedApr 7, 2015
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.