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

Bug: Using Rust SDK - CodeUri in SAM Template creates wrong S3 zip archive for upload #7713

Open
deanchalk opened this issue Nov 20, 2024 · 1 comment
Labels
blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale.

Comments

@deanchalk
Copy link

Description:

Im writing Lambdas in Rust and using SAM to build and deploy. I am expecting to use the same 'template.yaml' file for both.
However, when running 'sam build' the CodeUri settings needs to be to the folder where the Cargo.toml file is located.
However, when I run 'sam deploy' (with the same template file) it zips up EVERYTHING in that same directory which includes all debug/release output artifacts and any thing else in there. The resultant zip that goes up to S3 for deployment is often over 250mb so fails to deploy.
In reality, I only want to deploy the 'bootstrap' target file which is about 1.5mb and lives under ./src//target/lambda// directory.

The only work around is to change the CodeUri setting for each lambda to something different betweem 'sam build' and 'sam deploy'

This seems like a bug. Ive been through loads of docs but cant find anything related to this issue for Rust with SAM

@deanchalk deanchalk added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Nov 20, 2024
@deanchalk deanchalk changed the title Bug: Using Rist SDK - CodeUri in SAM Template creates wrong S3 zip archive for upload Bug: Using Rust SDK - CodeUri in SAM Template creates wrong S3 zip archive for upload Nov 20, 2024
@dkphm
Copy link
Contributor

dkphm commented Nov 22, 2024

Hi @deanchalk , thanks for reporting the issue. From what I checked, the script only upload an artifact with bootstrap as a content to S3. Could you please let us know more detail on the lambda you are working on, or on which environment (Windows or Linux) to help further investigations?

@dkphm dkphm added blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale. and removed stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale.
Projects
None yet
Development

No branches or pull requests

2 participants