aws-powertools / powertools-lambda-python

A developer toolkit to implement Serverless best practices and increase developer velocity.
https://docs.powertools.aws.dev/lambda/python/latest/
MIT No Attribution
2.9k stars 401 forks source link

Feature request: Publish AWS Lambda layers under /aws/service/list #3586

Open avoidik opened 10 months ago

avoidik commented 10 months ago

Use case

I would like to be able to dynamically lookup the latest available AWS Lambda layer ARN.

Solution/User Experience

AWS has already been maintaining a list of public SSM parameters, please consider enlisting powertools-lambda-python too. Similar to ref. https://aws-sdk-pandas.readthedocs.io/en/latest/install.html#aws-lambda-layer

$ aws ssm get-parameters-by-path --path /aws/service/list
$ aws ssm describe-parameters --parameter-filters 'Key=Name, Option=BeginsWith, Values=/aws/service/aws-sdk-pandas/' --query 'sort_by(Parameters, &LastModifiedDate)'

Sample code

powertools_layer_arn = ssm.StringParameter.from_string_parameter_attributes(self, "MyValue",
  parameter_name="/aws/service/powertools-lambda-python/x.y.z/py3.xx/x86_64/layer-arn"
).string_value

Alternative solutions

Hardcoded Lambda layer ARN

Acknowledgment

boring-cyborg[bot] commented 10 months ago

Thanks for opening your first issue here! We'll come back to you as soon as we can. In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

leandrodamascena commented 10 months ago

Hello @avoidik! Thanks for opening this issue to add our Lambda layer in public parameters. This feature makes it easier to automate the use of the latest layer in customer's pipelines. However, we need to do some internal processes to add our layer to this list and I don't have an ETA for completing this as it involves other teams.

Starting tomorrow I will carry out these processes and as soon as I have an update I will let you know here.

Thank you.

Dilski commented 4 months ago

Just want to +1 this, it would make it a lot easier for us to keep our layers/dependencies up to date.