Created
May 28, 2020 22:13
-
-
Save bujiie/c5266af971fd84a0742adbc7ef37ff73 to your computer and use it in GitHub Desktop.
Build an S3 resource only if the stage is known (i.e. do not build an S3 bucket for PR stages)
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
# Referenced from https://gist.github.com/DavidWells/be078deef45f8cb2e280ccc7af947392 | |
resources: | |
Description: Demo Site | |
Conditions: | |
IsProd: {"Fn::Equals" : ["${self:custom.stage}", "prod"]} | |
IsStaging: {"Fn::Equals" : ["${self:custom.stage}", "staging"]} | |
IsDev: {"Fn::Equals" : ["${self:custom.stage}", "dev"]} | |
IsKnownStage: {"Fn::Or": [{"Condition": "IsProd"}, {"Condition": "IsStaging"}, {"Condition": "IsDev"}]} | |
Resources: | |
MyS3Bucket: | |
Type: AWS::S3::Bucket | |
Condition: IsKnownStage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment