【发布时间】:2021-05-13 17:35:57
【问题描述】:
我正在运行下面的命令以从现有的带有标签的 ec2 服务器创建 ami。下面是我在 redhat linux 8.3 上运行的命令
aws ec2 create-image --instance-id $instance_id --name "$ami_name" --region $region --description "$desc" --no-reboot --tags-specifications 'ResourceType=image,Tags=[{Key='Owner',Value='Some_one'},{Key='Environment',Value='Production:Dev'},{Key='Stack',Value='ETL'},{Key='Role',Value='Database'}]'
我正确替换了所有变量,但是 --tags-specifications 存在一些问题。 我尝试了以下带有标签规范的选项,但它们都不适合我。
--tags-specifications 'ResourceType=image,Tags=[{Key=Owner,Value="Some_one"},{Key=Environment,Value="Production:Dev"},{Key=Stack,Value="ETL"},{Key=Role,Value="Database"}]'
--tags-specifications 'ResourceType=image,Tags=[{Key=Owner,Value=Some_one},{Key=Environment,Value=Production:Dev},{Key=Stack,Value=ETL},{Key=Role,Value=Database}]'
--tags-specifications 'ResourceType=image,Tags=[{Key='Owner',Value="Some_one"},{Key='Environment',Value="Production:Dev"},{Key='Stack',Value="ETL"},{Key='Role',Value="Database"}]'
--tags-specifications, ResourceType=image,Tags=[{Key="Owner",Value="Some_one"},{Key="Environment",Value="Non-Production:Dev"},{Key="Stack",Value="ETL"},{Key="Role",Value="Database"}]
谁能告诉我这里出了什么问题?
【问题讨论】:
-
您的 aws-cli 版本是什么?
-
我有以下 aws-cli 版本。
# aws --version aws-cli/2.0.30 Python/3.7.3 Linux/4.18.0-240.22.1.el8_3.x86_64 botocore/2.0.0dev34 -
下面是运行命令
python3 -m pip install awscli --upgrade后的版本。# aws --version aws-cli/1.19.70 Python/3.6.8 Linux/4.18.0-240.22.1.el8_3.x86_64 botocore/1.20.70
标签: linux bash amazon-web-services aws-cli