Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public Lambda Layers ARN instead of SAR App #2

Closed
heitorlessa opened this issue May 13, 2021 · 16 comments
Closed

Public Lambda Layers ARN instead of SAR App #2

heitorlessa opened this issue May 13, 2021 · 16 comments
Assignees
Labels
Java Proposed Community submited Python

Comments

@heitorlessa
Copy link
Contributor

heitorlessa commented May 13, 2021

Original author: @ecolban

Runtime e.g. Python, Java, all of them. All of them

Is your feature request related to a problem? Please describe.

As described in the Lambda Powertools Python discussion, Layers are currently available as a Serverless Application Repository (SAR) App and not as a public Lambda Layer ARN.

While this allows customers to selectively deploy the semantic version they're interested in it does require deploying a SAR App before they can use the Lambda Layer.

Describe the solution you'd like

Make Lambda Layer ARN publicly available per region. This will make it easier to add Lambda Powertools to existing projects.

Some examples: https://github.com/mthenw/awesome-layers

Describe alternatives you've considered

Building and publishing own Lambda Layer though that adds operational overhead in maintaining.

Is this something you'd like to contribute if you had guidance?

Additional context

@stephenbawks
Copy link

Would love to have this as a layer. Been using Serverless Framework but I see this appears to be only available in eu-west-1. I am in the US so having layers here as well would be great.

@heitorlessa
Copy link
Contributor Author

Absolutely - one misconception though is that we're using Serverless Application Repository (SAR) Application as a layer, and while its ARN is EU-West-1 it can be deployed anywhere globally.

Once deployed, it'll create a Lambda Layer in the region you deployed, and that's the ARN you can use.

I'll create a sample in the docs on how to do it for Serverless framework, as @am29d continurs to work on the public ARN folks will be able to use directly in Lambda with any framework

@stephenbawks
Copy link

Ahh gotcha. Yah sadly I have not used a ton of SAR yet but I guess I will need to check this out.

I am using Serverless Framework for this and being able to add it as a layer would be by far the easy path.

@stephenbawks
Copy link

I guess maybe a follow up question then now that I think about it. Since I am using a container for my lambda, are there some install commands where I can pull this in since a layer is not going to work for a container deployment.

@mwarkentin
Copy link

@stephenbawks doesn't help with your container question, but here's how you can configure this through serverless:

resources:
  Transform: AWS::Serverless-2016-10-31
  Resources:
    AwsLambdaPowertoolsPythonLayer:
      Type: AWS::Serverless::Application
      Properties:
        Location:
          ApplicationId: arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer
          SemanticVersion: # Add latest version from https://github.com/awslabs/aws-lambda-powertools-python/releases

Which can then be used to define the layer:

functions:
  main:
    handler: lambda_function.lambda_handler
    layers:
      - !GetAtt AwsLambdaPowertoolsPythonLayer.Outputs.LayerVersionArn

@dreamorosi
Copy link

What about publishing it as an extension in the newly released CloudFormation Registry? The resource (layer) could be deployed by Customers in their own account and we could also consider the Stack to accept a parameter from the user to specify semver of the layer to deploy.

@heitorlessa
Copy link
Contributor Author

heitorlessa commented Jun 28, 2021 via email

@DanyC97
Copy link

DanyC97 commented Jul 20, 2021

What about publishing it as an extension in the newly released CloudFormation Registry? The resource (layer) could be deployed by Customers in their own account and we could also consider the Stack to accept a parameter from the user to specify semver of the layer to deploy.

i guess this is a nice idea but what about those who are on TF land?
imo just publish public layers will cover a wider audience rather than cloudformation only.

@dreamorosi
Copy link

Good point, Lambda Layers seems to reach a wider audience at the moment; we can re-evaluate in the future in case any Customer mentions it.

@kimmoahokas
Copy link

Is there any estimation if this will be implemented and when? We have been using third-party layer from https://github.com/keithrozario/Klayers but that is obviously not as good as having these officially published by AWS. As we are using terraform to deploy this without SAM, we can't use the layers from SAR or CloudFormation registry.

@am29d
Copy link

am29d commented Sep 29, 2021

Hey @kimmoahokas thanks for the follow up, I am currently working on shipping this feature. I can't provide any dates, because there are still things out of my control or influence that might delay it. I can't wait to release it asap and make layers more accessable.

@heitorlessa
Copy link
Contributor Author

heitorlessa commented Sep 29, 2021

Yes @kimmoahokas - @am29d is on it.

We've had some challenges on making this work flawlessly across all regions, hence the delay

Edit: Align with Alex's expectations

@kimmoahokas
Copy link

Thank you very much @am29d and @heitorlessa for the status update. We appreciate your effort on this and all of the lambda powertools :)

@DanyC97
Copy link

DanyC97 commented Oct 11, 2021

@am29d @heitorlessa i suspect this can be closed now following the recent release?

@am29d
Copy link

am29d commented Oct 11, 2021

@DanyC97 the public layer is only available for python. I guess we would need to remove the Java label, and can close this issue.

@michaelbrewer
Copy link
Contributor

@heitorlessa can we mark this one as done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java Proposed Community submited Python
Projects
None yet
Development

No branches or pull requests

8 participants