fix: shorten callerreference value #88
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.
What I'm Changing
When deploying to production, we received an error from CloudFormation when creating a
CloudFrontSigningPublicKey
:This is due to the fact that in our code to create a CloudFrontSigningPublicKey we create a long composite value:
animl-ingest/serverless.yml
Lines 480 to 488 in ef7fc9c
Reviewing the docs1, we see that the
AWS::StackId
is an ARN of the CloudFormation stack:Appending this to the other values likely places us over character limits. This PR shortens the
CallerReference
valueHow I Did It
The docs2 for a
CallerReference
describes as such:So the particular value of the string does not seem important, aside from it being unique per deployment (ie we wouldn't want two stacks to both be deploying and competing for the same
CallerReference
value).Given this, I think we'd be fine by simply using the
AWS::StackName
value.Footnotes
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html#cfn-pseudo-param-stackid ↩
https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-properties-cloudfront-publickey-publickeyconfig.html#cfn-cloudfront-publickey-publickeyconfig-callerreference ↩