aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

(powertools-layer): ability to import the latest version of the lambda powertools layer

Open cshields236 opened this issue 1 year ago • 1 comments

Describe the feature

it would be great to have the ability to call on the latest version of the lambda powertools layer for use in Lambda functions. It is currently possible with other Lambda layers including AppConfig one & Lamda insights Example. Ideally would love to have an implemetation like

const fn = new Function(this, 'foo', {
  layers: [PowertoolsForAwsLambda.NODEJS_LATEST]
});

Use Case

At the moment there is no automated solution for powertools and we are reliant on manually updating an SSM parameter which holds the ARN of the layer.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • [ ] I may be able to implement this feature request
  • [ ] This feature might incur a breaking change

CDK version used

2.144.0

Environment details (OS name and version, etc.)

OSX14.5

cshields236 avatar Jun 28 '24 10:06 cshields236

Hi, I work on the Powertools for AWS Lambda team at AWS - our Lambda layer are public and available in the Lambda console, similar to the ones mentioned in the OP.

We’d love to see them included in CDK if the team agrees with adding them.

dreamorosi avatar Jun 28 '24 23:06 dreamorosi

Yap we could include that in the facts table. That would be amazing!

Welcome the pull requests.

pahud avatar Jul 01 '24 15:07 pahud

Hi @dreamorosi

our Lambda layer are public and available in the Lambda console, similar to the ones mentioned in the OP.

Is there any recommended approach to generate the ARN list using AWS CLI?

If not, do you have any relevant doc page like this for all the latest ARNs?

pahud avatar Jul 01 '24 15:07 pahud

Hi @pahud, if we agree on a format I can provide the mapping for each Layer ARN and package version no problem

dreamorosi avatar Jul 01 '24 15:07 dreamorosi