terraform-aws-ecs-task-scheduled-execution

Terraform

Terraform Registry

A terraform module to set up your ECS task the scheduled execution. If ECS task get failed retry until success.

Usage

examples

Requirements

Name Version
terraform >= 0.12

Providers

Name Version
aws n/a

Inputs

Name Description Type Default Required
cloudwatch_event_role_name StepFunctions StateMachine invokable IAM Role name. string n/a yes
cloudwatch_event_schedule_expression Schedule Expressions for Rules ex: cron(0 12 * * ? *), rate(5 minutes). string n/a yes
cluster_name ECS Fargate Cluster name. string n/a yes
ecs_task_definition_family ECS Fargate Task Definition family. string n/a yes
name About this name. string n/a yes
security_groups Specify the security groups to attach. list(string) n/a yes
sfn_iam_role_name StateMachine IAM Role name. string n/a yes
subnets Specify the subnet on which to run ECS Fargate. list(string) n/a yes
assign_public_ip Choose whether to have your tasks receive a public IP address. If you are using Fargate tasks, in order for the task to pull the container image it must either use a public subnet and be assigned a public IP address or a private subnet that has a route to the internet or a NAT gateway that can route requests to the internet. bool false no
cloudwatch_event_description CloudWatch Event Description. string "Invoke ECS Retry StepFunction StateMachine." no
cloudwatch_event_input Valid JSON text passed to the target. string null no
cloudwatch_event_input_path The value of the JSONPath that is used for extracting part of the matched event when passing it to the target. string null no
cloudwatch_event_input_transformer Parameters used when you are providing a custom input to a target based on certain event data.
set(object(
{
input_paths = map(string)
input_template = string
}
))
[] no
ecs_launch_type ECS task launch type. string "FARGATE" no
ecs_task_ignore_retry_errors The errors you do not want to retry. list(string)
[
"States.Permissions"
]
no
ecs_task_need_retry_errors The errors you want to retry. list(string)
[
"States.TaskFailed",
"States.Timeout"
]
no
ecs_task_retry_backoff_rate The multiplier by which the retry interval increases during each attempt. number 2 no
ecs_task_retry_interval_seconds An integer that represents the number of seconds before the first retry attempt. number 60 no
ecs_task_retry_max_attemps A positive integer that represents the maximum number of retry attempts. If the error recurs more times than specified, retries cease and normal error handling resumes. A value of 0 specifies that the error or errors are never retried. number 5 no
enabled The boolean flag whether this execution is enabled or not. No execution when set to false. bool true no
sfn_comment StepFunctions StateMachine comment. string "ECS Task run." no
sfn_ecs_container_override A JSON string ContinerOverride settings. string "{}" no
sfn_timeout_seconds If the task runs longer than the specified second the task takes a timeout to fail. number 99999999 no
tags A map of tags to add to all resources. map(string) {} no

Outputs

Name Description
cloudwatch_event_rule_arn CloudWatch Event Rule Arn.
cloudwatch_event_target_arn CloudWatch Event Target Arn.
sfn_state_machine_name StepFunctions StateMachine name.