我想創建一個ec2實例,並且我希望能夠創建一個包含ec2實例公有DNS名稱的文件,雖然在下面的代碼中我得到造成線循環依賴錯誤:AWS Cloud Formation - 如何獲取公共ip地址的ec2實例
"server_name = \"",{ "Fn::GetAtt" : [ "ECServer", "PublicDnsName" ]},"\"\n","\n"
是否有可能得到,當我試圖創建EC2實例中的部分公共DNS名稱?
"ECServer": {
"Type": "AWS::EC2::Instance",
"Metadata" : {
"AWS::CloudFormation::Init" : {
"configSets": {
"Install": ["ECServerConfig"]
},
"ECConfig": {
"files": {
"/tmp/test.txt" : {
"content": { "Fn::Join" : ["", [
"server_name = \"",{ "Fn::GetAtt" : [ "ECServer", "PublicDnsName" ]},"\"\n","\n"
]]},
"mode" : "000644",
"owner": "root",
"group": "root"
}
}
}
}
},