Skip to content

Instantly share code, notes, and snippets.

@gene1wood
Last active September 8, 2022 00:15
Show Gist options
  • Save gene1wood/ae2b77a424d220f2d0605cb8637baa33 to your computer and use it in GitHub Desktop.
Save gene1wood/ae2b77a424d220f2d0605cb8637baa33 to your computer and use it in GitHub Desktop.
Example AWS CloudFormation template which prevents deploying in an unsupported region
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
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