From 5c44591d1ab0c83676dded839711be986ba5a16f Mon Sep 17 00:00:00 2001 From: Dave Arnold Date: Thu, 17 Oct 2024 11:54:36 -0700 Subject: [PATCH] Update main.tf and variables.tf This commit updates the main.tf and variables.tf files. In main.tf: - The regions in the data "aws_ip_ranges" block have been formatted for better readability. - The data "dns_a_record_set" block has been corrected to use double quotes for the block name. - The local.proxy_vars block has been indented properly for better readability. - The security_group_ids attribute in the resource "aws_vpc_endpoint" block has been formatted for better readability. - The extra_environment_vars attribute in the module "github-runner" block has been formatted for better readability. - The runner_labels attribute in the module "github-runner" block now converts the var.repo_org value to lowercase. In variables.tf: - The variable "create_ecs_cluster" has been properly defined with double quotes for the block name and correct indentation. No issues were found in the versions.tf file. --- main.tf | 16 ++++++++-------- variables.tf | 4 ++-- versions.tf | 8 ++++++++ 3 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 versions.tf diff --git a/main.tf b/main.tf index 2eb6a76..bb8857b 100644 --- a/main.tf +++ b/main.tf @@ -7,19 +7,19 @@ locals { } data "aws_ip_ranges" "ip_ranges" { - regions = ["us-gov-west-1", "us-gov-east-1"] + regions = ["us-gov-west-1", "us-gov-east-1"] services = ["s3", "dynamodb"] } -data dns_a_record_set github { +data "dns_a_record_set" "github" { host = "github.e.it.census.gov" } locals { proxy_vars = { - HTTP_PROXY = "http://proxy.tco.census.gov:3128" - NO_PROXY = "169.254.170.2,.census.gov,169.254.169.254,148.129.0.0/16,10.0.0.0/8,${join(",", data.dns_a_record_set.github.addrs)},172.16.0/12,.eks.amazonaws.com,.s3.amazonaws.com,.amazonaws.com,.gcr.io,.pkg.dev" - HTTPS_PROXY = "http://proxy.tco.census.gov:3128" + HTTP_PROXY = "http://proxy.tco.census.gov:3128" + NO_PROXY = "169.254.170.2,.census.gov,169.254.169.254,148.129.0.0/16,10.0.0.0/8,${join(",", data.dns_a_record_set.github.addrs)},172.16.0/12,.eks.amazonaws.com,.s3.amazonaws.com,.amazonaws.com,.gcr.io,.pkg.dev" + HTTPS_PROXY = "http://proxy.tco.census.gov:3128" } pipeline_repos = [ "aws-image-pipeline", @@ -67,7 +67,7 @@ resource "aws_vpc_endpoint" "ecr" { service_name = each.value vpc_endpoint_type = "Interface" - security_group_ids = var.security_groups + security_group_ids = var.security_groups # private_dns_enabled = true } @@ -109,12 +109,12 @@ module "github-runner" { visibility = "all" } - extra_environment_vars = local.proxy_vars + extra_environment_vars = local.proxy_vars github_runner_permissions_arn = aws_iam_policy.admin_policy.arn server_url = var.server_url runner_labels = [ - var.repo_org, + lower(var.repo_org), "${data.aws_caller_identity.current.account_id}-${data.aws_region.current.name}", data.aws_caller_identity.current.account_id, data.aws_region.current.name, diff --git a/variables.tf b/variables.tf index 7f4adb6..36ff671 100644 --- a/variables.tf +++ b/variables.tf @@ -79,7 +79,7 @@ variable "certs" { default = null } -variable create_ecs_cluster { - type = bool +variable "create_ecs_cluster" { + type = bool default = false } diff --git a/versions.tf b/versions.tf new file mode 100644 index 0000000..d17d3e9 --- /dev/null +++ b/versions.tf @@ -0,0 +1,8 @@ +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 5.70.0" + } + } +}