{"id":26959322,"url":"https://github.com/tmknom/terraform-aws-ecs-scheduled-task","last_synced_at":"2025-07-06T19:09:40.852Z","repository":{"id":52919095,"uuid":"163389448","full_name":"tmknom/terraform-aws-ecs-scheduled-task","owner":"tmknom","description":"Terraform module which creates ECS Scheduled Task resources on AWS.","archived":false,"fork":false,"pushed_at":"2021-08-26T03:45:31.000Z","size":69,"stargazers_count":35,"open_issues_count":8,"forks_count":50,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-03T04:37:26.978Z","etag":null,"topics":["aws","ecs","terraform","terraform-module"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tmknom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-28T08:59:03.000Z","updated_at":"2024-05-24T00:04:48.000Z","dependencies_parsed_at":"2022-08-23T18:41:13.151Z","dependency_job_id":null,"html_url":"https://github.com/tmknom/terraform-aws-ecs-scheduled-task","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/tmknom/terraform-aws-ecs-scheduled-task","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmknom%2Fterraform-aws-ecs-scheduled-task","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmknom%2Fterraform-aws-ecs-scheduled-task/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmknom%2Fterraform-aws-ecs-scheduled-task/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmknom%2Fterraform-aws-ecs-scheduled-task/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmknom","download_url":"https://codeload.github.com/tmknom/terraform-aws-ecs-scheduled-task/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmknom%2Fterraform-aws-ecs-scheduled-task/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263957845,"owners_count":23535605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","ecs","terraform","terraform-module"],"created_at":"2025-04-03T04:37:30.136Z","updated_at":"2025-07-06T19:09:40.831Z","avatar_url":"https://github.com/tmknom.png","language":"HCL","funding_links":[],"categories":["HCL"],"sub_categories":[],"readme":"# terraform-aws-ecs-scheduled-task\n\n[![Terraform Actions Status](https://github.com/tmknom/terraform-aws-ecs-scheduled-task/workflows/Terraform/badge.svg)](https://github.com/tmknom/terraform-aws-ecs-scheduled-task/actions?query=workflow%3ATerraform)\n[![Markdown Actions Status](https://github.com/tmknom/terraform-aws-ecs-scheduled-task/workflows/Markdown/badge.svg)](https://github.com/tmknom/terraform-aws-ecs-scheduled-task/actions?query=workflow%3AMarkdown)\n[![YAML Actions Status](https://github.com/tmknom/terraform-aws-ecs-scheduled-task/workflows/YAML/badge.svg)](https://github.com/tmknom/terraform-aws-ecs-scheduled-task/actions?query=workflow%3AYAML)\n[![JSON Actions Status](https://github.com/tmknom/terraform-aws-ecs-scheduled-task/workflows/JSON/badge.svg)](https://github.com/tmknom/terraform-aws-ecs-scheduled-task/actions?query=workflow%3AJSON)\n[![GitHub tag](https://img.shields.io/github/tag/tmknom/terraform-aws-ecs-scheduled-task.svg)](https://registry.terraform.io/modules/tmknom/ecs-scheduled-task/aws)\n[![License](https://img.shields.io/github/license/tmknom/terraform-aws-ecs-scheduled-task.svg)](https://opensource.org/licenses/Apache-2.0)\n\nTerraform module which creates ECS Scheduled Task resources on AWS.\n\n## Description\n\nProvision [ECS Task Definitions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html) and\n[CloudWatch Events](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html).\n\nThis module provides recommended settings:\n\n- Fargate launch type\n- Disable assign public ip address\n\n## Usage\n\n### Minimal\n\n```hcl\nmodule \"ecs_scheduled_task\" {\n  source                = \"git::https://github.com/tmknom/terraform-aws-ecs-scheduled-task.git?ref=tags/2.0.0\"\n  name                  = \"example\"\n  schedule_expression   = \"rate(3 minutes)\"\n  container_definitions = var.container_definitions\n  cluster_arn           = var.cluster_arn\n  subnets               = var.subnets\n}\n```\n\n### Complete\n\n```hcl\nmodule \"ecs_scheduled_task\" {\n  source                = \"git::https://github.com/tmknom/terraform-aws-ecs-scheduled-task.git?ref=tags/2.0.0\"\n  name                  = \"example\"\n  schedule_expression   = \"rate(3 minutes)\"\n  container_definitions = var.container_definitions\n  cluster_arn           = var.cluster_arn\n  subnets               = var.subnets\n\n  is_enabled               = true\n  task_count               = 1\n  platform_version         = \"LATEST\"\n  assign_public_ip         = true\n  security_groups          = []\n  cpu                      = 256\n  memory                   = 512\n  requires_compatibilities = [\"FARGATE\"]\n  iam_path                 = \"/service_role/\"\n  description              = \"This is example\"\n  enabled                  = true\n\n  create_ecs_events_role = false\n  ecs_events_role_arn    = var.ecs_events_role_arn\n\n  create_ecs_task_execution_role = false\n  ecs_task_execution_role_arn    = var.ecs_events_role_arn\n\n  tags = {\n    Environment = \"prod\"\n  }\n}\n```\n\n## Examples\n\n- [Minimal](https://github.com/tmknom/terraform-aws-ecs-scheduled-task/tree/master/examples/minimal)\n- [Complete](https://github.com/tmknom/terraform-aws-ecs-scheduled-task/tree/master/examples/complete)\n\n\u003c!-- BEGINNING OF GENERATED BY TERRAFORM-DOCS --\u003e\n\n## Requirements\n\n| Name      | Version |\n| --------- | ------- |\n| terraform | \u003e= 0.12 |\n\n## Providers\n\n| Name | Version |\n| ---- | ------- |\n| aws  | n/a     |\n\n## Inputs\n\n| Name                           | Description                                                                       | Type           | Default                         | Required |\n| ------------------------------ | --------------------------------------------------------------------------------- | -------------- | ------------------------------- | :------: |\n| cluster_arn                    | ARN of an ECS cluster.                                                            | `string`       | n/a                             |   yes    |\n| container_definitions          | A list of valid container definitions provided as a single valid JSON document.   | `string`       | n/a                             |   yes    |\n| name                           | The name of ecs task definition.                                                  | `string`       | n/a                             |   yes    |\n| schedule_expression            | The scheduling expression.For example, `cron(0 20 * * ? *)` or `rate(5 minutes)`. | `string`       | n/a                             |   yes    |\n| subnets                        | The subnets associated with the task or service.                                  | `list(string)` | n/a                             |   yes    |\n| assign_public_ip               | Assign a public IP address to the ENI (Fargate launch type only).                 | `string`       | `false`                         |    no    |\n| cpu                            | The number of cpu units used by the task.                                         | `string`       | `\"256\"`                         |    no    |\n| create_ecs_events_role         | Specify true to indicate that CloudWatch Events IAM Role creation.                | `string`       | `true`                          |    no    |\n| create_ecs_task_execution_role | Specify true to indicate that ECS Task Execution IAM Role creation.               | `string`       | `true`                          |    no    |\n| description                    | The description of the all resources.                                             | `string`       | `\"Managed by Terraform\"`        |    no    |\n| ecs_events_role_arn            | The ARN of the CloudWatch Events IAM Role.                                        | `string`       | `\"\"`                            |    no    |\n| ecs_task_execution_role_arn    | The ARN of the ECS Task Execution IAM Role.                                       | `string`       | `\"\"`                            |    no    |\n| enabled                        | Set to false to prevent the module from creating anything.                        | `bool`         | `true`                          |    no    |\n| iam_path                       | Path in which to create the IAM Role and the IAM Policy.                          | `string`       | `\"/\"`                           |    no    |\n| is_enabled                     | Whether the rule should be enabled.                                               | `string`       | `true`                          |    no    |\n| memory                         | The amount (in MiB) of memory used by the task.                                   | `string`       | `\"512\"`                         |    no    |\n| platform_version               | Specifies the platform version for the task.                                      | `string`       | `\"1.4.0\"`                       |    no    |\n| requires_compatibilities       | A set of launch types required by the task. The valid values are EC2 and FARGATE. | `list(string)` | \u003cpre\u003e[\u003cbr\u003e \"FARGATE\"\u003cbr\u003e]\u003c/pre\u003e |    no    |\n| security_groups                | The security groups associated with the task or service.                          | `list(string)` | `[]`                            |    no    |\n| tags                           | A mapping of tags to assign to all resources.                                     | `map(string)`  | `{}`                            |    no    |\n| task_count                     | The number of tasks to create based on the TaskDefinition.                        | `string`       | `1`                             |    no    |\n\n## Outputs\n\n| Name                                  | Description                                                                |\n| ------------------------------------- | -------------------------------------------------------------------------- |\n| cloudwatch_event_rule_arn             | The Amazon Resource Name (ARN) of the rule.                                |\n| ecs_events_policy_arn                 | The ARN assigned by AWS to this CloudWatch Events IAM Policy.              |\n| ecs_events_policy_description         | The description of the CloudWatch Events IAM Policy.                       |\n| ecs_events_policy_document            | The policy document of the CloudWatch Events IAM Policy.                   |\n| ecs_events_policy_id                  | The CloudWatch Events IAM Policy's ID.                                     |\n| ecs_events_policy_name                | The name of the CloudWatch Events IAM Policy.                              |\n| ecs_events_policy_path                | The path of the CloudWatch Events IAM Policy.                              |\n| ecs_events_role_arn                   | The Amazon Resource Name (ARN) specifying the CloudWatch Events IAM Role.  |\n| ecs_events_role_create_date           | The creation date of the IAM Role.                                         |\n| ecs_events_role_description           | The description of the CloudWatch Events IAM Role.                         |\n| ecs_events_role_name                  | The name of the CloudWatch Events IAM Role.                                |\n| ecs_events_role_unique_id             | The stable and unique string identifying the CloudWatch Events IAM Role.   |\n| ecs_task_definition_arn               | Full ARN of the Task Definition (including both family and revision).      |\n| ecs_task_definition_family            | The family of the Task Definition.                                         |\n| ecs_task_definition_revision          | The revision of the task in a particular family.                           |\n| ecs_task_execution_policy_arn         | The ARN assigned by AWS to this ECS Task Execution IAM Policy.             |\n| ecs_task_execution_policy_description | The description of the ECS Task Execution IAM Policy.                      |\n| ecs_task_execution_policy_document    | The policy document of the ECS Task Execution IAM Policy.                  |\n| ecs_task_execution_policy_id          | The ECS Task Execution IAM Policy's ID.                                    |\n| ecs_task_execution_policy_name        | The name of the ECS Task Execution IAM Policy.                             |\n| ecs_task_execution_policy_path        | The path of the ECS Task Execution IAM Policy.                             |\n| ecs_task_execution_role_arn           | The Amazon Resource Name (ARN) specifying the ECS Task Execution IAM Role. |\n| ecs_task_execution_role_create_date   | The creation date of the ECS Task Execution IAM Role.                      |\n| ecs_task_execution_role_description   | The description of the ECS Task Execution IAM Role.                        |\n| ecs_task_execution_role_name          | The name of the ECS Task Execution IAM Role.                               |\n| ecs_task_execution_role_unique_id     | The stable and unique string identifying the ECS Task Execution IAM Role.  |\n\n\u003c!-- END OF GENERATED BY TERRAFORM-DOCS --\u003e\n\n## Development\n\n### Development Requirements\n\n- [Docker](https://www.docker.com/)\n\n### Configure environment variables\n\n```shell\nexport AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE\nexport AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\nexport AWS_DEFAULT_REGION=ap-northeast-1\n```\n\n### Installation\n\n```shell\ngit clone git@github.com:tmknom/terraform-aws-ecs-scheduled-task.git\ncd terraform-aws-ecs-scheduled-task\nmake install\n```\n\n### Makefile targets\n\n```text\napply-complete                 Run terraform apply examples/complete\napply-minimal                  Run terraform apply examples/minimal\nbump-version                   Bump version (Required argument 'VERSION')\ncheck-format                   Check format code\nclean                          Clean .terraform\ndestroy-complete               Run terraform destroy examples/complete\ndestroy-minimal                Run terraform destroy examples/minimal\ndiff                           Word diff\ndocs                           Generate docs\nformat                         Format code\nhelp                           Show help\ninstall                        Install requirements\nlint                           Lint code\nplan-complete                  Run terraform plan examples/complete\nplan-minimal                   Run terraform plan examples/minimal\nrelease                        Release GitHub and Terraform Module Registry\nupgrade                        Upgrade makefile\n```\n\n### Releasing new versions\n\nBump VERSION file, and run `make release`.\n\n### Terraform Module Registry\n\n- \u003chttps://registry.terraform.io/modules/tmknom/ecs-scheduled-task/aws\u003e\n\n## License\n\nApache 2 Licensed. See LICENSE for full details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmknom%2Fterraform-aws-ecs-scheduled-task","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmknom%2Fterraform-aws-ecs-scheduled-task","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmknom%2Fterraform-aws-ecs-scheduled-task/lists"}