Terraform module to deploy AWS Batch Job
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Julien Cabillot 0bbd81befe Merge pull request 'feat: add `var.execution_role_extras_policies` to manage execution role policies' (#2) from feature/role into master 2 months ago
examples/default fix: adapt to pr comments 2 months ago
.gitignore Initial commit 2 months ago
.pre-commit-config.yaml chore: add tfsec to pre-commit 2 months ago
CHANGELOG.md chore: add tfsec to pre-commit 2 months ago
Jenkinsfile feat: init 2 months ago
LICENSE feat: init 2 months ago
README.md fix: remove description 2 months ago
data.tf feat: add `var.execution_role_extras_policies` to manage execution role policies 2 months ago
main.tf feat: add `var.execution_role_extras_policies` to manage execution role policies 2 months ago
outputs.tf fix: remove description 2 months ago
providers.tf Initial commit 2 months ago
variables.tf fix: adapt to pr comments 2 months ago
versions.tf feat: init 2 months ago

README.md

terraform-module-aws-batch-job

Terraform module to create and schedule an AWS Batch Job.

This module doesn't create the Batch compute environment, you can call our batch module in order to create it (please take a look at examples/default/).

Requirements

Name Version
terraform >= 0.13
aws >= 3.0

Providers

Name Version
aws >= 3.0

Modules

No Modules.

Resources

Name
aws_batch_job_definition
aws_cloudwatch_event_rule
aws_cloudwatch_event_target
aws_iam_policy
aws_iam_policy_document
aws_iam_role
aws_iam_role_policy_attachment

Inputs

Name Description Type Default Required
event_pattern The event pattern described a JSON object. At least one of schedule_expression or event_pattern is required. See full documentation of Events and Event Patterns in EventBridge for details. string null no
event_policy_description Description of the IAM policy (var.name will be appended). string "Service Role for EventBridge / Batch Job" no
event_policy_name Name of the policy (_var.name will be appended). string "AWS_Events_Invoke_Batch_Job_Queue" no
event_role_arn When event_role_create == false, external Service Role ARN string null no
event_role_create Whether or not to create IAM resources for EventBridge. bool true no
event_role_description Description of the IAM role (var.name will be appended). string "Service Role for EventBridge / Batch Job" no
event_role_name Name of the role (_var.name will be appended). string "AWS_Events_Invoke_Batch_Job_Queue" no
event_role_path Path in which to create the policy. string "/service-role/" no
event_rule_target_id The unique target assignment ID. Will be prefixed with var.prefix and sufixed by -onsched/onevent. string "batchjob" no
event_rules_bus_name The event bus to associate with this rule. If you omit this, the default event bus is used. string null no
event_rules_create Whether or not to create a EventBridge rule bool true no
event_rules_description The description of the rule. string "Run batch job based on event or schedule" no
event_rules_is_enabled Whether or not to enable EventBridge Rule bool true no
event_rules_name Rule name (will be prefixed with ‘var.prefix-job-’ and sufixed with ‘-onsched/onevent’). If null, the rule will use var.name string null no
event_rules_role The Amazon Resource Name (ARN) associated with the role that is used for target invocation. string null no
event_tags Map of tags that will be applied on EventBridge and IAM resources (merged on local.tags, var.tags). map(string) {} no
execution_role_create Whether or not to create the IAM execution role. bool true no
execution_role_description Description of the IAM role for executing task (var.name will be appended). string "Execution role for tasks" no
execution_role_extras_policies Extra policies ARN to attach to the execution role list(string) [] no
execution_role_path Path in which to create the policy for executing task. string "/" no
execution_role_tags Map of tags that will be applied on IAM resources for execution role (merged on local.tags, var.tags). map(string) {} no
job_arn When job_create == false, external job definition ARN string null no
job_create Whether or not to create a job definition bool true no
job_queue_arn External Batch Job Queue ARN string n/a yes
job_tags Map of tags that will be applied on job definition (merged on local.tags, var.tags). map(string) {} no
name Name of your job, will be use by Job definition and EventBridge resources. string n/a yes
parameters (Optional) Specifies the parameter substitution placeholders to set in the job definition. map(string) {} no
prefix Prefix to be added to with all resource's names of the module. Prefix is mainly used for tests and should remain empty in normal circumstances. string "" no
properties A valid container properties provided as a map (see an example here https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/batch_job_definition / container_properties). any n/a yes
retries The number of times to move a job to the RUNNABLE status. You may specify between 1 and 10 attempts. number 1 no
schedule_expression The scheduling expression. For example, cron(0 20 * * ? *) or rate(5 minutes). At least one of schedule_expression or event_pattern is required. Can only be used on the default event bus. string null no
tags Map of tags that will be applied on all resources. map(string) {} no
timeout (Optional) The time duration in seconds after which AWS Batch terminates your jobs if they have not finished. The minimum value for the timeout is 60 seconds. number null no

Outputs

Name Description
arn n/a
execution_role_arn n/a
execution_role_create_date n/a
execution_role_description n/a
execution_role_id n/a
execution_role_name n/a
execution_role_unique_id n/a
revision n/a
rule_event_arn n/a
rule_event_id n/a
rule_schedule_arn n/a
rule_schedule_id n/a
service_policy_arn n/a
service_policy_description n/a
service_policy_id n/a
service_policy_name n/a
service_policy_path n/a
service_policy_policy n/a
service_role_arn n/a
service_role_create_date n/a
service_role_description n/a
service_role_id n/a
service_role_name n/a
service_role_unique_id n/a
target_event_arn n/a
target_schedule_arn n/a

Versioning

This repository follows Semantic Versioning 2.0.0

Git Hooks

This repository uses pre-commit hooks.