-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(SAM): update the SAM specification version used in the CDK #13507
Comments
Hi, I'm not sure if this is the right place to point this out, but it is relevant to the issue. The |
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Can not migrate my SAM template to CDK. My SAM template works great, CodeUri of my functions point to local directories. |
Can you show what codeUri is in your template? |
Sure
|
Right. So I think this works because the SAM CLI does the packaging for you. In the CDK, you need to turn that directory into an Asset. I show how to do that in this video: https://youtu.be/bTC8XV5aLTo?si=3fdUJ_T1_cgXzejL |
Thank you! This is exactly what I needed. But I stuck with another issue related to migration: Is it intendent? |
Yes. CDK Assets don’t use the Metadata in any way (this is another SAM feature), so you need to build your Lambda code separately. There is a “build” key that you can set in your cdk.json file for this purpose. |
We need to update the version of the SAM spec we use in the CDK. We are missing new properties, like
PackageType
inAWS::Serverless::Function
, and some properties that we mark as required (likeCodeUri
ofAWS::Serverless::Function
) are no longer required.(Additional data from related issues)
We currently download the spec from a repo called awslabs/goformation -
aws-cdk/packages/@aws-cdk/cfnspec/build-tools/update.sh
Line 58 in 9f8de62
Unfortunately, it seems that there is no machine readable SAM spec available officially - aws/serverless-application-model#1133. We need a better way to keep the SAM spec up to date with the latest, but without any machine-readable spec, this becomes a fairly difficult problem to stay on top of.
In the meantime, raw property overrides allow users to use missing properties, and missing resources can be created using
CfnResource
.Neither of these are ideal, and we apologize for the current poor experience here.
The text was updated successfully, but these errors were encountered: