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

Function (lambda): allow users in regions where 10GB memory is supported to utilize them #33523

Closed
2 tasks
xkjjx opened this issue Feb 20, 2025 · 6 comments
Closed
2 tasks
Labels
@aws-cdk/aws-lambda Related to AWS Lambda feature-request A feature should be added or improved. p3

Comments

@xkjjx
Copy link

xkjjx commented Feb 20, 2025

Describe the feature

Currently, the following code:

    const lambdaFunction = new DockerImageFunction(this, 'functionName', {
      code: DockerImageCode.fromImageAsset('path',{
        cacheDisabled: true,
        platform: Platform.LINUX_AMD64
      }),
      memorySize: 10240,
      timeout: Duration.seconds(30)
    });

fails with this error:

<Stack> | 4:44:43 PM | UPDATE_FAILED        | AWS::Lambda::Function       | <lambdaFunction> (<lambdaFunction>347AB729) Resource handler returned message: "'MemorySize' value failed to satisfy constraint: Member must have value less than or equal to 3008 (Service: Lambda, Status Code: 400, Request ID: c0721ca7-8785-4819-b77e-b6723db102fa)" (RequestToken: 948af33e-1563-d249-f5f0-eea3c7397d56, HandlerErrorCode: InvalidRequest)
❌  <Stack> failed: Error: The stack named <Stack> failed to deploy: UPDATE_ROLLBACK_COMPLETE: Resource handler returned message: "'MemorySize' value failed to satisfy constraint: Member must have value less than or equal to 3008 (Service: Lambda, Status Code: 400, Request ID: c0721ca7-8785-4819-b77e-b6723db102fa)" (RequestToken: 948af33e-1563-d249-f5f0-eea3c7397d56, HandlerErrorCode: InvalidRequest)

However, according to THIS article, memory limits of up to 10GB is supported in many regions.

Thus, if I am deploying into a region with support for the increased memory limit, I should be able to do so successfully - if I am in an unsupported region, I should be given a more descriptive error message.

Use Case

I need higher memory limits for my Lambda function and I would like to use them while maintaining the seamless deployment of AWS CDK.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.173.2

Environment details (OS name and version, etc.)

Ubuntu 24 on AWS Lightsail

@xkjjx xkjjx added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Feb 20, 2025
@github-actions github-actions bot added the @aws-cdk/aws-lambda Related to AWS Lambda label Feb 20, 2025
@pahud
Copy link
Contributor

pahud commented Feb 20, 2025

Looks like this error is coming from CloudFormation, not CDK?

@pahud pahud added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p3 and removed needs-triage This issue or PR still needs to be triaged. labels Feb 20, 2025
@xkjjx
Copy link
Author

xkjjx commented Feb 20, 2025

Looks like this error is coming from CloudFormation, not CDK?

I think you're right - looking into the code for CDK, there seems to be no bound check for memory size. Thanks.

@xkjjx
Copy link
Author

xkjjx commented Feb 20, 2025

From what I understand CloudFormation is not open source like CDK right?

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Feb 21, 2025
@xkjjx
Copy link
Author

xkjjx commented Feb 21, 2025

Further information - while technically the region I was using has a limit of 10240MB (AWS always uses this figure as the upper bound on their informational websites, if you actually try setting it to numbers above 3008 even through the website there is an error. Unofficially, it looks like you have to get support to write you a ticket to increase it manually.

After I get it increased I will update this thread based on if I can access the higher limits through CDK.

@xkjjx
Copy link
Author

xkjjx commented Feb 21, 2025

After I got my limit approved, I was able to set it to the higher value in CDK without issues.

@xkjjx xkjjx closed this as completed Feb 21, 2025
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-lambda Related to AWS Lambda feature-request A feature should be added or improved. p3
Projects
None yet
Development

No branches or pull requests

2 participants