Skip to content

(gen2-migration) generate command should handle non js lambda functions #14535

@iliapolo

Description

@iliapolo

Is this feature request related to a new or existing Amplify category?

No response

Is this related to another service?

No response

Describe the feature you'd like to request

In Gen1, its possible to create functions in various languages:

? Choose the runtime that you want to use: (Use arrow keys)
  .NET 8
  Go
  JavaNodeJS
  Python

We currently only support the NodeJS runtime - we should support all.

Describe the solution you'd like

In Gen2, non JS runtimes are supported via a flavor of the defineFunction API:

export const sayHelloFunctionHandler = defineFunction(
  (scope) =>
    new Function(scope, "say-hello", {
      handler: "index.handler",
      runtime: Runtime.PYTHON_3_9, // or any other python version
      timeout: Duration.seconds(20), //  default is 3 seconds
      code: ...
);

More information here: https://docs.amplify.aws/vue/build-a-backend/functions/custom-functions/.

Implementation Notes

  • Since the CDK Function construct exposes the same API regardless of runtime - we expect common logic to support all different languages. If however we see that special handling is needed per language, we should prioritize python and go first.

Describe alternatives you've considered

None

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request

Would this feature include a breaking change?

  • ⚠️ This feature might incur a breaking change

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions