This repository contains the source code for article: https://ervinszilagyi.dev/articles/an-introduction-to-aws-batch.html
Requirements:
- Terraform version 1.0.0 or later
- Docker
Follow this steps in order:
-
Adjust the variables in the
terraform.tfvars
files in each ecr and batch Terraform projects. Also, these projects are configured to use an S3 bucket for the Terraform state. You may want to reconfigure this to point to an existing bucket in your AWS account. -
Create an ECR repository by deploying the ecr Terraform project:
cd infra/ecr
terraform init
terraform apply
- Build the Docker image for the batch job:
cd movies-loader
docker buildx build --platform linux/amd64 -t movies-loader .
-
Push the Docker image to the ECR repository. You can follow the push commands from the AWS console for the repository crated at step 2.
-
Deploy the batch job:
cd infra/batch
terraform init
terraform apply