cloudcomponents / cdk-constructs

A collection of higher-level reusable cdk constructs
MIT License
624 stars 104 forks source link

@cloudcomponents/cdk-cloudfront-authorization | Support custom lambda names #170

Open coltenkrauter opened 2 years ago

coltenkrauter commented 2 years ago

I would like to provide custom names for generated lambda functions, would this be possible? If not, could support be added to accomplish this?

For example, here is a generated function name when using the SPA example found here: https://www.npmjs.com/package/@cloudcomponents/cdk-cloudfront-authorization

StackName-signoutFunction60A00DBD-dVM0aZfroavU

I would like to customize it something like this,

StackNameAuthSignout

Related thoughts

The ServerlessNextJS construct supports supplying custom names for lambdas, like this,

name:
    defaultLambda: fooDefaultLambda
    apiLambda: fooApiLambda
    imageLambda: fooImageLambda

So, perhaps @cloudcomponents/cdk-cloudfront-authorization could also support something similar.