Add an optional ImageId SSM Parameter Path #691
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds an optional String parameter to the elastic-ci stack parameter list. If given this is expected to be an SSM Parameter Path. This cannot be typed as an
AWS::SSM::Parameter
at the top level because that would make it mandatory. Instead, if given, a substack with aAWS::SSM::Parameter::Value<AWS::EC2::Image::Id>
parameter is brought in whose output is the value we need.Example error when using an
AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>
parameter with aDefault: ""
:This change removes the
UseDefaultAMI
condition and replaces it withHasImageId
andHasImageIdParameter
conditions. Precedence is: the plainImageId
parameter, the SSM parameter path, then the default AMI mapping.The given
TemplateURL
I’ve used here won’t work because it’s file system relative and we don’t useaws cloudformation package
to preprocess the template. We’ll either need to add something to the build system to make this work, or pre-deploy the new template somewhere we can reference with an S3 url. I don’t anticipate this substack template changing often and would lean towards separately packaging and deploying thessm-ami.yml
template to S3, and using a static semver'd URL to this template in the mainaws-stack.yml
file. This would avoid any potentially complex additions to the current build system.