ecs-scheduled-task

dod-iac/ecs-scheduled-task/aws

Terraform Module HCL AWS

Terraform module to create an ECS Scheduled Task

Install
module "ecs-scheduled-task" {
source = "dod-iac/ecs-scheduled-task/aws"
version = "1.0.0"
}
plain text: /constructs/tfmod-dod-iac-ecs-scheduled-task-aws/install.txt
⭐ Source on GitHub 📦 Registry page
README

ECS Scheduled Tasks Description This module runs an ECS task in Fargate based on an Event Bridge Rule. Usage ``hcl module "ecs-scheduled-task" { source = "dod-iac/ecs-scheduled-task/aws" name = "task-name" schedule_expression = "cron(30 ? )" ecs_cluster_arn = aws_ecs_cluster.cluster.arn ecs_subnets = var.ecs_subnets vpc_id = var.vpc_id ecr_repository_arn = module.ecr_repo.arn ecr_repository_url = module.ecr_repo.repository_url image_tag = data.aws_ssm_parameter.image_tag.value cloudwatch_log_group_arn = aws_cloudwatch_log_group.main.arn cloudwatch_log_group_name = aws_cloudwatch_log_group.main.name task_role_policy_doc = data.aws_iam_policy_document.task_role_policy_doc.json task_def_env_vars = [ { "name" : "KEYNAME1", "value" : "VALUE1" }, { "name" : "KEYNAME2", "value" : "VALUE2" }, ] ta

Inputs (15)
NameTypeDescriptionDefault
ecr_repository_urlstringThe ECR repository URL required
image_tagstringThe image tag to deploy required
vpc_idstringThe vpc ID related to the subnets. required
cloudwatch_log_group_arnstringThe arn of the cloudwatch log group required
cloudwatch_log_group_namestringThe name of the cloudwatch log group required
ecr_repository_arnstringThe ECR repository arn required
ecs_subnetslist(string)The list of subnets to use for the ECS tasks. required
task_role_policy_docstringThe IAM policy document used for the task role required
ecs_cluster_arnstringThe ECS cluster arn required
namestringA unique name for the module"scheduled-task"
ecs_task_cpunumber2048
schedule_expressionstringThe schedule to run the task on in AWS cron format."cron(30 * * * ? *)"
ecs_task_memnumber4096
task_def_env_varslist(map(string))Environment variables for the task definition[]
tagsmaptags for resources{}
Outputs (4)
cloudwatch_target_role_arn — CloudWatch target IAM role arn
event_rule_run_command_arn — CloudWatch event rule run commandarn
task_role_arn — ECS task IAM role arn
task_execution_role_arn — ECS task execution IAM role arn
Resources (6)
aws_cloudwatch_event_ruleaws_cloudwatch_event_targetaws_ecs_task_definitionaws_iam_roleaws_iam_role_policyaws_security_group
Details
FrameworkTerraform Module
LanguageHCL
Version1.0.0
Cloud AWS
★ Stars1
Forks2
Total downloads6.0k
Inputs15
Outputs4
Resources6
LicenseNOASSERTION
Namespacedod-iac
Updated