Tag Image Builder output resources
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
In a distribution configuration, you can use dynamic tags in the output AMI name, the AMI description, and AMI tag values for AMIs, and in the container image description and container tags for container builds. Image Builder resolves them when it creates the output resources for a build. For more information about distribution settings, see Manage Image Builder distribution settings.
Image Builder supports the following dynamic tags:
-
{{imagebuilder:buildDate}}Resolves to the start date and time of the build, as an ISO 8601 timestamp. For example,
2026-11-24T16:40:25.000Z.To control the timestamp format, append a format string to the tag. For example,
{{imagebuilder:buildDate:yyyyMMdd}}resolves to20261124. The format can combine theyyyy(year),MM(month),dd(day),HH(hour),mm(minute), andss(second) specifiers. The other dynamic tags don't support a format. -
{{imagebuilder:buildVersion}}Resolves to the build version, which is the number at the end of the image's Amazon Resource Name (ARN). For example, the image ARN
arn:aws:imagebuilder:resolves the build version tous-west-2:111122223333:image/my-example-image/1.0.0/77. -
{{imagebuilder:imageName}}Resolves to the name of the image resource.
-
{{imagebuilder:imageVersion}}Resolves to the semantic version of the image, for example
1.0.0. It doesn't include the build version number.
The following example shows dynamic tags in the
amiDistributionConfiguration of a
CreateDistributionConfiguration request:
{ "name": "my-example-distribution", "distributions": [ { "region": "us-west-2", "amiDistributionConfiguration": { "name": "my-image {{imagebuilder:buildDate}}", "amiTags": { "SourceImageName": "{{imagebuilder:imageName}}", "SourceImageVersion": "{{imagebuilder:imageVersion}}/{{imagebuilder:buildVersion}}" } } } ] }
In a resolved AMI name, Image Builder replaces each colon with a hyphen, because colons
aren't valid in AMI names. For example, the AMI name in the preceding request
resolves to my-image 2026-11-24T16-40-25.000Z. In a resolved container
tag, Image Builder replaces both colons and spaces with hyphens. These replacements apply to
the whole resolved field value, not just the text that a dynamic tag resolves to.
Image Builder doesn't change description fields or AMI tag values.
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:. This tag contains the ARN of the Image Builder image resource that was used to create the AMI.us-west-2:123456789012:image/simple-recipe-linux/1.0.0/10"