From 863e73da76a51c2b53aacd7fb0bc77d3e1fd413d Mon Sep 17 00:00:00 2001 From: lucasmacedot Date: Wed, 14 Aug 2024 19:46:36 -0400 Subject: [PATCH] Run lint on all files --- alb-internal.tf | 8 ++++---- alb-listener-certificates.tf | 1 - alb.tf | 14 +++++++------- ...watch-alarms-alb.tf => cloudwatch-alarms-alb.tf | 2 +- ...watch-alarms-asg.tf => cloudwatch-alarms-asg.tf | 2 +- ...watch-alarms-ecs.tf => cloudwatch-alarms-ecs.tf | 4 ++-- ...watch-alarms-efs.tf => cloudwatch-alarms-efs.tf | 2 +- ec2-launch-template.tf | 8 ++++---- ecs.tf | 2 +- efs.tf | 4 ++-- iam-codedeploy.tf | 2 +- iam-ecs-task.tf | 2 +- iam-ecs.tf | 2 +- sg-alb-internal.tf | 4 ++-- sg-alb.tf | 4 ++-- sg-ecs-nodes.tf | 4 ++-- versions.tf | 2 +- waf.tf | 6 +++--- 18 files changed, 36 insertions(+), 37 deletions(-) rename cloutwatch-alarms-alb.tf => cloudwatch-alarms-alb.tf (99%) rename cloutwatch-alarms-asg.tf => cloudwatch-alarms-asg.tf (98%) rename cloutwatch-alarms-ecs.tf => cloudwatch-alarms-ecs.tf (98%) rename cloutwatch-alarms-efs.tf => cloudwatch-alarms-efs.tf (98%) diff --git a/alb-internal.tf b/alb-internal.tf index eba0f6f..c09609e 100644 --- a/alb-internal.tf +++ b/alb-internal.tf @@ -28,7 +28,7 @@ resource "aws_lb" "ecs_internal" { var.tags, { "Terraform" = true, - Name = "ecs-${var.name}-internal" + Name = "ecs-${var.name}-internal" }, ) } @@ -47,7 +47,7 @@ resource "aws_lb_listener" "ecs_https_internal" { target_group_arn = aws_lb_target_group.ecs_default_https_internal[0].arn } - tags = merge( + tags = merge( var.tags, { "Terraform" = true @@ -69,7 +69,7 @@ resource "aws_lb_listener" "ecs_test_https_internal" { #target_group_arn = aws_lb_target_group.ecs_replacement_https[0].arn target_group_arn = aws_lb_target_group.ecs_default_https_internal[0].arn } - tags = merge( + tags = merge( var.tags, { "Terraform" = true @@ -92,7 +92,7 @@ resource "aws_lb_target_group" "ecs_default_https_internal" { port = 80 protocol = "HTTP" vpc_id = var.vpc_id - tags = merge( + tags = merge( var.tags, { "Terraform" = true diff --git a/alb-listener-certificates.tf b/alb-listener-certificates.tf index 5e81097..f4bb482 100644 --- a/alb-listener-certificates.tf +++ b/alb-listener-certificates.tf @@ -9,4 +9,3 @@ resource "aws_lb_listener_certificate" "alb_internal" { listener_arn = element(aws_lb_listener.ecs_https_internal.*.arn, 0) certificate_arn = var.extra_certificate_arns[count.index] } - diff --git a/alb.tf b/alb.tf index bae2670..cfed4eb 100644 --- a/alb.tf +++ b/alb.tf @@ -28,7 +28,7 @@ resource "aws_lb" "ecs" { var.tags, { "Terraform" = true, - "Name" = "ecs-${var.name}" + "Name" = "ecs-${var.name}" }, ) } @@ -47,7 +47,7 @@ resource "aws_lb_listener" "ecs_https" { target_group_arn = aws_lb_target_group.ecs_default_https[0].arn } - tags = merge( + tags = merge( var.tags, { "Terraform" = true @@ -71,7 +71,7 @@ resource "aws_lb_listener" "ecs_http_redirect" { status_code = "HTTP_301" } } - tags = merge( + tags = merge( var.tags, { "Terraform" = true @@ -93,7 +93,7 @@ resource "aws_lb_listener" "ecs_test_https" { #target_group_arn = aws_lb_target_group.ecs_replacement_https[0].arn target_group_arn = aws_lb_target_group.ecs_default_https[0].arn } - tags = merge( + tags = merge( var.tags, { "Terraform" = true @@ -117,7 +117,7 @@ resource "aws_lb_listener" "ecs_test_http_redirect" { status_code = "HTTP_301" } } - tags = merge( + tags = merge( var.tags, { "Terraform" = true @@ -140,7 +140,7 @@ resource "aws_lb_target_group" "ecs_default_http" { protocol = "HTTP" vpc_id = var.vpc_id - tags = merge( + tags = merge( var.tags, { "Terraform" = true @@ -160,7 +160,7 @@ resource "aws_lb_target_group" "ecs_default_https" { protocol = "HTTP" vpc_id = var.vpc_id - tags = merge( + tags = merge( var.tags, { "Terraform" = true diff --git a/cloutwatch-alarms-alb.tf b/cloudwatch-alarms-alb.tf similarity index 99% rename from cloutwatch-alarms-alb.tf rename to cloudwatch-alarms-alb.tf index 8ba70fc..ec38911 100644 --- a/cloutwatch-alarms-alb.tf +++ b/cloudwatch-alarms-alb.tf @@ -88,7 +88,7 @@ resource "aws_cloudwatch_metric_alarm" "alb_latency" { } } - tags = merge( + tags = merge( var.tags, { "Terraform" = true diff --git a/cloutwatch-alarms-asg.tf b/cloudwatch-alarms-asg.tf similarity index 98% rename from cloutwatch-alarms-asg.tf rename to cloudwatch-alarms-asg.tf index 5963ee9..cef2a04 100644 --- a/cloutwatch-alarms-asg.tf +++ b/cloudwatch-alarms-asg.tf @@ -19,7 +19,7 @@ resource "aws_cloudwatch_metric_alarm" "asg_high_cpu" { AutoScalingGroupName = aws_autoscaling_group.ecs[0].name } - tags = merge( + tags = merge( var.tags, { "Terraform" = true diff --git a/cloutwatch-alarms-ecs.tf b/cloudwatch-alarms-ecs.tf similarity index 98% rename from cloutwatch-alarms-ecs.tf rename to cloudwatch-alarms-ecs.tf index 48ff9ad..292c25e 100644 --- a/cloutwatch-alarms-ecs.tf +++ b/cloudwatch-alarms-ecs.tf @@ -19,7 +19,7 @@ resource "aws_cloudwatch_metric_alarm" "ecs_high_memory" { ClusterName = aws_ecs_cluster.ecs.name } - tags = merge( + tags = merge( var.tags, { "Terraform" = true @@ -48,7 +48,7 @@ resource "aws_cloudwatch_metric_alarm" "ecs_high_cpu" { ClusterName = aws_ecs_cluster.ecs.name } - tags = merge( + tags = merge( var.tags, { "Terraform" = true diff --git a/cloutwatch-alarms-efs.tf b/cloudwatch-alarms-efs.tf similarity index 98% rename from cloutwatch-alarms-efs.tf rename to cloudwatch-alarms-efs.tf index ea7c278..7e841ac 100644 --- a/cloutwatch-alarms-efs.tf +++ b/cloudwatch-alarms-efs.tf @@ -19,7 +19,7 @@ resource "aws_cloudwatch_metric_alarm" "efs_credits_low" { FileSystemId = aws_efs_file_system.ecs[0].id } - tags = merge( + tags = merge( var.tags, { "Terraform" = true diff --git a/ec2-launch-template.tf b/ec2-launch-template.tf index ed2a7b7..dd4c99e 100644 --- a/ec2-launch-template.tf +++ b/ec2-launch-template.tf @@ -33,7 +33,7 @@ resource "aws_launch_template" "ecs" { create_before_destroy = true } - tags = merge( + tags = merge( var.tags, { "Terraform" = true @@ -45,7 +45,7 @@ resource "tls_private_key" "algorithm" { count = var.ec2_key_enabled ? 1 : 0 algorithm = "RSA" rsa_bits = 4096 - + } resource "aws_key_pair" "generated_key" { @@ -53,10 +53,10 @@ resource "aws_key_pair" "generated_key" { key_name = "${var.name}-key" public_key = tls_private_key.algorithm[0].public_key_openssh - tags = merge( + tags = merge( var.tags, { "Terraform" = true }, ) -} \ No newline at end of file +} diff --git a/ecs.tf b/ecs.tf index b0efef3..c6cc758 100644 --- a/ecs.tf +++ b/ecs.tf @@ -14,7 +14,7 @@ resource "aws_ecs_cluster" "ecs" { ) lifecycle { ignore_changes = [] - + } } diff --git a/efs.tf b/efs.tf index e8f620e..25573f8 100644 --- a/efs.tf +++ b/efs.tf @@ -54,8 +54,8 @@ resource "aws_security_group" "efs" { description = "for EFS to talk to ECS cluster" vpc_id = var.vpc_id - - tags = merge( + + tags = merge( var.tags, { Name = "ecs-efs-${var.name}" diff --git a/iam-codedeploy.tf b/iam-codedeploy.tf index 460c6ce..856c634 100644 --- a/iam-codedeploy.tf +++ b/iam-codedeploy.tf @@ -26,4 +26,4 @@ EOF resource "aws_iam_role_policy_attachment" "codedeploy_service" { role = aws_iam_role.codedeploy_service.name policy_arn = "arn:aws:iam::aws:policy/AWSCodeDeployRoleForECS" -} \ No newline at end of file +} diff --git a/iam-ecs-task.tf b/iam-ecs-task.tf index 10526f9..136c415 100644 --- a/iam-ecs-task.tf +++ b/iam-ecs-task.tf @@ -99,4 +99,4 @@ resource "aws_iam_role_policy_attachment" "extra_task_policies_arn" { for_each = toset(try(var.extra_task_policies_arn, [])) role = aws_iam_role.ecs_task.name policy_arn = each.key -} \ No newline at end of file +} diff --git a/iam-ecs.tf b/iam-ecs.tf index 1b908f4..871c08b 100644 --- a/iam-ecs.tf +++ b/iam-ecs.tf @@ -7,7 +7,7 @@ resource "aws_iam_instance_profile" "ecs" { count = var.fargate_only ? 0 : 1 name = "ecs-${var.name}-${data.aws_region.current.name}" role = aws_iam_role.ecs[0].name - tags = merge( + tags = merge( var.tags, { "terraform" = "true" diff --git a/sg-alb-internal.tf b/sg-alb-internal.tf index 1d2a8c3..8f31781 100644 --- a/sg-alb-internal.tf +++ b/sg-alb-internal.tf @@ -5,11 +5,11 @@ resource "aws_security_group" "alb_internal" { description = "SG for ECS Internal ALB" vpc_id = var.vpc_id - tags = merge( + tags = merge( var.tags, { terraform = "true" - Name = "ecs-${var.name}-lb" + Name = "ecs-${var.name}-lb" }, ) } diff --git a/sg-alb.tf b/sg-alb.tf index 17549e0..6c3e5a0 100644 --- a/sg-alb.tf +++ b/sg-alb.tf @@ -5,11 +5,11 @@ resource "aws_security_group" "alb" { description = "SG for ECS ALB" vpc_id = var.vpc_id - tags = merge( + tags = merge( var.tags, { terraform = "true" - Name = "ecs-${var.name}-lb" + Name = "ecs-${var.name}-lb" }, ) } diff --git a/sg-ecs-nodes.tf b/sg-ecs-nodes.tf index 21e2b00..ac26272 100644 --- a/sg-ecs-nodes.tf +++ b/sg-ecs-nodes.tf @@ -3,11 +3,11 @@ resource "aws_security_group" "ecs_nodes" { description = "SG for ECS nodes" vpc_id = var.vpc_id - tags = merge( + tags = merge( var.tags, { terraform = "true" - Name = "ecs-${var.name}-nodes" + Name = "ecs-${var.name}-nodes" }, ) } diff --git a/versions.tf b/versions.tf index d8e6461..450c502 100644 --- a/versions.tf +++ b/versions.tf @@ -1,3 +1,3 @@ terraform { required_version = ">= 0.13.0" -} \ No newline at end of file +} diff --git a/waf.tf b/waf.tf index d901dc0..01e495f 100644 --- a/waf.tf +++ b/waf.tf @@ -56,11 +56,11 @@ resource "aws_wafv2_web_acl" "waf_alb" { } } - tags = merge( + tags = merge( var.tags, { terraform = "true" - Name = "waf-${var.name}-web-application" + Name = "waf-${var.name}-web-application" }, ) @@ -86,4 +86,4 @@ resource "aws_wafv2_web_acl_association" "waf_alb_association" { count = var.alb && var.wafv2_enable ? 1 : 0 resource_arn = aws_lb.ecs[0].arn web_acl_arn = aws_wafv2_web_acl.waf_alb[0].arn -} \ No newline at end of file +}