Image Builder via CloudFormation - get latest AMI ID for Windows

0

I have an image pipeline for Windows 2019 CIS Image. I have deployed a Lambda that looks up for latest CIS image and puts it in a SSM parameter.

In the image recipe (AWS::ImageBuilder::ImageRecipe) I have used the property: ParentImage: '{{resolve:ssm:/EC2/WIN2019CIS_AMI_ID}}'

This solution works however when I look at the Image recipe in the console, it looks like the ami-id gets hard coded in the recipe. So then next time when the image pipeline runs it will not get the new AMI from the SSM parameters.

I need to find a solution so when the next time the image builder runs, next month, it shoul fetch the latest ami from the SSM parameter.

The image I am after is - Windows 2019 CIS image. Looking for suggestions, thanks.

Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen