0

In AWS, can a Systems Manager Parameter Store parameter (with the aws:ec2:image data type) be referenced directly in the AMI field of a Launch Template used by an EC2 Auto Scaling Group, so that the new EC2 instances will automatically start with the most current AMI specified by that parameter? (Or is it necessary to separately configure EventBridge to monitor for parameter update events and trigger a Lambda to update the ASG configuration after each occasion, to achieve this effect?)

The docs state "You can reference Systems Manager parameters in your scripts, commands, SSM documents, and configuration and automation workflows"; but it isn't clear what "configuration" (or "workflows") mean in this context. Can parameter references be used in the settings of arbitrary AWS infrastructure (anywhere in place of text strings or numerical values), and if so does this cause AWS to dynamically update the resource each time the parameter value changes? Or do infrastructure updates still need to be propagated manually (by re-running scripts etc); is the {{ssm:param-name}} syntax only for use in CloudFormation templates or the AWS CLI?

benjimin
  • 121
  • 3

1 Answers1

0

From the launch template API docs: in the ImageId field of the launch template data, "resolve:ssm:parameter-name" is accepted as a valid string (to defer resolving the parameter until upon launch of the instance).

It appears that specific features have been added to both Parameter Store and Launch Templates to support exactly the use case considered here.

This also suggests that {{ssm:parameter-name}} syntax is probably not a generally supported feature (and might only be resolved during parsing of a CloudFormation template, before any resources are live)?

(*Incidentally, the acronym SSM looks unexplained now but presumably the leading S formerly stood for Simple. It was evidently an AWS policy to name everything either simple or elastic.)

benjimin
  • 121
  • 3