-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
AWS::Serverless::Function CodeUri with Ref not working properly #271
Comments
Yes! This is how it is supposed to work. You cannot directly !Ref the string. Instead you should use the {Bucket, Key} notation - https://github.com/awslabs/serverless-application-model/blob/master/HOWTO.md#using-intrinsic-functions SAM needs to parse CodeUri string into bucket/key, but unfortunately it cannot resolve runtime parameter values passed through !Ref. |
Well. Worth of mention on documentation. |
Are there any plans to support this feature? It would be great to use the same Cloud Formation file both locally and when we deploy and passing the CodeUri as a CF parameter (locally the local folder/zip and the s3 bucket during deployment) |
@zoltanhomoki as a workaround, set CodeUri as |
This is confusing since the documentation says you can use
was using Despite the mention of using |
I was tripped up by this too. Whatever you think you did that warrants closing this issue, I can't see it. |
Try adding Transform:
- AWS::LanguageExtensions
- AWS::Serverless-2016-10-31 Haven't tested this specific use case, but |
Closing in favor of #2533. |
I have following set of parameters:
in my template for testing.
hardcoded S3 URI inside CodeUri works
If I use
"CodeUri" : "s3://<my-bucket>/<my-file>",
withAWS::Serverless::Function
resource I runaws deploy
properly.usage of key and bucket properties also works
Even using following
and running
aws deploy -parameter-overrides DeployBucket=<bucket-name> DeployKey=<file-name>
works properlyusing Ref to fetch string value does not work
As soon as I use
changeset creation fails with message:
In this case I use
aws deploy
command without passing any parameters => stack creation should have used hardcoded parameter value fromParameters
section.Documentation states that usage of String or S3 location object is supported with CodeUri property. In this case it seems like Ref function can not be used to fetch string data for CodeUri property.
The text was updated successfully, but these errors were encountered: