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

Add ephemeralStorageSize option to defineFunction #2282

Open
fossamagna opened this issue Nov 29, 2024 · 2 comments
Open

Add ephemeralStorageSize option to defineFunction #2282

fossamagna opened this issue Nov 29, 2024 · 2 comments
Labels
feature-request New feature or request function Issue pertaining to Amplify Function

Comments

@fossamagna
Copy link
Contributor

fossamagna commented Nov 29, 2024

Environment information

System:
  OS: macOS 14.7
  CPU: (10) arm64 Apple M1 Max
  Memory: 210.70 MB / 32.00 GB
  Shell: /bin/zsh
Binaries:
  Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
  Yarn: 1.22.19 - ~/.nvm/versions/node/v20.11.1/bin/yarn
  npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
  pnpm: 8.15.6 - ~/.nvm/versions/node/v20.11.1/bin/pnpm
NPM Packages:
  @aws-amplify/auth-construct: 1.5.0
  @aws-amplify/backend: 1.7.0
  @aws-amplify/backend-auth: 1.4.0
  @aws-amplify/backend-cli: 1.4.2
  @aws-amplify/backend-data: 1.2.0
  @aws-amplify/backend-deployer: 1.1.9
  @aws-amplify/backend-function: 1.7.5
  @aws-amplify/backend-output-schemas: 1.4.0
  @aws-amplify/backend-output-storage: 1.1.3
  @aws-amplify/backend-secret: 1.1.4
  @aws-amplify/backend-storage: 1.2.2
  @aws-amplify/cli-core: 1.2.0
  @aws-amplify/client-config: 1.5.2
  @aws-amplify/deployed-backend-client: 1.4.1
  @aws-amplify/form-generator: 1.0.3
  @aws-amplify/model-generator: 1.0.9
  @aws-amplify/platform-core: 1.2.0
  @aws-amplify/plugin-types: 1.4.0
  @aws-amplify/sandbox: 1.2.5
  @aws-amplify/schema-generator: 1.2.5
  aws-amplify: 6.8.2
  aws-cdk: 2.167.1
  aws-cdk-lib: 2.167.1
  typescript: 5.6.3
No AWS environment variables
No CDK environment variables

Describe the feature

I would like to add an option to defineFunction to specify the size of ephemeral storage.

defineFunction({
  entry: './test-assets/default-lambda/handler.ts',
  ephemeralStorageSize: 1024, // <- like this
})

See:

Use case

When using defineFunction with Amplify Gen2, function has an ephemeral storage size of 512 MB.
I will get an error No space left on device when dealing with large size files in Lambda functions.
I would like to increase the size of the ephemeral storage with ephemeralStorageSize option.

@fossamagna fossamagna added the pending-triage Incoming issues that need categorization label Nov 29, 2024
@ykethan
Copy link
Member

ykethan commented Nov 29, 2024

Hey @fossamagna, thank you for filing this issue and the contribution. Marking this as feature request.

For folks looking to increase this you can override/extend the configuration on the backend.ts filke

const backend = defineBackend({
  myFunction,
});

backend.myFunction.resources.cfnResources.cfnFunction.ephemeralStorage = {
  size: 1024,
};

@ykethan ykethan added feature-request New feature or request function Issue pertaining to Amplify Function and removed pending-triage Incoming issues that need categorization labels Nov 29, 2024
@fossamagna
Copy link
Contributor Author

@ykethan
Thanks for showing us how to do the configuration.
I would be happy to review your Pull Request for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request function Issue pertaining to Amplify Function
Projects
None yet
Development

No branches or pull requests

2 participants