Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Tag Image Builder output resources

Focus mode
Tag Image Builder output resources - EC2 Image Builder

Tagging your resources can be useful for filtering and tracking resource costs, or other categories. You can also control access based on tags. For more information about tag-based authorization, see Authorization based on Image Builder tags

Image Builder supports the following dynamic tags:

  • - {{imagebuilder:buildDate}}

    Resolves to the build date/time at build time.

  • - {{imagebuilder:buildVersion}}

    Resolves to a build version, which is a number that is located at the end of an Image Builder Amazon Resource Name (ARN.) For example, "arn:aws:imagebuilder:us-west-2:123456789012:component/myexample-component/2019.12.02/1" shows the build version as 1.

To help you keep track of Amazon Machine Images (AMIs) that you've distributed, Image Builder automatically adds the following tags to your output AMIs.

  • "CreatedBy":"EC2 Image Builder"

  • "Ec2ImageBuilderArn":"arn:aws:imagebuilder:us-west-2:123456789012:image/simple-recipe-linux/1.0.0/10". This tag contains the ARN of the Image Builder image resource that was used to create the AMI.

Tag a resource from the AWS CLI

The following example shows how to use an imagebuilder CLI command to to add and tag a resource in EC2 Image Builder. You must provide the resourceArn and the tags to apply to it.

The example tag-resource.json contents are as follows:

{ "resourceArn": "arn:aws:imagebuilder:us-west-2:123456789012:image-pipeline/my-example-pipeline", "tags": { "KeyName": "KeyValue" } }

Run the following command, which references the preceding tag-resource.json file.

aws imagebuilder tag-resource --cli-input-json file://tag-resource.json

Untag a resource from the AWS CLI

The following example shows how to use an imagebuilder CLI command to remove a tag from a resource. You must provide the resourceArn and the keys to remove the tag.

The example untag-resource.json contents are as follows:

{ "resourceArn": "arn:aws:imagebuilder:us-west-2:123456789012:image-pipeline/my-example-pipeline", "tagKeys": [ "KeyName" ] }

Run the following command, which references the preceding untag-resource.json file.

aws imagebuilder untag-resource --cli-input-json file://untag-resource.json

List all of the tags for a specific resource from the AWS CLI

The following example shows how to use an imagebuilder CLI command to list all the tags for a specific resource.

aws imagebuilder list-tags-for-resource --resource-arn arn:aws:imagebuilder:us-west-2:123456789012:image-pipeline/my-example-pipeline
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.