gpt4 book ai didi

amazon-web-services - 网络接口(interface)。并且不能在同一请求 Cloud-Formation 上指定实例级子网 ID

转载 作者:行者123 更新时间:2023-12-03 18:15:42 25 4
gpt4 key购买 nike

template used

我正在尝试按照示例 http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/working-with-templates-cfn-designer-walkthrough-createbasicwebserver.html 构建一个 aws cloud-formation 堆栈

但是,堆栈在创建 ec2 实例时失败并出现错误不能在同一请求上指定网络接口(interface)和实例级子网 ID

可以让我知道缺少什么。我检查了参数,看起来都很好。使用的模板已共享

最佳答案

这是一个多次定义的 PublicSubnet 属性导致了这个问题。它在“网络接口(interface)”中定义一次,并在 SubnetId 中定义一次可分离性:{“Ref”:“公共(public)子网”。

下面粘贴了导致此问题的特定代码段

"NetworkInterfaces": [
{
"GroupSet": [
{
"Ref": "webserverSG"
}
],
"AssociatePublicIpAddress": "true",
"DeviceIndex": "0",
"DeleteOnTermination": "true",
"SubnetId": {
"Ref": "PublicSubnet"
}
}
],
"UserData": {
"Fn::Base64": {
xxxx
xxxxx
xxxx

"SubnetId": {
"Ref": "PublicSubnet"
}

关于amazon-web-services - 网络接口(interface)。并且不能在同一请求 Cloud-Formation 上指定实例级子网 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42995644/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com