amazon-web-services - 使用 aws cli 创建资源时如何使用标签选项?
问题描述
尝试使用 aws cli 创建标记项目。
aws ec2 create-security-group --group-name $group_name --description $my_description
我无法解析文档
--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]}
解决方案
我们需要传递两个属性
资源类型:在这种情况下
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}]'
推荐阅读
- python - 货币未显示在 MoneyField 的总和中
- python - 如何在字符串d中指定一个字符串
- python - 如何使用open cv python从倾斜图像中获取拉直图像
- python - 如何区分列表列表中的每个元素?
- android - CameraX 和 MediaRecorder 用于录制视频
- flutter - Flutter Package:未压缩的包存档太大
- vaadin - Vaadin Flow Treegrid - 展开后的空行
- c++ - 根据数组内容查找文档 [MongoDB, C++]
- javascript - Nodemailer 附件为空
- amazon-web-services - 适用于其他 VM 的 AWS CodeDeploy