-
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
Serverless Transform failing when using Intrinsic function within value for "ContentUri" property for "AWS::Serverless::LayerVersion" resource #1159
Comments
Thanks for reporting the issue, we will be investigating it further. Please watch this channel for more updates, and feel free to reach out. |
You might be able to get this to work by adding Transform:
- AWS::LanguageExtensions
- AWS::Serverless-2016-10-31
See #2533 for more information. |
Closing in favor of #2533. |
Thanks @hoffa for the suggestion. I tried the above but didn't manage to get it working. The deployment fails with error. Any ideas?
|
Why was this issue closed? I am running into this issue as well so I'm assuming it hasn't been fixed? |
@mcrysler-ng have you tried what hoffa mentioned here? |
Language extensions are the one thing I haven’t tried yet. I tried the other two workarounds and neither worked. Using language extensions worries me because of the comment about possible conflicts.
Matt Crysler | Application Engineer
…________________________________
From: Connor Robertson ***@***.***>
Sent: Wednesday, November 22, 2023 3:17:28 PM
To: aws/serverless-application-model ***@***.***>
Cc: Matt Crysler ***@***.***>; Mention ***@***.***>
Subject: Re: [aws/serverless-application-model] Serverless Transform failing when using Intrinsic function within value for "ContentUri" property for "AWS::Serverless::LayerVersion" resource (#1159)
@mcrysler-ng<https://github.com/mcrysler-ng> have you tried what hoffa mentioned here?<#1159 (comment)>
It was closed in favour of this issue.<#2533> Which provides workarounds and an explanation of why this issue was closed.
Feel free to open a new issue if this problem still persists.
—
Reply to this email directly, view it on GitHub<#1159 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ATGOQ6MWFEMXW7LHC3WOYUDYFZ2XRAVCNFSM4I2MTLFKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBSGM2TONRTG4YA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@mcrysler-ng would you be able to provide a snippet of your template? Curious why does this workaround not work for you.
As for the conflict in Language Extension, currently the only known conflict is that you need to depends on ApiGateway Stage resource and you've explicitly used intrinsic function for |
That’s almost the exact sample I have except the function is on the key name and I get a NoSuchKey error. If I remove the function and replace it with a constant string, it works. So I know it’s not a permissions issue or anything else. I even tried using the non-SAM version and the Content object that expects S3Bucket and S3Key behave the exact same.
Matt Crysler | Application Engineer
…________________________________
From: GZ ***@***.***>
Sent: Wednesday, November 22, 2023 3:50:58 PM
To: aws/serverless-application-model ***@***.***>
Cc: Matt Crysler ***@***.***>; Mention ***@***.***>
Subject: Re: [aws/serverless-application-model] Serverless Transform failing when using Intrinsic function within value for "ContentUri" property for "AWS::Serverless::LayerVersion" resource (#1159)
@mcrysler-ng<https://github.com/mcrysler-ng> would you be able to provide a snippet of your template? Curious why does this workaround not work for you.
ContentUri:
Bucket: !Sub some-example-bucket-${AWS::Region}
Key: someKey.zip
—
Reply to this email directly, view it on GitHub<#1159 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ATGOQ6MBUY2JPTE4AI7TBJLYFZ6VFAVCNFSM4I2MTLFKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBSGM3DAMBWGU4Q>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Snippet included below. The Env parameter is defined earlier in the file and used in almost every resource definition so I know that's not the issue. This is what is NOT working:
This is what IS working:
|
And this is the error I get with the first version above:
|
Issue Description
The following snippet fails transformation:
with the Error as:
"Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [MyServerlessLayerVersion9b0b8a66e5] is invalid. 'ContentUri' requires Bucket and Key properties to be specified".
Reasoning
Workaround
Suggestions/Observations
Regarding Correct Transformation/Parsing
References
[1] https://github.com/awslabs/serverless-application-model/blob/master/samtranslator/model/sam_resources.py#L732
[2] https://github.com/awslabs/serverless-application-model/blob/master/samtranslator/model/s3_utils/uri_parser.py
[3] https://github.com/awslabs/serverless-application-model/blob/master/samtranslator/model/s3_utils/uri_parser.py#L61
[4] https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlesslayerversion
[5] https://github.com/awslabs/serverless-application-model/blob/master/samtranslator/model/s3_utils/uri_parser.py#L2
The text was updated successfully, but these errors were encountered: