Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ivoronin/terraform-aws-ecs-schedule-container

Schedules container runs on ECS Fargate using cron-like syntax
https://github.com/ivoronin/terraform-aws-ecs-schedule-container

Last synced: 5 days ago
JSON representation

Schedules container runs on ECS Fargate using cron-like syntax

Awesome Lists containing this project

README

        

# terraform-aws-ec2-ecs-schedule-container
Schedules container runs on ECS Fargate using cron-like syntax

## How it works
This module creates a periodic event in EventBridge to schedule container runs

## Example
```hcl
module "backup" {
source = "ivoronin/ecs-schedule-container/aws"

name_prefix = "backup"
cron = "0 * ? * * *"

efs_volumes = [{
name = "data"
file_system_id = aws_efs_file_system.data.id
}]

container_definition = {
name = "backup"
image = "restic/restic:latest"
essential = true

environment = [
{ name = "RESTIC_REPOSITORY", value = var.backup_restic_repository },
{ name = "RESTIC_PASSWORD", value = var.backup_restic_password }
]

mountPoints = [{
"containerPath" : "/data",
"sourceVolume" : "data"
}]

command = [
"backup",
"--exclude-caches",
"-H", "apps",
"/data"
]
}

security_groups = [aws_security_group.backup.id]
subnets = [aws_subnet.app.id]
}
```