Giter Club home page Giter Club logo

Comments (1)

NathanielRN avatar NathanielRN commented on August 26, 2024

Hey @iamcristos !

This sounds like an interesting use case. I went online and found this blog post in the "Copy the contents of a Lambda layer into a container image" section which discusses steps that I think will be helpful to you.

For example, if you are using OTel Python Container images, you would want the OTel Python Lambda Layer ARN. Then, you could do

curl $(aws lambda get-layer-version-by-arn --arn arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-python38-ver-1-7-1:1 --query 'Content.Location' --output text) --output layer.zip

to get the contents of the Lambda Layer and add them to your Lambda function.

Another solution is to create the Lambda function with the Docker Image, and then use the aws cli afterwards to add the Lambda Layer. This is also explained in the blog post.

aws lambda create-function --region us-east-1 --function-name my-function \  
    --role arn:aws:iam::123456789012:role/lambda-role \
    --layers \
        "arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-python38-ver-1-7-1:1" \

Otherwise, if you were looking for a setting that added it at once in the Docker Image it seems that the Docker Images don't support that. If that is a feature you want to request I recommend looking at the aws-lambda-base-images GitHub Repository where you can voice your use case 🙂

Hope that helps!

from aws-otel-community.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.