Skip to content

Commit

Permalink
Update main.tf and variables.tf
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Dave Arnold committed Oct 17, 2024
1 parent 3f4f8e8 commit 5c44591
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
16 changes: 8 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ variable "certs" {
default = null
}

variable create_ecs_cluster {
type = bool
variable "create_ecs_cluster" {
type = bool
default = false
}
8 changes: 8 additions & 0 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.70.0"
}
}
}

0 comments on commit 5c44591

Please sign in to comment.