尝试使用 aws cli 创建标记项。
aws ec2 create-security-group --group-name $group_name --description $my_description
我无法解析 documentation
--tag-specifications (list)
我试过
--tag-specifications KEY=Name,Value=$something
and --tags Key=Name,Value=$something
and --tags [Key=Name,Value=$something]
and --tags {[Key=Name,Value=$something]}
答案 0 :(得分:1)
我们需要传递两个属性
ResourceType:在本例中为 security-group
标签:键值对象数组
aws ec2 create-security-group --group-name 'test' --description 'test desc' --tag-specifications 'ResourceType=security-group,Tags=[{Key=purpose,Value=production},{Key=cost-center,Value=cc123}]'