Skip to content

(aws-cloudfront): EdgeFunction NodejsFunction and PythonFunction support #12671

@blimmer

Description

@blimmer

@njlynch 's new EdgeFunction (see #10500) is very handy for when a stack is deployed outside of us-east-1.

As of now, it extends lambda.FunctionProps, which prevents using the convenience lambda operators such as aws-lamdba-nodejs and aws-lambda-python.

It would be great if you could somehow specify that you want to bundle using the convenience operators while still taking advantage of the cross-region behaviors provided by EdgeFunction.

Use Case

I almost always use Typescript alongside aws-lambda-nodejs's NodejsFunction operator. This provides me type-safety when developing. However, I also want to deploy my main stack in us-west-2, so EdgeFunction is really handy for me.

Proposed Solution

A (potentially naive) solution would be to provide EdgeFunction, EdgeNodejsFunction, EdgePythonFunction, etc.

Another idea would be to somehow specify the type of Lambda you're using in property, e.g.,

new cloudfront.experimental.EdgeFunction(this, 'EdgeFunction', {
  functionType: cloudfront.experiment.EdgeFunctionType.NODE_JS, // maybe default to regular lamdba.Function here?
  functionProps: { }, // Typescript requires NodejsFunctionProps here
});

Other

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

This is a 🚀 Feature Request

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-cloudfrontRelated to Amazon CloudFronteffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.feature/service-integrationAdd functionality to an L2 construct to enable easier integration with another servicep1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions