Skip to content

Commit

Permalink
add var tags
Browse files Browse the repository at this point in the history
  • Loading branch information
marciogoda committed May 10, 2024
1 parent 42a473f commit 747a8ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
12 changes: 2 additions & 10 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
locals {

tags = merge({
"component" = var.release["component"]
"env" = var.release["env"]
"team" = var.release["team"]
"version" = var.release["version"]
})
}


resource "aws_ecs_service" "service" {
count = var.target_group_arn != "" ? 1 : 0
Expand All @@ -19,7 +11,7 @@ resource "aws_ecs_service" "service" {
deployment_minimum_healthy_percent = var.deployment_minimum_healthy_percent
deployment_maximum_percent = var.deployment_maximum_percent
health_check_grace_period_seconds = var.health_check_grace_period_seconds
tags = local.tags
tags = var.tags

load_balancer {
target_group_arn = var.target_group_arn
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,10 @@ variable "capacity_providers" {
description = "The capacity providers to add to the service. If the service is using the default capacity provider strategy, the service can also have one or more capacity providers specified using the capacityProviders parameter."
type = list
default = []
}

variable "tags" {
description = "A mapping of tags to assign to the resource."
type = map
default = {}
}

0 comments on commit 747a8ed

Please sign in to comment.