Skip to content

How to set ami name through cloud formation image builder

0

I have a Cloud Formation yaml the builds an image using image builder services.
I don't seem to find a way to change the ami name.
It always uses the AWS::ImageBuilder::ImageRecipe's Properties.Name + some date.

How can I override it or change it after build is done?

Thanks

2 Answers
3
Accepted Answer

Hello

To customize the name of your output AMI built with Image Builder, update the distribution configuration name in your CloudFormation template.

Additionally, you may consider adding extra details to your custom AMI name. Refer.

DistributionConfiguration:
            Name: !Sub '${OutputAMIname}-{{ imagebuilder:buildDate }}-{{ imagebuilder:buildVersion }}'
answered 2 years ago
EXPERT
reviewed 2 years ago
  • Looks like the is '{{ imagebuilder:buildDate }}' mandatory :/ But if I create just an ami from a running vm, I don't need it. Why is that? Can I skip it?

    Resource handler returned message: "The value supplied for parameter 'distributions[0].amiDistributionConfiguration.name' is not valid. The EC2 AMI name must contain '{{ imagebuilder:buildDate }}' to ensure that the name will be unique.
    
0

Adding a build date to AMI created through ImageBuilder is to maintain uniqueness for the AMI. Try to use AMItags - Name: {Custom_AMI_Name_you_want}.

answered 2 years ago
  • I was able to set tags, but I must also use that {{ imagebuilder:buildDate }}. Isn't there any way to remove it?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.