One of the many challenges organisations face when moving to AWS is the visibility of deployment activities into an account or “accounts”.
Organisations prefer using native tools to orchestrate cloud resources
(unless using abstraction tools that maintain state separately, such as Terraform). In the AWS context, orchestration is generally deployed through Cloudformation.
If your Organisation is using slack, and you want to provide an engineering or architecture committee visibility on activities in cloudformation or the deployment pipeline, you do not need to dashboard this elsewhere, you can configure Slack notifications in few simple steps, listed below.
In this example, i’ll walk through the basic configuration of the SNS topic and AWS Chatbot required to publish notifications to slack. In a real life scenarios, you also want to integrate this with your pipeline to look like the below.
First, create the SNS topic and do not create any subscriptions. The setup process will take care of that. For the purpose of this test, i did not configure anything else.
Then, from slack, I added the app AWS Chatbot, go to slack app directory and select “AWS Chatbot” and click add.
note: AWS Chatbot is in Beta but tested working with AWS Cloudformation. I have not been tested this with many other services.
This will take you to a link, from which, you will configure the below details. Select Slack as the client to configure.
I’m using a public channel for the purpose of this exercise (my channel’s name is “cloudformation”). If your Organisation is using a private channel, you will need the channel link and ID.
The setup process will take care of the IAM roles required for posting events to the topic.
Allow the form to create the required IAM roles, then choose the SNS topic you created in that form.
after you configure the above, you will see a client configuration appear like the below.
the SNS topic will have now a subscription to a slack HTTPS endpoint.
To test this, head to cloudformation, create a dummy stack and make sure notifications are sent through the SNS topic you created.
I created a test stack with a simple s3 bucket that will use the configure SNS topic for testing.
And as a result, i can see my stack updates in my slack channel.
You can now use this SNS topic with other AWS services to provide notifications, provided you allow IAM policies to post \ publish to the SNS topic.