A Terraform module to create a scheduled task in AWS ECS
module "scheduled_task" {
source = "github.com/dxw/terraform-aws-ecs-scheduled-task"
version = "1.2"
name = "my_awesome_task"
environment = "staging"
container_definitions = "${file(./path/to/container-definitions.json)}"
schedule_expression = "cron(0 * * * ? 0)"
cluster_arn = "my_awesome_cluster"
memory = "512"
cpu = "512"
}
The following variables can be configured:
- Description: Unique name for resources
- Default:
none
- Description: Environment - appended to ${var.name} for resources
- Default:
none
- Description: Task container defintions. See AWS docs
- Default:
none
- Description: Schedule expression (
cron()
orrate()
) for when to run task. See AWS docs - Default:
none
- Description: ARN of cluster on which to run task
- Default:
none
- Description: The number of cpu units used by the task
- Default:
none
- Description: The amount (in MiB) of memory used by the task
- Default:
none
- Description: Task network mode
- Default:
bridge
The following outputs are exported:
- Description: Scheduled Task ECS Role ID
- Description: Scheduled Task ECS Role ID
- Description: Scheduled Task CloudWatch Role ID
- Description: Scheduled Task ARN