ad

AWS CLI运行实例带着名称标签和EBS卷-英雄云拓展知识分享

匿名投稿 315 2024-01-22

我正在尝试使用CLI在命令行上启动新的EC2实例。我需要做的是利用名称标签并添加EBS量。EBS卷还应具着名称标签。到至今为止为止,这就是我所具有的。

而且我遇到了使用毛病:

λ aws ec2 run-instances --image-id ami-xxxxx --count 1 --instance-type r3.xlarge --key-name timd --security-group-ids sg-xxxxx --subnet-id subnet-xxxxx --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=ENC_TEST}]' 'ResourceType=volume,Tags=[{Key=Engagement,Value=8000xxxx}]' --block-device-mappings 'DeviceName=/dev/sdf,VirtualName=data,Ebs={Encrypted=yes,DeleteOnTermination=yes,VolumeSize=250,VolumeType=string}' --profile=govcloud-nonprod

usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]

AWS CLI运行实例带着名称标签和EBS卷-英雄云拓展知识分享

To see help text, you can run:

aws help

aws <command> help

aws <command> <subcommand> help

Unknown options: --tag-specifications, 'ResourceType=volume,Tags=[{Key=Engagement,Value=800000xxxx}]', 'ResourceType=instance,Tags=[{Key=Name,Value=ENC_TEST}]'

有人可以帮助我超出这一点吗?

看答案

--tag-specifications 是引入后真个功能 2017年3月

确保更新您的AWS CLI版本以反应此更改。

也是 --block-device-mapping 是不正确的,定义内涵是

        {

"DeviceName": "string",

"VirtualName": "string",

"Ebs": {

"Encrypted": true|false,

"DeleteOnTermination": true|false,

"Iops": integer,

"SnapshotId": "string",

"VolumeSize": integer,

"VolumeType": "standard"|"io1"|"gp2"|"sc1"|"st1"

},

"NoDevice": "string"

}

...

所以你应当有

--block-device-mappings "[{\"DeviceName\":\"/dev/sdf\",\"VirtualName\":\"data\",\"Ebs\":{\"Encrypted\"=true,\"DeleteOnTermination\"=true,\"VolumeSize\"=250,/"VolumeType\"=\"standard\"}}]"


🚀🌟 点击注册 免费试用超级应用平台-英雄云企业级hpapaas 🌟🚀 😃👉🌐

免责声明:

本网址(www.yingxiongyun.com)发布的材料主要源于独立创作和网友匿名投稿。此处提供的所有信息仅供参考之用。我们致力于提供准确且可信的信息,但不对材料的完整性或真实性作出任何保证。用户应自行验证相关信息的正确性,并对其决策承担全部责任。对于由于信息的错误、不准确或遗漏所造成的任何损失,本网址不承担任何法律责任。本网站所展示的所有内容,如文字、图像、标志、音频、视频、软件和程序等的版权均属于原创作者。如果任何组织或个人认为网站内容可能侵犯其知识产权,或包含不准确之处,请即刻联系我们进行相应处理。

标签:Amazon-Web-Services AWS-CLI
上一篇:python / pandas缩写我的数字。-英雄云拓展知识分享
下一篇:如何使用Musescore在Ipython/Python中使用Music21显示音乐符号,而无需每次重新打开。-英雄云拓展知识分享
相关文章
×