Description
To receive CloudFormation creation, update and rollback events through SNS, set notification_arns in the Ansible task.
Potential impact
Without another monitoring path, the team may learn of a failed deployment late.
Remediation
Verify permission to publish to the operational SNS topic, subscribe the responsible recipients and check that they receive a stack event.
Examples
The second task adds the stack-events topic in us-east-1. Supply the actual topic ARN, template URL and parameters.
Before
yaml
- name: Create CloudFormation stack
amazon.aws.cloudformation:
stack_name: ansible-cloudformation
state: present
region: us-east-1
disable_rollback: true
template_url: https://s3.amazonaws.com/my-bucket/cloudformation.template
template_parameters:
KeyName: jmartin
DiskType: ephemeral
InstanceType: m1.small
ClusterSize: 3
tags:
Stack: ansible-cloudformation
After
yaml
- name: Create CloudFormation stack
amazon.aws.cloudformation:
stack_name: ansible-cloudformation
notification_arns: arn:aws:sns:us-east-1:123456789012:stack-events
state: present
region: us-east-1
disable_rollback: true
template_url: https://s3.amazonaws.com/my-bucket/cloudformation.template
template_parameters:
KeyName: jmartin
DiskType: ephemeral
InstanceType: m1.small
ClusterSize: 3
tags:
Stack: ansible-cloudformation