I am trying to add the tags to my existing VPC. I am trying to solve this problem using AWS cli for multiple VPC's. But could not find the appropriate command to add the tag using AWSCLI. Can someone please help. TIA.
You can add tags to the existing resources using create-tags
Adds or overwrites only the specified tags for the specified Amazon EC2 resource or resources. When you specify an existing tag key, the value is overwritten with the new value.
https://docs.aws.amazon.com/cli/latest/reference/ec2/create-tags.html
aws ec2 create-tags --resources vpc-1234567 --tags Key=Stack,Value=production
Or multiple tags
aws ec2 create-tags \
--resources vpc-1234567 i-1234567890abcdef0 \
--tags Key=webserver,Value= Key=stack,Value=Production
Make sure your default region is correct for VPC
or add region
to the cli command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With