diff options
| author | Paul Buetow <paul@buetow.org> | 2023-12-31 18:13:22 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-12-31 18:13:22 +0200 |
| commit | 2041582fa55b06df0b7c9d9555e373b40f73ab60 (patch) | |
| tree | 692a20c2ad94285649928654ac9fefbfdb714e75 | |
| parent | 5ed8237764ed81b583f59146a902c759642e83b8 (diff) | |
adding more tags
| -rw-r--r-- | org-buetow-ecs/audiobookshelfservice.tf | 12 | ||||
| -rw-r--r-- | org-buetow-ecs/bagservice.tf | 12 | ||||
| -rw-r--r-- | org-buetow-ecs/ecs.tf | 8 | ||||
| -rw-r--r-- | org-buetow-ecs/fluxpostgreservice.tf | 49 | ||||
| -rw-r--r-- | org-buetow-ecs/fluxservice.tf | 12 | ||||
| -rw-r--r-- | org-buetow-ecs/nginxservice.tf | 12 | ||||
| -rw-r--r-- | org-buetow-ecs/syncthingservice.tf | 27 | ||||
| -rw-r--r-- | org-buetow-ecs/vaultservice.tf | 12 |
8 files changed, 99 insertions, 45 deletions
diff --git a/org-buetow-ecs/audiobookshelfservice.tf b/org-buetow-ecs/audiobookshelfservice.tf index 0abd1a1..777e514 100644 --- a/org-buetow-ecs/audiobookshelfservice.tf +++ b/org-buetow-ecs/audiobookshelfservice.tf @@ -31,7 +31,7 @@ resource "aws_ecs_task_definition" "audiobookshelf" { execution_role_arn = aws_iam_role.ecs_execution_role.arn tags = { - Name = "audiobookshelf-task" + Name = "audiobookshelf" } volume { @@ -117,7 +117,7 @@ resource "aws_ecs_service" "audiobookshelf" { desired_count = 1 tags = { - Name = "audiobookshelf-service" + Name = "audiobookshelf" } load_balancer { @@ -144,6 +144,10 @@ resource "aws_lb_target_group" "audiobookshelf_tg" { vpc_id = data.terraform_remote_state.base.outputs.vpc_id target_type = "ip" + tags = { + Name = "audiobookshelf" + } + health_check { enabled = true healthy_threshold = 2 @@ -170,4 +174,8 @@ resource "aws_lb_listener_rule" "audiobookshelf_https_listener_rule" { values = ["audiobookshelf.buetow.cloud"] } } + + tags = { + Name = "audiobookshelf" + } } diff --git a/org-buetow-ecs/bagservice.tf b/org-buetow-ecs/bagservice.tf index dc1855b..c6c6061 100644 --- a/org-buetow-ecs/bagservice.tf +++ b/org-buetow-ecs/bagservice.tf @@ -31,7 +31,7 @@ resource "aws_ecs_task_definition" "bag" { execution_role_arn = aws_iam_role.ecs_execution_role.arn tags = { - Name = "bag-task" + Name = "bag" } volume { @@ -96,7 +96,7 @@ resource "aws_ecs_service" "bag" { desired_count = 1 tags = { - Name = "bag-service" + Name = "bag" } load_balancer { @@ -133,6 +133,10 @@ resource "aws_lb_target_group" "bag_tg" { timeout = 3 matcher = "200-299" } + + tags = { + Name = "bag" + } } resource "aws_lb_listener_rule" "bag_https_listener_rule" { @@ -149,4 +153,8 @@ resource "aws_lb_listener_rule" "bag_https_listener_rule" { values = ["bag.buetow.cloud"] } } + + tags = { + Name = "bag" + } } diff --git a/org-buetow-ecs/ecs.tf b/org-buetow-ecs/ecs.tf index d2d72be..63ddde5 100644 --- a/org-buetow-ecs/ecs.tf +++ b/org-buetow-ecs/ecs.tf @@ -1,5 +1,9 @@ resource "aws_ecs_cluster" "ecs_cluster" { name = "ecs-cluster" + + tags = { + Name = "ecs-cluster" + } } resource "aws_iam_role" "ecs_execution_role" { @@ -15,6 +19,10 @@ resource "aws_iam_role" "ecs_execution_role" { }, }] }) + + tags = { + Name = "ecs-cluster" + } } resource "aws_iam_role_policy_attachment" "ecs_execution_role_policy_attach" { diff --git a/org-buetow-ecs/fluxpostgreservice.tf b/org-buetow-ecs/fluxpostgreservice.tf index 1f04a30..8434b91 100644 --- a/org-buetow-ecs/fluxpostgreservice.tf +++ b/org-buetow-ecs/fluxpostgreservice.tf @@ -11,11 +11,11 @@ resource "aws_lb" "fluxpostgres_nlb" { data.terraform_remote_state.base.outputs.public_subnet_b_id, data.terraform_remote_state.base.outputs.public_subnet_c_id, ] -} -#output "fluxpostgres_dns_name" { -# value = aws_lb.fluxpostgres_nlb.dns_name -#} + tags = { + Name = "fluxpostgres" + } +} resource "aws_lb_listener" "fluxpostgres_tcp" { load_balancer_arn = aws_lb.fluxpostgres_nlb.arn @@ -26,6 +26,10 @@ resource "aws_lb_listener" "fluxpostgres_tcp" { type = "forward" target_group_arn = aws_lb_target_group.fluxpostgres_tcp.arn } + + tags = { + Name = "fluxpostgres" + } } resource "aws_lb_target_group" "fluxpostgres_tcp" { @@ -34,31 +38,11 @@ resource "aws_lb_target_group" "fluxpostgres_tcp" { protocol = "TCP" vpc_id = data.terraform_remote_state.base.outputs.vpc_id target_type = "ip" -} -#resource "aws_route53_record" "a_record_fluxpostgres" { -# zone_id = data.terraform_remote_state.base.outputs.buetow_internal_zone_id -# name = "fluxpostgres.buetow.internal." -# type = "A" -# -# alias { -# name = aws_lb.fluxpostgres_nlb.dns_name -# zone_id = aws_lb.fluxpostgres_nlb.zone_id -# evaluate_target_health = true -# } -#} - -#resource "aws_route53_record" "aaaa_record_fluxpostgres" { -# zone_id = data.terraform_remote_state.base.outputs.buetow_internal_zone_id -# name = "fluxpostgres.buetow.internal." -# type = "AAAA" -# -# alias { -# name = aws_lb.fluxpostgres_nlb.dns_name -# zone_id = aws_lb.fluxpostgres_nlb.zone_id -# evaluate_target_health = true -# } -#} + tags = { + Name = "fluxpostgres" + } +} resource "aws_ecs_task_definition" "fluxpostgres" { family = "fluxpostgres" @@ -69,7 +53,7 @@ resource "aws_ecs_task_definition" "fluxpostgres" { execution_role_arn = aws_iam_role.ecs_execution_role.arn tags = { - Name = "fluxpostgres-task" + Name = "fluxpostgres" } volume { @@ -141,7 +125,7 @@ resource "aws_security_group" "fluxpostgres" { ipv6_cidr_blocks = ["::/0"] } - # TODO: Required? Yes for contianer pull + # Required for contianer pull egress { from_port = 0 to_port = 0 @@ -151,9 +135,10 @@ resource "aws_security_group" "fluxpostgres" { } tags = { - Name = "allow-fluxpostgres" + Name = "fluxpostgres" } } + resource "aws_ecs_service" "fluxpostgres" { name = "fluxpostgres" cluster = aws_ecs_cluster.ecs_cluster.id @@ -164,7 +149,7 @@ resource "aws_ecs_service" "fluxpostgres" { desired_count = 1 tags = { - Name = "fluxpostgres-service" + Name = "fluxpostgres" } load_balancer { diff --git a/org-buetow-ecs/fluxservice.tf b/org-buetow-ecs/fluxservice.tf index e41d950..d6ea931 100644 --- a/org-buetow-ecs/fluxservice.tf +++ b/org-buetow-ecs/fluxservice.tf @@ -31,7 +31,7 @@ resource "aws_ecs_task_definition" "flux" { execution_role_arn = aws_iam_role.ecs_execution_role.arn tags = { - Name = "flux-task" + Name = "flux" } container_definitions = jsonencode([{ @@ -88,7 +88,7 @@ resource "aws_ecs_service" "flux" { desired_count = 1 tags = { - Name = "flux-service" + Name = "flux" } load_balancer { @@ -115,6 +115,10 @@ resource "aws_lb_target_group" "flux_tg" { vpc_id = data.terraform_remote_state.base.outputs.vpc_id target_type = "ip" + tags = { + Name = "flux" + } + health_check { enabled = true healthy_threshold = 2 @@ -131,6 +135,10 @@ resource "aws_lb_listener_rule" "flux_https_listener_rule" { listener_arn = data.terraform_remote_state.elb.outputs.alb_https_listener_arn priority = 105 + tags = { + Name = "flux" + } + action { type = "forward" target_group_arn = aws_lb_target_group.flux_tg.arn diff --git a/org-buetow-ecs/nginxservice.tf b/org-buetow-ecs/nginxservice.tf index 5fe46b2..01f5ec2 100644 --- a/org-buetow-ecs/nginxservice.tf +++ b/org-buetow-ecs/nginxservice.tf @@ -31,7 +31,7 @@ # execution_role_arn = aws_iam_role.ecs_execution_role.arn # # tags = { -# Name = "nginx-task" +# Name = "nginx" # } # # container_definitions = jsonencode([{ @@ -60,7 +60,7 @@ # desired_count = 1 # # tags = { -# Name = "nginx-service" +# Name = "nginx" # } # # load_balancer { @@ -87,6 +87,10 @@ # vpc_id = data.terraform_remote_state.base.outputs.vpc_id # target_type = "ip" # +# tags = { +# Name = "nginx" +# } +# # health_check { # enabled = true # healthy_threshold = 2 @@ -113,4 +117,8 @@ # values = ["nginx.buetow.cloud"] # } # } +# +# tags = { +# Name = "nginx" +# } #} diff --git a/org-buetow-ecs/syncthingservice.tf b/org-buetow-ecs/syncthingservice.tf index 93e0a49..5d0758e 100644 --- a/org-buetow-ecs/syncthingservice.tf +++ b/org-buetow-ecs/syncthingservice.tf @@ -11,6 +11,10 @@ resource "aws_lb" "syncthing_nlb" { data.terraform_remote_state.base.outputs.public_subnet_b_id, data.terraform_remote_state.base.outputs.public_subnet_c_id, ] + + tags = { + Name = "syncthing" + } } resource "aws_lb_listener" "syncthing_data_tcp" { @@ -22,6 +26,10 @@ resource "aws_lb_listener" "syncthing_data_tcp" { type = "forward" target_group_arn = aws_lb_target_group.syncthing_data_tcp.arn } + + tags = { + Name = "syncthing" + } } resource "aws_lb_target_group" "syncthing_data_tcp" { @@ -30,6 +38,10 @@ resource "aws_lb_target_group" "syncthing_data_tcp" { protocol = "TCP" vpc_id = data.terraform_remote_state.base.outputs.vpc_id target_type = "ip" + + tags = { + Name = "syncthing" + } } resource "aws_route53_record" "a_record_syncthing" { @@ -73,6 +85,10 @@ resource "aws_lb_target_group" "syncthing_ui_tg" { timeout = 3 matcher = "200-299" } + + tags = { + Name = "syncthing" + } } resource "aws_lb_listener_rule" "syncthing_ui_https_listener_rule" { @@ -89,6 +105,10 @@ resource "aws_lb_listener_rule" "syncthing_ui_https_listener_rule" { values = ["syncthing.buetow.cloud"] } } + + tags = { + Name = "syncthing" + } } @@ -125,7 +145,7 @@ resource "aws_ecs_task_definition" "syncthing" { execution_role_arn = aws_iam_role.ecs_execution_role.arn tags = { - Name = "syncthing-task" + Name = "syncthing" } volume { @@ -245,9 +265,10 @@ resource "aws_security_group" "syncthing" { } tags = { - Name = "allow-syncthing" + Name = "syncthing" } } + resource "aws_ecs_service" "syncthing" { name = "syncthing" cluster = aws_ecs_cluster.ecs_cluster.id @@ -258,7 +279,7 @@ resource "aws_ecs_service" "syncthing" { desired_count = 1 tags = { - Name = "syncthing-service" + Name = "syncthing" } load_balancer { diff --git a/org-buetow-ecs/vaultservice.tf b/org-buetow-ecs/vaultservice.tf index 774f7f4..0405eb6 100644 --- a/org-buetow-ecs/vaultservice.tf +++ b/org-buetow-ecs/vaultservice.tf @@ -31,7 +31,7 @@ # execution_role_arn = aws_iam_role.ecs_execution_role.arn # # tags = { -# Name = "vault-task" +# Name = "vault" # } # # volume { @@ -77,7 +77,7 @@ # desired_count = 1 # # tags = { -# Name = "vault-service" +# Name = "vault" # } # # load_balancer { @@ -114,6 +114,10 @@ # timeout = 3 # matcher = "200-299" # } +# +# tags = { +# Name = "vault" +# } #} # #resource "aws_lb_listener_rule" "vault_https_listener_rule" { @@ -130,4 +134,8 @@ # values = ["vault.buetow.cloud"] # } # } +# +# tags = { +# Name = "vault" +# } #} |
