"整合":{" IntegrationHttpMethod" :" GET"," Type" :" HTTP"," Uri" :" http:// {" Fn :: GetAtt" :[" MyEC2Instance"," PublicIp" ]}:8080 / rest"
答案 0 :(得分:0)
我会查看Sub函数。如果您想将{"Fn::GetAtt" : [ "MyEC2Instance", "PublicIp" ] }
的结果放在示例字符串中,可以使用
"MyGatewayMethod": {
"Type": "AWS::ApiGateway::Method",
"Properties": {
...
"Integration": {
"Type": "HTTP",
"IntegrationHttpMethod": "GET",
"Uri": { "Fn::Sub":"http://${MyEC2Instance.PublicIp}:8080/rest" }
}
}
}
Sub
方法可用于替换GetAtt
值和Ref
值。
答案 1 :(得分:0)
感谢。我用这个函数Fn :: Join
解决了它“Integration”:{“IntegrationResponses”:[{“StatusCode”:200}],“IntegrationHttpMethod”:“GET”,“Type”:“HTTP”,“Uri”:{“Fn :: Join”: [“”,[“http://”,{“Fn :: GetAtt”:[“MyEC2Instance”,“PublicIp”]},“:8080 / rest”]]}}
} }