Bird
0
0

Which of the following is the correct syntax to add a tag with key Environment and value Production to an AWS EC2 instance using AWS CLI?

easy📝 Configuration Q12 of 15
AWS - Account and Billing
Which of the following is the correct syntax to add a tag with key Environment and value Production to an AWS EC2 instance using AWS CLI?
Aaws ec2 tag-instance --id i-1234567890abcdef0 --key Environment --value Production
Baws ec2 create-tags --resources i-1234567890abcdef0 --tags Key=Environment,Value=Production
Caws ec2 add-tag --instance i-1234567890abcdef0 --tag Environment=Production
Daws ec2 set-tags --resource i-1234567890abcdef0 --tags Environment:Production
Step-by-Step Solution
Solution:
  1. Step 1: Recall AWS CLI command for tagging

    The correct command is aws ec2 create-tags with resource ID and tags specified as Key=Value pairs.
  2. Step 2: Match syntax with options

    aws ec2 create-tags --resources i-1234567890abcdef0 --tags Key=Environment,Value=Production matches the correct syntax exactly.
  3. Final Answer:

    aws ec2 create-tags --resources i-1234567890abcdef0 --tags Key=Environment,Value=Production -> Option B
  4. Quick Check:

    Correct AWS CLI tag syntax [OK]
Quick Trick: Use 'create-tags' with Key= and Value= pairs [OK]
Common Mistakes:
  • Using wrong command names like add-tag or tag-instance
  • Incorrect tag format without Key= and Value=
  • Mixing resource and instance flags

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes