change-resource-tags.sh

#!/bin/bash

ids=$(aws ec2 describe-instances --filter "Name=tag:Project,Values=ERPSystem" "Name=tag:Environment,Values=development" --query 'Reservations[*].Instances[*].InstanceId' --output text)

echo "Creating tags"

aws ec2 create-tags --resources $ids --tags 'Key=Version,Value=1.1'

echo "Tags created"

  

原文地址:https://www.cnblogs.com/oskb/p/5943361.html