Automatic AMI selection in AWS CloudFormation with Lambda

Share
Share

AWS CloudFormation is a useful tool to orchestrate your SUSE Linux Enterprise based workloads in Amazon’s public cloud. Hardcoding the AMI ID of the SUSE Linux Enterprise Server image you want to use in the template, or even a list of IDs if you need to support multiple AWS regions, works, but is inconvenient since you need to update the template every time you want to move to a new release of the base image.

But there is a way to dynamically select the AMI ID of the latest SUSE Linux Enterprise Server images, with the help of the SUSE Public Cloud info service and AWS Lambda. An embedded Lambda function in the template can fetch a list of image description from the SUSE Public Cloud info service, extract the AMI ID in question, and create a new instance. You can find a sample template in the Enceladus project in GitHub:
https://github.com/SUSE-Enceladus/cloud-formation/tree/master/pint

This template only works in AWS regions that support Lambda.

Share
(Visited 1 times, 1 visits today)

Leave a Reply

Your email address will not be published. Required fields are marked *

No comments yet

4,521 views