From 942252740c8a2832ca025642c394ab2af8e081d0 Mon Sep 17 00:00:00 2001 From: Simon Hanmer Date: Tue, 29 Oct 2024 15:46:56 +0000 Subject: [PATCH] tidy code --- steps/init/cloudwatch.tf | 2 +- steps/init/iam.tf | 4 ++-- steps/step02/asg.tf | 6 +++--- steps/step02/elb.tf | 4 ++-- steps/step03/alarm.tf | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/steps/init/cloudwatch.tf b/steps/init/cloudwatch.tf index be2c7ad..e8c0cd8 100644 --- a/steps/init/cloudwatch.tf +++ b/steps/init/cloudwatch.tf @@ -1,4 +1,4 @@ resource "aws_cloudwatch_log_group" "log_group" { - name = "/aws/fis/${var.panda_name}-fis-logs" + name = "/aws/fis/${var.panda_name}-fis-logs" retention_in_days = 1 } \ No newline at end of file diff --git a/steps/init/iam.tf b/steps/init/iam.tf index 633feb3..40e0433 100644 --- a/steps/init/iam.tf +++ b/steps/init/iam.tf @@ -26,7 +26,7 @@ resource "aws_iam_policy_attachment" "ec2_fis_policy_attachment" { resource "aws_iam_policy" "cloudwatch_logs_policy" { name = "${var.panda_name}_cloudwatch_logs_policy" description = "Policy to allow CloudWatch log group and log stream access" - policy = jsonencode({ + policy = jsonencode({ Version = "2012-10-17", Statement = [ { @@ -36,7 +36,7 @@ resource "aws_iam_policy" "cloudwatch_logs_policy" { "logs:CreateLogDelivery", "logs:CreateLogGroup", "logs:CreateLogStream", - "logs:PutLogEvents" + "logs:PutLogEvents" ], Resource = [ "*" diff --git a/steps/step02/asg.tf b/steps/step02/asg.tf index 72d48e0..cc32281 100644 --- a/steps/step02/asg.tf +++ b/steps/step02/asg.tf @@ -24,8 +24,8 @@ resource "aws_launch_template" "this" { resource_type = "instance" tags = { Name = "${var.panda_name}-${local.experiment}" - Project = "${local.resource_suffix}" - Panda = var.panda_name + Project = "${local.resource_suffix}" + Panda = var.panda_name Experiment = local.experiment } } @@ -47,7 +47,7 @@ resource "aws_autoscaling_group" "this" { load_balancers = [aws_elb.this.id] - health_check_type = "ELB" + health_check_type = "ELB" } locals { diff --git a/steps/step02/elb.tf b/steps/step02/elb.tf index 30ce166..4d9f6d4 100644 --- a/steps/step02/elb.tf +++ b/steps/step02/elb.tf @@ -1,6 +1,6 @@ resource "aws_elb" "this" { - name = replace("${local.experiment}-${var.panda_name}-elb", "_", "-") - subnets = data.terraform_remote_state.base_config.outputs.public_subnet_ids + name = replace("${local.experiment}-${var.panda_name}-elb", "_", "-") + subnets = data.terraform_remote_state.base_config.outputs.public_subnet_ids security_groups = [data.terraform_remote_state.base_config.outputs.vpc_security_group_id] diff --git a/steps/step03/alarm.tf b/steps/step03/alarm.tf index 3cc4ae7..f0778c7 100644 --- a/steps/step03/alarm.tf +++ b/steps/step03/alarm.tf @@ -9,7 +9,7 @@ resource "aws_cloudwatch_metric_alarm" "lb_alarm" { threshold = "10" alarm_description = "This metric monitors the number of healthy hosts." datapoints_to_alarm = "2" - treat_missing_data = "notBreaching" + treat_missing_data = "notBreaching" dimensions = { LoadBalancerName = "${aws_elb.this.name}"