Now that your Ruby Lambda function is Dockerized and working locally, it's time to run it in the cloud. No Terraform yet. No CI/CD. Just you, your terminal, and the AWS Console.
In this chapter, you'll manually build and push your Docker image to AWS, then create and run your first Lambda function with it.
The goal is to understand each step, so when we automate later, you'll know exactly what the automation is doing.
Make sure you've completed:
aws configure
us-east-1
) selected and rememberedECR is AWS's Docker image registry. It's where your Lambda will pull its image from.
my-ruby-lambda
Take note of the repository URI , it'll look something like this:
123456789012.dkr.ecr.us-east-1.amazonaws.com/my-ruby-lambda
Run this command to log Docker into ECR:
aws ecr get-login-password --region us-east-1 \
| docker login --username AWS \
--password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com
Replace the region and account ID with your values.
If successful, you'll see:
Login Succeeded