Skip to content

Commit

Permalink
Merge pull request #31 from HENNGE/scheduled-actions-propagate-tags
Browse files Browse the repository at this point in the history
Add propagate_tags and tags input to scheduled_actions module
  • Loading branch information
FurqanHabibi authored Mar 1, 2024
2 parents 311e8e9 + 10a405f commit aa96e58
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/scheduled-actions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ No modules.
| <a name="input_iam_invoker"></a> [iam\_invoker](#input\_iam\_invoker) | IAM ARN to invoke ECS Task | `string` | n/a | yes |
| <a name="input_is_fargate"></a> [is\_fargate](#input\_is\_fargate) | Task is fargate | `bool` | `false` | no |
| <a name="input_name"></a> [name](#input\_name) | Name for scheduled action | `string` | n/a | yes |
| <a name="input_propagate_tags"></a> [propagate\_tags](#input\_propagate\_tags) | Specifies whether to propagate the tags from the task definition to the task. | `bool` | `false` | no |
| <a name="input_schedule_description"></a> [schedule\_description](#input\_schedule\_description) | The description of the rule | `string` | `"Cloudwatch event rule to invoke ECS Task"` | no |
| <a name="input_schedule_rule"></a> [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 |
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to assign to ecs resources. | `map(string)` | `null` | no |
| <a name="input_task_count"></a> [task\_count](#input\_task\_count) | Desired ECS Task count to run | `number` | n/a | yes |
| <a name="input_task_definition_arn"></a> [task\_definition\_arn](#input\_task\_definition\_arn) | Task definition ARN to run | `string` | n/a | yes |

Expand Down
3 changes: 3 additions & 0 deletions modules/scheduled-actions/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions modules/scheduled-actions/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit aa96e58

Please sign in to comment.