Forked from SteveHoggNZ/gist:cd3855a329632a3c3934adb80a5a646d
Created
December 12, 2019 04:32
-
-
Save GMKBabu/761c5a26853bd01c444a75101d0e349c to your computer and use it in GitHub Desktop.
CloudFormation / Nested stack example
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": "Master template that includes nested templates", | |
"Parameters": { | |
"DeployBastion": { | |
"Description": "Should a bastion server be deployed?", | |
"Default": "No", | |
"Type": "String", | |
"AllowedValues": ["No", "Yes"] | |
} | |
}, | |
"Resources": { | |
"VPCStack": { | |
"Type": "AWS::CloudFormation::Stack", | |
"Properties": { | |
"TemplateURL": "https://s3-ap-southeast-2.amazonaws.com/<REDACTED>/<REDACTED>.json", | |
"TimeoutInMinutes": "5" | |
} | |
}, | |
"BastionStack": { | |
"Type": "AWS::CloudFormation::Stack", | |
"Properties": { | |
"TemplateURL": "https://s3-ap-southeast-2.amazonaws.com/<REDACTED>/<REDACTED>.json", | |
"Parameters": { | |
"VpcId": { "Fn::GetAtt": ["VPCStack", "Outputs.VpcId"] }, | |
"DeployBastion": { "Ref": "DeployBastion" }, | |
"SubnetId": { "Fn::GetAtt": ["VPCStack", "Outputs.PublicSubnetA"] } | |
} | |
} | |
} | |
} | |
"Outputs": { | |
"VpcId": { | |
"Value": { | |
"Fn::GetAtt": ["VPCStack", "Outputs.VpcId"] | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment