I'm referring to the following AWS documentation, attempting to use the CLI (from Windows) to launch an EC2 instance with tags specified at launch time:
https://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#Using_Tags_CLI
I ran into some issues, so I decided to try the exact command as specified in the documentation:
aws ec2 run-instances --image-id ami-abc12345 --count 1 --instance-type t2.micro --key-name MyKeyPair --subnet-id subnet-6e7f829e --tag-specifications 'ResourceType=instance,Tags=[{Key=webserver,Value=production}]' 'ResourceType=volume,Tags=[{Key=cost-center,Value=cc123}]' This results in the following error:
Error parsing parameter '--tag-specifications': Expected: '=', received: ''' for input: 'ResourceType=instance,Tags=[{Key=webserver,Value=production}]' ^ So, how exactly do you specify the tags for run-instances?