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

provider/aws: Paginate the notifications returned for ASG Notifications #3043

Merged
merged 2 commits into from
Aug 31, 2015

Conversation

catsby
Copy link
Contributor

@catsby catsby commented Aug 20, 2015

Update AutoScaling Group Notifications to page through results of DescribeNotificationConfigurations. There is a result for each Notification Type : Group pair, so the list can be long if you have a lot, like so:

resource "aws_autoscaling_group" "bar" {
  count = 20
  name = "foobar3-terraform-test-${count.index}"
  [...]
}

resource "aws_autoscaling_notification" "example" {
  group_names = [
    "${aws_autoscaling_group.bar.*.name}",
  ]
  notifications  = [
    "autoscaling:EC2_INSTANCE_LAUNCH",
    "autoscaling:EC2_INSTANCE_TERMINATE",
    "autoscaling:TEST_NOTIFICATION"
  ]
    topic_arn = "${aws_sns_topic.user_updates.arn}"
}

That will generate 60 results in the DescribeNotificationConfigurations call, but it's paginated unless you specify the max records. Max records is limited to 200, so it's better to just paginate since it's provided for us.

Fixes #2852

@stack72
Copy link
Contributor

stack72 commented Aug 21, 2015

@catsby works well - just tested this!

Thanks :)

@stack72
Copy link
Contributor

stack72 commented Aug 27, 2015

@catsby any way this can be merged? Every terraform apply shows me ASG changes :) So it panics the devs haha

catsby added a commit that referenced this pull request Aug 31, 2015
provider/aws: Paginate the notifications returned for ASG Notifications
@catsby catsby merged commit 81af6e1 into master Aug 31, 2015
@catsby catsby deleted the b-aws-paginate-asg-notifications branch August 31, 2015 13:41
@stack72
Copy link
Contributor

stack72 commented Aug 31, 2015

@catsby thanks for merging this - this has solved my continual changes issue :)

@ghost
Copy link

ghost commented May 1, 2020

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.

@ghost ghost locked and limited conversation to collaborators May 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with aws_autoscale_notifications
2 participants