Skip to content

Commit 6f10a17

Browse files
authored
feat: Only tag ecs service if longer arns are enabled in the aws account (#153)
1 parent 6cce597 commit 6f10a17

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ allow_github_webhooks = true
352352
| <a name="input_trusted_entities"></a> [trusted\_entities](#input\_trusted\_entities) | A list of users or roles, that can assume the task role | `list(string)` | `[]` | no |
353353
| <a name="input_trusted_principals"></a> [trusted\_principals](#input\_trusted\_principals) | A list of principals, in addition to ecs-tasks.amazonaws.com, that can assume the task role | `list(string)` | `[]` | no |
354354
| <a name="input_ulimits"></a> [ulimits](#input\_ulimits) | Container ulimit settings. This is a list of maps, where each map should contain "name", "hardLimit" and "softLimit" | <pre>list(object({<br> name = string<br> hardLimit = number<br> softLimit = number<br> }))</pre> | `null` | no |
355+
| <a name="input_use_ecs_old_arn_format"></a> [use\_ecs\_old\_arn\_format](#input\_use\_ecs\_old\_arn\_format) | A flag to enable/disable tagging the ecs resources that require the new longer arn format | `bool` | `false` | no |
355356
| <a name="input_user"></a> [user](#input\_user) | The user to run as inside the container. Can be any of these formats: user, user:group, uid, uid:gid, user:gid, uid:group. The default (null) will use the container's configured `USER` directive or root if not set. | `string` | `null` | no |
356357
| <a name="input_volumes_from"></a> [volumes\_from](#input\_volumes\_from) | A list of VolumesFrom maps which contain "sourceContainer" (name of the container that has the volumes to mount) and "readOnly" (whether the container can write to the volume) | <pre>list(object({<br> sourceContainer = string<br> readOnly = bool<br> }))</pre> | `[]` | no |
357358
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | ID of an existing VPC where resources will be created | `string` | `""` | no |

main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ resource "aws_ecs_service" "atlantis" {
629629
enable_ecs_managed_tags = var.enable_ecs_managed_tags
630630
propagate_tags = var.propagate_tags
631631

632-
tags = local.tags
632+
tags = var.use_ecs_old_arn_format ? null : local.tags
633633
}
634634

635635
###################

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,12 @@ variable "enable_ecs_managed_tags" {
602602
default = false
603603
}
604604

605+
variable "use_ecs_old_arn_format" {
606+
description = "A flag to enable/disable tagging the ecs resources that require the new longer arn format"
607+
type = bool
608+
default = false
609+
}
610+
605611
variable "ecs_service_force_new_deployment" {
606612
description = "Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g. myimage:latest)"
607613
type = bool

0 commit comments

Comments
 (0)