Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add propagate_tags and tags input to scheduled_actions module #31

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
Loading