Complete the code to add a tag key for cost tracking in AWS CloudFormation.
Resources:
MyBucket:
Type: AWS::S3::Bucket
Properties:
Tags:
- Key: [1]
Value: "ProjectX"The CostCenter tag key is commonly used for cost tracking in AWS resources.
Complete the AWS CLI command to tag an EC2 instance for cost tracking.
aws ec2 create-tags --resources i-1234567890abcdef0 --tags Key=[1],Value=Marketing
The CostCenter tag key is used here to assign the cost tracking tag to the EC2 instance.
Fix the error in the Terraform resource tagging block for cost tracking.
resource "aws_s3_bucket" "my_bucket" { bucket = "my-bucket" tags = { [1] = "Finance" } }
Tag keys are case-sensitive. CostCenter with capital C's is the correct standard tag key.
Fill both blanks to create a CloudFormation resource with tags for cost tracking and environment.
Resources:
MyInstance:
Type: AWS::EC2::Instance
Properties:
Tags:
- Key: [1]
Value: "12345"
- Key: [2]
Value: "Production"The tags CostCenter and Environment are used to track costs and deployment stage respectively.
Fill all three blanks to define a Terraform AWS resource with tags for cost tracking, owner, and environment.
resource "aws_instance" "web" { ami = "ami-0c55b159cbfafe1f0" instance_type = "t2.micro" tags = { [1] = "7890" [2] = "Alice" [3] = "Staging" } }
The tags CostCenter, Owner, and Environment help track billing, responsible person, and deployment stage.