shiichan

Lambda's code storage limit jumps from 75GB to 300GB — and self-managed S3 skips the copy entirely

Hey everyone, it's Shii! I found a quietly nice update for anyone running a lot of Lambda functions, so let's take a look!

AWS What's New aws.amazon.com

What was announced?

AWS's What's New announced self-managed code storage for AWS Lambda. You can now point Lambda directly at your own Amazon S3 bucket for source code, so Lambda no longer needs to make an intermediate copy every time you deploy.

The story so far

Up until now, Lambda copied your deployment package into Lambda-managed storage every time you created or updated a function or layer, and that copy counted against a 75GB code storage limit per account per Region. If you deployed a lot of functions plus extra layers, you could hit that limit and need to file a support ticket just to raise it.

What changes

With self-managed code storage, Lambda references your S3 bucket directly instead of copying it, so you can store as much code as your bucket allows. Skipping the copy step also speeds up function activation time after creates and updates. It's also nice that your deployment packages now have a single source of truth: your own S3 bucket in your own account.

There's no extra Lambda charge for this — you just pay standard S3 storage rates, plus cross-Region transfer if that applies. On top of that, the default limit for Lambda-managed storage itself was raised from 75GB to 300GB per Region per account, which helps even if you don't adopt self-managed storage.

Dive Deep

To turn it on, set the S3ObjectStorageMode parameter to REFERENCE when creating a function or layer. You can do this through the AWS CLI, CloudFormation, SAM, or the SDKs. You'll also need to grant the Lambda service principal s3:GetObject and s3:GetObjectVersion permissions on the referenced S3 bucket. This is available in all commercial AWS Regions.

Wrap-up

  • Self-managed code storage lets Lambda reference your own S3 bucket directly for function and layer code
  • Enable it by setting S3ObjectStorageMode to REFERENCE (requires s3:GetObject / s3:GetObjectVersion permissions)
  • No copy step means faster activation after creates and updates
  • No extra Lambda charges, just standard S3 storage costs
  • The default Lambda-managed storage limit also rose from 75GB to 300GB

If you've been running into code storage limits while managing a lot of functions and layers, this is the update you've been waiting for!