Created
July 11, 2018 18:54
-
-
Save lbjay/e22d4e983f9ce8b01a4825b11be6d698 to your computer and use it in GitHub Desktop.
sns for catracker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add a `.env` variable, `NOTIFICATION_EMAIL` | |
Then update the `run_stack_command` fabric task to pass that to cloudformattion as `NotificationEmail`. | |
# then in template.yml | |
Parameters: | |
... | |
NotificationEmail: | |
Type: String | |
Resources: | |
... | |
CATrackerNotificationTopic: | |
Type: AWS::SNS::Topic | |
Properties: | |
TopicName: !Sub "${AWS::StackName}-notification-topic" | |
Subscription: | |
- Protocol: email | |
Endpoint: !Ref NotificationEmail | |
Outputs: | |
... | |
SNSTopicArn: | |
Description: CATracker SNS Arn | |
Value: !Ref CATrackerNotificationTopic | |
OK, now that the SNS topic is in the stack outputs you'll be able to get it via the `stack_exports` return value | |
in the fabric tasks and add it to the remote app's `.env` in the same way the "RDSEndpoint" and "ELBEndpoint" get | |
used in the `app_configure` task. | |
The check out the `publish` method in the SNS boto3 docs | |
http://boto3.readthedocs.io/en/latest/reference/services/sns.html#client |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment