Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dxw/terraform-aws-ecs-scheduled-task
Terraform module for AWS ECS to create a scheduled task
https://github.com/dxw/terraform-aws-ecs-scheduled-task
tech-ops
Last synced: 10 days ago
JSON representation
Terraform module for AWS ECS to create a scheduled task
- Host: GitHub
- URL: https://github.com/dxw/terraform-aws-ecs-scheduled-task
- Owner: dxw
- License: mit
- Created: 2018-11-13T15:29:30.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-03T08:30:28.000Z (about 1 year ago)
- Last Synced: 2023-12-03T09:40:36.311Z (about 1 year ago)
- Topics: tech-ops
- Language: HCL
- Homepage:
- Size: 17.6 KB
- Stars: 31
- Watchers: 2
- Forks: 32
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Terraform AWS ECS Scheduled Task
A Terraform module to create a scheduled task in AWS ECS
## Usage
``` hcl
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"
}
```## Configuration
The following variables can be configured:
### Required
#### `name`
- **Description**: Unique name for resources
- **Default**: `none`#### `environment`
- **Description**: Environment - appended to ${var.name} for resources
- **Default**: `none`#### `container_definitions`
- **Description**: Task container defintions. See [AWS docs][container_definition_docs]
- **Default**: `none`#### `schedule_expression`
- **Description**: Schedule expression ( `cron()` or `rate()`) for when to run task. See [AWS docs][schedule_expression_docs]
- **Default**: `none`#### `cluster_arn`
- **Description**: ARN of cluster on which to run task
- **Default**: `none`#### `cpu`
- **Description**: The number of cpu units used by the task
- **Default**: `none`#### `memory`
- **Description**: The amount (in MiB) of memory used by the task
- **Default**: `none`### Optional
#### `network_mode`
- **Description**: Task network mode
- **Default**: `bridge`### Outputs
The following outputs are exported:
#### `scheduled_task_ecs_execution_role_id`
- **Description**: Scheduled Task ECS Role ID
#### `scheduled_task_ecs_role_id`
- **Description**: Scheduled Task ECS Role ID
#### `scheduled_task_cloudwatch_role_id`
- **Description**: Scheduled Task CloudWatch Role ID
#### `scheduled_task_arn`
- **Description**: Scheduled Task ARN
[container_definition_docs]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html
[schedule_expression_docs]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html