AWS Lambda: With AWS Lambda, you can run code without provisioning or managing servers. You pay only for the compute time that you consume—there’s no charge when your code isn’t running. You can run code for virtually any type of application or backend service—all with zero administration. Just upload your code and Lambda takes care of everything required to run and scale your code with high availability.
We will view the details of the Dockerfile used to build our lambda function. This file contains all the commands required to create the deployment artifact. Take a minute to run the command below and take a look through the Dockerfile to understand what commands are being run. For more detailed Dockerfile information, you can check out the Dockerfile reference documentation. Run the following commands in the terminal:
cd backend-infrastructure/bedrockFunc/
cat Dockerfile
Run the following command to create the deployment artifact.
docker buildx build --target=artifact --output type=local,dest=$(pwd)/out/ .
Upon successful execution, a similar to the below output will be shown:
....
=> [artifact 1/1] COPY --from=build /var/task/lambda_artifact.zip /lambda_artifact.zip 0.3s
=> exporting to client directory 0.6s
=> copying files 62.04MB 0.6s
Verify that the zip artifact has been created:
ls -l out/lambda_artifact.zip
Clean the cached resources and change your working directory back to ~/environment/parsectix-chatbot-workshop:
docker system prune -f