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

fix: update deployment lambda memory limit #76

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

ndaba1
Copy link
Contributor

@ndaba1 ndaba1 commented Jul 24, 2024

Fixes #63

When uploading the zip file of a lambda's build code, a lambda function is used internally to extract the contents of the zip file and copy them to the destination bucket as per this snipper from the aws-cdk-lib source code

The BucketDeployment construct synthesizes a Lambda-backed custom CloudFormation resource of type Custom::CDKBucketDeployment into the template. The source bucket/key is set to point to the assets bucket.

The custom resource invokes its associated Lambda function, which downloads the .zip archive, extracts it and issues aws s3 sync --delete against the destination bucket (in this case websiteBucket). If there is more than one source, the sources will be downloaded and merged pre-deployment at this step.

By default, the lambda function gets created with a memory size of 128 MB. However, if the size of your zipped lambda package is significantly larger than this, the deployment fails to go through successfully with the error linked being thrown. This addresses the issue by setting a memoryLimit of 512 MB which should be more than enough - considering the zipped lambda size cannot exceed 250MB

@ndaba1 ndaba1 requested a review from a team as a code owner July 24, 2024 20:06
@Amplifiyer Amplifiyer merged commit ed6ac8f into aws-amplify:main Jul 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cdk deploy: getting error while deploying amplify exported backend
2 participants