amazon-web-services - 我无法使用 get-launch-template-data 的输出创建模板
问题描述
我开始玩 AWS。我使用 AWS 管理控制台创建了一个 EC2 实例。我希望能够使用 CLI 创建新的类似实例,因此我一直在查看 get-launch-template-data (其中指出“检索指定实例的配置数据。您可以使用此数据创建一个启动模板。”)并期望其输出是 create-launch-template 的有效输入。
我查看了 AWS CLI 文档,并查看了 StackOverflow,但我发现的唯一相关问题是: 无法使用 awscli和 Amazon 启动模板创建启动模板 - 更新的 AMI
我一直在运行:
aws ec2 get-launch-template-data --instance-id "i-xxx" --query "LaunchTemplateData" > MyLaunchData
aws ec2 create-launch-template --launch-template-name xxx --launch-template-data file://MyLaunchData
我得到的错误是:
An error occurred (InvalidInterfaceType.Malformed) when calling the CreateLaunchTemplate operation: '%s' is not a valid value for interface type. Enter a valid value and try again.
我认为 MyLaunchData 的相关部分是:
"NetworkInterfaces": [
{
"AssociatePublicIpAddress": true,
"DeleteOnTermination": true,
"Description": "",
"DeviceIndex": 0,
"Groups": [
"sg-xxx"
],
"InterfaceType": "interface",
"Ipv6Addresses": [],
"PrivateIpAddresses": [
{
"Primary": true,
"PrivateIpAddress": "xxx"
}
],
"SubnetId": "subnet-xxx"
}
],
有人可以指出我正确的方向吗?
(为了隐私,我显然已经用 xxx 替换了我认为是我的数据)
非常感谢
解决方案
不允许使用 InterfaceType:
“%s”不是接口类型的有效值
我知道您正在使用get-launch-template-data的输出,但没有"InterfaceType": "interface"。
InterfaceType
Indicates the type of network interface. To create an Elastic Fabric Adapter (EFA),
specify efa. For more information, see Elastic Fabric Adapter in the Amazon Elastic
Compute Cloud User Guide.
Required: No
Type: String
Allowed Values: efa
推荐阅读
- arrays - Angular - formGroups 数组的 setValue() 设置整个 formArray 值的最后一个对象
- visual-studio - 转换 netcore2.2 -> netstandard2:runcommand 属性未定义
- node.js - 命令行和 Node.js 通信(不关闭)
- c - 有没有办法在不使用 void 指针的情况下返回 C 函数中的任何类型?
- javascript - npm install 命令中显示了一些漏洞
- mysql - 如何检索连接表SQL的所有记录
- mongodb - 每个集合 MongoDB 有多个 JSON Schema 验证器
- color-space - 向量空间中 rgb 颜色的向量长度是什么意思
- javascript - 在 React 组件中将 Immutable.Maps 作为 props 传递
- java - 您认为编写此算法的最简洁的方法是什么?