Slide 6
Slide 6 text
ExportとImportValue
"Resources" : {
"WebServerInstance": {
"Type": "AWS::EC2::Instance",
"Properties": {
"InstanceType" : "t2.micro",
"NetworkInterfaces" : [{
"SubnetId" : { "Fn::ImportValue" : "WebSubnet" },
"GroupSet" : [ { "Fn::ImportValue" : "WebSG" } } ],
Outputs:
WebSubnet01:
Description: Web Public Subnet
Value: !Ref WebSubnet
Export:
Name: "WebSubnet"
WebSG01:
Description: Web Security Group
Value: !Ref WebSG
Export:
Name: "WebSG"
WebApp.yaml
Network.yaml
Export、ImportValueを使用することで、スタック(テンプレートファイル)間で値の受け渡しが
可能。
任意の名前を使用してExportできます。