Skip to content

doi-t/ex-aws-batch

Repository files navigation

Example of AWS Batch

Try to do something on AWS Batch.

Create AWS Batch Resources

$ cd tf/
$ terraform init -backend=true \
  -backend-config="bucket=[your_bucket_name]" \
  -backend-config="key=ex-aws-batch/terraform.tfstate" \
  -backend-config="region=[your_region_name]"
$ terraform plan
$ terraform apply
$ aws batch describe-compute-environments
$ aws batch describe-job-queues
$ aws batch describe-job-definitions

Prepare Slack incoming webhook url

$ cat slack.json
{
    "webhook_url": "[your_slack_incoming_webhook_url]"
}
$ aws s3 cp slack.json s3://ex-aws-batch/slack.json --sse

Push Docker Image to ECR

$ ./push_image_to_ecr.sh

Test on Local

$ ./test_on_local.sh "#test" "Test on local" "path/to/your/zip/file/on/s3"

Submit a Job to AWS Batch

Environment variables must not start with AWS_BATCH; this naming convention is reserved for variables that are set by the AWS Batch service. Ref. https://docs.aws.amazon.com/batch/latest/userguide/submit_job.html

$ ./submit_job.sh "#test" "Test on AWS Batch" "path/to/your/zip/file/on/s3" "Batch Job Name"

About

AWS Batch practice

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published