Last active
September 8, 2022 00:15
-
-
Save gene1wood/ae2b77a424d220f2d0605cb8637baa33 to your computer and use it in GitHub Desktop.
Example AWS CloudFormation template which prevents deploying in an unsupported region
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: Example of a region constraint | |
Mappings: | |
TheRegionYouAreDeployingIn: | |
us-west-2: | |
IsNotSupportedPleaseUseADifferentRegion: True | |
us-west-1: | |
IsNotSupportedPleaseUseADifferentRegion: True | |
Conditions: | |
RunningInAllowedRegion: !Equals [ !FindInMap [ TheRegionYouAreDeployingIn, !Ref 'AWS::Region', IsNotSupportedPleaseUseADifferentRegion ] , True ] | |
Resources: | |
TestTopic: | |
Type: AWS::SNS::Topic | |
Properties: | |
DisplayName: A test sns topic | |
TopicName: TestSNSTopic |
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
Template error: Unable to get mapping for TheRegionYouAreDeployingIn::us-east-1::IsNotSupportedPleaseUseADifferentRegion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment