Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logical Id for LayerVersion not updated #703

dqvist opened this issue Dec 6, 2018 · 2 comments


Copy link

commented Dec 6, 2018


When creating a AWS::Serverless::LayerVersion and using a combination of S3 Location Object and !Ref for the ContentUri the generated hash for the logical Id don't change.

Template in use:

Type: "AWS::Serverless::LayerVersion"
LayerName: hello-world
Description: Simple Hello World Layer
Bucket: !Ref ArtifactBucket
Key: !Ref ArtifactKey
- python2.7
- python3.6
- python3.7
LicenseInfo: 'Available under the MIT-0 license.'
RetentionPolicy: Retain

Steps to reproduce the issue:

  1. Deploy a LayerVersion using the template snippet above.
  2. Update value for template parameter ArtifactKey
  3. Redeploy the LayerVersion

Observed result:

Same logical Id generated and the old LayerVersion gets deleted.

Expected result:

A new logical Id is generated and old LayerVersion is preserved.


This comment has been minimized.

Copy link

commented Dec 6, 2018

Yes, I can see how this would happen, good find. We need to resolve the !Ref intrinsic in SAM instead of letting CFN do it.

Line to fix:


This comment has been minimized.

Copy link

commented Dec 7, 2018

On the same topic. !Sub doesn't work either. It produce an error, sounds like the exact same root cause that intrinsic functions are nor resolved by SAM. Following produce an error:
ContentUri: !Sub s3://${ArtifactBucket}/${ArtifactKey}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.