I am developing some Python applications using AWS...
# general
b
I am developing some Python applications using AWS Lambda. Can I build a Docker image using pants to deploy a Python Lambda function to a container image?
I changed the Dockerfile and BUILD file to the following and was able to confirm that it was working as intended. Lambdex and Pex is fantastic tools !!!
Dockerfile
Copy code
FROM public.ecr.aws/lambda/python:3.8

WORKDIR /build
RUN yum install unzip -y
COPY src.python.lambda_sample/lambda.zip /build
RUN unzip /build/lambda.zip -d /app
WORKDIR /app
CMD ["/app/lambdex_handler.handler"]
BUILD
Copy code
python_awslambda(
    name="lambda",
    runtime="python3.8",
    dependencies=[
        ":lib",
    ]
    handler="main.py:lambda_handler"
)

docker_image(
    name="my_image",
    dependencies = ["src/python/lambda_sample:lambda"],
)
πŸš€ 1
❀️ 1
h
I'm so glad you got this working! Yay πŸ™‚ Would you be comfortable with us tweeting some of your above message? It helps us to get out the word about features like AWS Lambda support. No worries if not!
b
Would you be comfortable with us tweeting some of your above message? It helps us to get out the word about features like AWS Lambda support. No worries if not!
Of course it’s okay!
❀️ 1
https://github.com/pantsbuild/pants/issues/14373 I created an issue just in case and closed it.
h
Good idea! That helps future users to search this issue
πŸ‘ 2
h
Thanks! Glad this worked.
I expected it to, but you never know
πŸ‘ 1
b
Hi @bland-father-19717! Thanks for allowing us to tweet that. Is there a personal twitter account you'd like us to credit that to?
b
Hi ! Twitter ID: @kenkman621
🐦 1
πŸ™Œ 1
b
Done! Thank you. πŸ™‚
πŸ‘ 1
❀️ 1
b
Thank you too !
b
Your tweet about it was very kind, if Google Translate is accurate. πŸ™‚
πŸ‘ 1