尝试创建ebs卷的快照。我在aws cli windows中有以下命令
aws --profile ade --region us-east-1 ec2 create-snapshot --volume-id vol-
012709ebb854c5fdd --description 'c-drive of i-00ca23fae0887e018' --tags-
specifications 'ResourceType=snapshot,Tags=[{Key=Product,Value=csf},
{Key=Service,Value=datamigration},{Key=Name,Value=cdrive-dms},
{Key=Team,Value=DMS},{Key=Owner,Value=alexwolff}]'
我得到答复:
未知选项:--tag规范,ResourceType =快照,标签[{Key = Product,Value = csf},{Key = Service,Value = datamigration},{Key = Name,Value = cdrive-dms}, {Key = Team,Value = DMS},{Key = Owner,Value = alexwolff}]
这必须是一个简单的语法错误...有人可以发现吗?我试图将单引号切换为双引号,反之亦然。
谢谢。
答案 0 :(得分:0)
最终对我有用的语法是:
aws --profile ade --region us-east-1 ec2 create-snapshot --volume-id vol-
012709ebb854c5fdd --description "c-drive of i-00ca23fae0887e018" --tag-specification
'ResourceType=snapshot,Tags=[{Key=Product,Value=csf},{Key=Service,Value=datamigration},
{Key=Name,Value=cdrive-dms},{Key=Team,Value=DMS},{Key=Owner,Value=alexwolff}]'
标签规范