diff --git a/modules/scheduled-actions/README.md b/modules/scheduled-actions/README.md index 9c6b834..bd5fa53 100644 --- a/modules/scheduled-actions/README.md +++ b/modules/scheduled-actions/README.md @@ -108,8 +108,10 @@ No modules. | [iam\_invoker](#input\_iam\_invoker) | IAM ARN to invoke ECS Task | `string` | n/a | yes | | [is\_fargate](#input\_is\_fargate) | Task is fargate | `bool` | `false` | no | | [name](#input\_name) | Name for scheduled action | `string` | n/a | yes | +| [propagate\_tags](#input\_propagate\_tags) | Specifies whether to propagate the tags from the task definition to the task. | `bool` | `false` | no | | [schedule\_description](#input\_schedule\_description) | The description of the rule | `string` | `"Cloudwatch event rule to invoke ECS Task"` | no | | [schedule\_rule](#input\_schedule\_rule) | Schedule in cron or rate (see: https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html for rules) | `string` | n/a | yes | +| [tags](#input\_tags) | A map of tags to assign to ecs resources. | `map(string)` | `null` | no | | [task\_count](#input\_task\_count) | Desired ECS Task count to run | `number` | n/a | yes | | [task\_definition\_arn](#input\_task\_definition\_arn) | Task definition ARN to run | `string` | n/a | yes | diff --git a/modules/scheduled-actions/main.tf b/modules/scheduled-actions/main.tf index d376274..b6e655f 100644 --- a/modules/scheduled-actions/main.tf +++ b/modules/scheduled-actions/main.tf @@ -31,6 +31,9 @@ resource "aws_cloudwatch_event_target" "target" { base = lookup(capacity_provider_strategy.value, "base", null) } } + + propagate_tags = var.propagate_tags ? "TASK_DEFINITION" : null + tags = var.tags } input = var.container_overrides diff --git a/modules/scheduled-actions/variables.tf b/modules/scheduled-actions/variables.tf index 123ca81..2a4fb52 100644 --- a/modules/scheduled-actions/variables.tf +++ b/modules/scheduled-actions/variables.tf @@ -69,3 +69,15 @@ variable "capacity_provider_strategy" { default = [] type = list(any) } + +variable "propagate_tags" { + description = "Specifies whether to propagate the tags from the task definition to the task." + default = false + type = bool +} + +variable "tags" { + description = "A map of tags to assign to ecs resources." + default = null + type = map(string) +}