Last active
November 26, 2019 21:01
-
-
Save rfpedrosa/00731a8d5ae4e05a8c22386319c3bfce to your computer and use it in GitHub Desktop.
Amplify monitory category - CF template
This file contains 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
{ | |
"AWSTemplateFormatVersion":"2010-09-09", | |
"Description":"SNS resource stack creation using Amplify CLI", | |
"Parameters":{ | |
"env":{ | |
"Type":"String" | |
}, | |
"alarmsTopicName":{ | |
"Type":"String" | |
}, | |
"alarmsSubscriptionEmailProd":{ | |
"Type":"String" | |
}, | |
"alarmsSubscriptionEmailTest":{ | |
"Type":"String" | |
} | |
}, | |
"Conditions":{ | |
"ShouldNotCreateEnvResources":{ | |
"Fn::Equals":[ | |
{ | |
"Ref":"env" | |
}, | |
"NONE" | |
] | |
}, | |
"IsEnvProd":{ | |
"Fn::Equals":[ | |
{ | |
"Ref":"env" | |
}, | |
"prod" | |
] | |
} | |
}, | |
"Resources":{ | |
"AlarmsTopic":{ | |
"Type":"AWS::SNS::Topic", | |
"Properties":{ | |
"TopicName":{ | |
"Fn::If":[ | |
"ShouldNotCreateEnvResources", | |
{ | |
"Ref":"alarmsTopicName" | |
}, | |
{ | |
"Fn::Join":[ | |
"", | |
[ | |
{ | |
"Ref":"alarmsTopicName" | |
}, | |
"-", | |
{ | |
"Ref":"env" | |
} | |
] | |
] | |
} | |
] | |
}, | |
"Subscription":[ | |
{ | |
"Endpoint":{ | |
"Fn::If":[ | |
"IsEnvProd", | |
{ | |
"Ref":"alarmsSubscriptionEmailProd" | |
}, | |
{ | |
"Ref":"alarmsSubscriptionEmailTest" | |
} | |
] | |
}, | |
"Protocol":"email" | |
} | |
] | |
} | |
} | |
}, | |
"Outputs":{ | |
"Region":{ | |
"Value":{ | |
"Ref":"AWS::Region" | |
} | |
}, | |
"AlarmsTopicArn":{ | |
"Value":{ | |
"Ref":"AlarmsTopic" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment