我有一个带有LaunchConfig
. 在UserData
我需要引用正在创建的实例的公共 IP。我想使用Fn::GetAtt
,但它需要逻辑名称,我不确定在使用时如何定义它LaunchConfig
。
"LaunchConfig": {
"Type" : "AWS::AutoScaling::LaunchConfiguration",
"Metadata" : {"..."},
"Properties": {
"ImageId" : "...",
"InstanceType" : { "Ref" : "InstanceType" },
"SecurityGroups" : [ {"Ref" : "WebServerSecurityGroup"} ],
"KeyName" : { "Ref" : "KeyName" },
"UserData" : { "Fn::Base64" : { "Fn::Join" : ["", [
"..."
]]}}
}
},
Run Code Online (Sandbox Code Playgroud)