How to setup SNS notifications for aws_ssm_maintenance_window_task in Terraform?

385 views
Skip to first unread message

egul...@gmail.com

unread,
Jun 13, 2018, 12:08:58 PM6/13/18
to Terraform

Hello everyone,
it looks like there is no option to setup SNS notifications for task in SSM in terraform.

Am I missing that because there is nothing on the doc page and we do have such option through the console.

Have anyone been successful in setting this up or currently this is not supported by Terraform?


Thank you,
Ernest


Sean Hull

unread,
Jun 13, 2018, 2:03:20 PM6/13/18
to terrafo...@googlegroups.com

I ran into this problem too.

resource "aws_sns_topic" "my_sns_topic" {
#  count = length(var.alarm-subscribe-list)
  name      = "my_sns_topic"

  

  provisioner "local-exec" {
    command = "aws sns subscribe --topic-arn ${self.arn} --protocol email --notification-endpoint ${element(var.alarm-subscribe-list, 1)}"
  }
}


However this only works for a singler subscriber.  Subsequent subscribers you have to add yourself with this command line:

$ aws sns subscribe --topic-arn arn:aws:sns:us-east-1:012345678901:my_sns_topic --protocol email --notification-endpoint us...@gmail.com




--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/cd59858f-2eb7-4b86-a12a-6d9799255a74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

egul...@gmail.com

unread,
Jun 13, 2018, 2:10:41 PM6/13/18
to Terraform
Hi Sean,

I'm asking how to to configure SNS parameters in System Manager not how to add people to SNS topic :).
It looks like this feature is missing in Terraform.

Sean Hull

unread,
Jun 13, 2018, 2:14:22 PM6/13/18
to terrafo...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages