Open alexpulver opened 2 years ago
I'm not sure. You tell me?
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.
I'll double check again with AWS SAM CLI using the latest AWS CDK v1 and v2 versions (even though v1 will enter maintenance mode on June 1), and circle back. Based on the documentation for the command line flag, only SAM CLI needs this. If it works in both modes now, it won't be needed.
I tested the default cdk synth
behavior on my AWS CDK v2 application with AWS SAM CLI and it worked (see commands below). Looking at Understand Resource Level Metadata and RFC: AWS Lambda - Metadata about Code Assets design documents, I see nothing explicit about some edge cases. @rix0rrr can the CDK generate Metadata
differently based on the asset source?
git clone https://github.com/alexpulver/usermanagement-backend/
cd usermanagement-backend/
python3.7 -m venv .venv
source .venv/bin/activate
./scripts/install-deps.sh
cdk synth
cat > env.json << EOF
{
"Parameters": {
"DATABASE_DYNAMODB_TABLE_NAME": "table"
}
}
EOF
cat > event.json << EOF
{
"rawPath":"/users/john",
"requestContext":{
"http":{
"method":"GET",
"path":"/users/john"
},
"stage":"$default"
}
}
EOF
sam local invoke APILambdaFunction0BD6F5C6 \
-n env.json \
-e event.json \
-t cdk.out/assembly-UserManagementBackendDev/UserManagementBackendDevStateless9AAF07C3.template.json
Related to #9189
Describe the issue
The documentation for
cdk synth --staging
says:I tried deleting the cloud assembly and synthesizing using both methods. The resulting file structure in the
cdk.out/
directory was exactly the same. I didn't see a change in how CDK Toolkit creates assets in the cloud assembly. Also, usingcdk synth
(i.e.--staging
) with SAM CLI worked.Is the
--no-staging
option still active/needed?Links
https://docs.aws.amazon.com/cdk/v2/guide/cli.html#cli-ref https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-cdk-getting-started.html#serverless-cdk-tutorial-hello-world