The following artifact was designed to assist customers interested in deploying AWS Batch jobs using Amazon ECS Fargate launch type.
We have developed a Terraform module that can be utilized to deploy a batch job by building the container image, pushing it to ECR and deploying AWS Batch job configurations. This module also sets the schedule for the job by utilizing AWS Event Bridge.
The following tools/utilities must be installed and configured on your machine (local/remote) that is being used for deploying.
- Terraform
- AWS credentials
- Docker
├── README.md ├── examples │ └── batch-fargate-docker │ ├── main.tf │ ├── output.tf │ ├── src │ │ ├── Dockerfile │ │ ├── hello_mars.py │ │ └── requirements.txt │ ├── terraform.tfvars │ └── variables.tf └── modules └── batch-fargate-docker ├── main.tf ├── output.tf ├── providers.tf └── variable.tf
Note: We will use a sample code to depoly a batch job. You can review the code and Dockerfile in examples/batch-fargate-docker/src/
directory.
Please follow the instruction steps to deploy a sample job using the module.
- Change Directory
cd examples/batch-fargate-docker
-
Update terraform.tfvars Open text editor and update the varaibles as required.
-
Terraform initialize
terraform init
- Generate Terraform plan
Verify resources that will get deployed.
terraform plan
- Deploy reources
terraform apply --auto-approve
- To cleanup reources
terraform destroy --auto-approve