aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.48k stars 3.83k forks source link

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

Open cshields236 opened 2 months ago

cshields236 commented 2 months ago

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

CDK version used

2.144.0

Environment details (OS name and version, etc.)

OSX14.5

dreamorosi commented 2 months ago

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.

pahud commented 2 months ago

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

Welcome the pull requests.

pahud commented 2 months ago

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?

dreamorosi commented 2 months ago

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