Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Commit

Permalink
recursive fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgraham4401 committed Aug 22, 2023
1 parent 7db112a commit 27c1ec9
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 44 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/lint-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@ on:
# - "dev/**/*.tf"


#jobs:
# check_fmt:
# name: Lint
# if: github.repository == 'dpgraham-com/dpgraham-infra'
# permissions:
# pull-requests: write
# contents: read
# uses: ./.github/workflows/terraform-lint.yaml
# with:
# working-directory: "./dev"
# environment: development
# secrets: inherit
jobs:
check_fmt:
environment: development
Expand Down
4 changes: 2 additions & 2 deletions dev/vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module "serverless_connector" {
source = "terraform-google-modules/network/google//modules/vpc-serverless-connector-beta"
version = "~> 7.3"

project_id = var.project_id
project_id = var.project_id
vpc_connectors = [
{
name = "frontend-serverless"
Expand All @@ -47,7 +47,7 @@ module "vpc" {
routing_mode = "GLOBAL"
auto_create_subnetworks = false
# ToDo, allows creating multiple subnets
subnets = [
subnets = [
{
subnet_name = "subnet-${var.region}-1"
subnet_ip = "10.1.1.0/24"
Expand Down
40 changes: 20 additions & 20 deletions global/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@ resource "google_compute_subnetwork" "subnet_prod_central1" {

# Development and non-prod organization level shared VPC
module "vpc-dev-shared" {
source = "terraform-google-modules/network/google"
version = "~> 5.0"
project_id = module.dpgraham-vpc-host-nonprod.project_id
network_name = "vpc-dev-shared"
source = "terraform-google-modules/network/google"
version = "~> 5.0"
project_id = module.dpgraham-vpc-host-nonprod.project_id
network_name = "vpc-dev-shared"
# we define subnets in separate resource blocks below
subnets = []
subnets = []
firewall_rules = [
{
name = "serverless-to-vpc-connector"
direction = "INGRESS"
name = "serverless-to-vpc-connector"
direction = "INGRESS"
log_config = {
metadata = "INCLUDE_ALL_METADATA"
}
Expand All @@ -136,8 +136,8 @@ module "vpc-dev-shared" {
]
},
{
name = "vpc-connector-to-serverless"
direction = "EGRESS"
name = "vpc-connector-to-serverless"
direction = "EGRESS"
log_config = {
metadata = "INCLUDE_ALL_METADATA"
}
Expand Down Expand Up @@ -165,8 +165,8 @@ module "vpc-dev-shared" {
]
},
{
name = "vpc-connector-health-checks"
direction = "INGRESS"
name = "vpc-connector-health-checks"
direction = "INGRESS"
log_config = {
metadata = "INCLUDE_ALL_METADATA"
}
Expand All @@ -187,9 +187,9 @@ module "vpc-dev-shared" {
]
},
{
name = "vpc-dev-shared-allow-icmp"
direction = "INGRESS"
priority = 10000
name = "vpc-dev-shared-allow-icmp"
direction = "INGRESS"
priority = 10000
log_config = {
metadata = "INCLUDE_ALL_METADATA"
}
Expand All @@ -207,9 +207,9 @@ module "vpc-dev-shared" {
]
},
{
name = "vpc-dev-shared-allow-ssh"
direction = "INGRESS"
priority = 10000
name = "vpc-dev-shared-allow-ssh"
direction = "INGRESS"
priority = 10000
log_config = {
metadata = "INCLUDE_ALL_METADATA"
}
Expand All @@ -227,9 +227,9 @@ module "vpc-dev-shared" {
]
},
{
name = "vpc-dev-shared-allow-rdp"
direction = "INGRESS"
priority = 10000
name = "vpc-dev-shared-allow-rdp"
direction = "INGRESS"
priority = 10000
log_config = {
metadata = "INCLUDE_ALL_METADATA"
}
Expand Down
6 changes: 3 additions & 3 deletions global/projects.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module "dpgraham-com-prod" {
org_id = var.org_id
folder_id = module.envs.ids["Production"]
svpc_host_project_id = module.dpgraham-vpc-host-prod.project_id
shared_vpc_subnets = [
shared_vpc_subnets = [
google_compute_subnetwork.subnet_prod_east1.id,
google_compute_subnetwork.subnet_prod_central1.id
]
Expand All @@ -29,7 +29,7 @@ module "dpgraham-com-dev" {
org_id = var.org_id
folder_id = module.envs.ids["Development"]
svpc_host_project_id = module.dpgraham-vpc-host-nonprod.project_id
shared_vpc_subnets = [
shared_vpc_subnets = [
google_compute_subnetwork.subnet_dev_east1.id,
google_compute_subnetwork.subnet_dev_central1.id
]
Expand Down Expand Up @@ -63,7 +63,7 @@ module "dpgraham-vpc-host-nonprod" {

billing_account = var.billing_account
enable_shared_vpc_host_project = true
activate_apis = [
activate_apis = [
"compute.googleapis.com",
"vpcaccess.googleapis.com"
]
Expand Down
2 changes: 1 addition & 1 deletion modules/domain/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ resource "google_dns_record_set" "dpgraham_com_record_set" {
managed_zone = google_dns_managed_zone.dpgraham_com.name
type = "A"
ttl = 300
rrdatas = [
rrdatas = [
var.ipv4_address
]
}
4 changes: 2 additions & 2 deletions modules/global-lb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ module "lb-http" {
backends = {
default = {
description = "Cloud backend for directing requests to the react backend"
groups = [
groups = [
{
group = google_compute_region_network_endpoint_group.client_serverless_neg.id
}
Expand All @@ -86,7 +86,7 @@ module "lb-http" {
}
server = {
description = "Cloud backend for directing to a NEG for the restful API (server)"
groups = [
groups = [
{
group = google_compute_region_network_endpoint_group.serverless_neg.id
}
Expand Down
2 changes: 1 addition & 1 deletion modules/network/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ variable "environment" {
# Note: A VPC is a global resource, subnets are regional.
variable "subnets" {
description = "Any subnets of the VPC."
type = list(object({
type = list(object({
subnet_name = string
subnet_ip = string
subnet_region = string
Expand Down
6 changes: 3 additions & 3 deletions modules/sql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ locals {
database_tier = var.environment == "prod" ? "db-custom-1-3840" : "db-f1-micro"
disk_size = var.environment == "prod" ? 10 : 10 # in GB, 10 GB is the minimum
availability = var.environment == "prod" ? "REGIONAL" : "ZONAL"
instance_name = var.environment == "prod" ? "${replace(var.name,"_","-")}-postgres" : "${replace(var.name,"_" ,"-" )}-postgres-dev"
instance_name = var.environment == "prod" ? "${replace(var.name, "_", "-")}-postgres" : "${replace(var.name, "_", "-")}-postgres-dev"
ip_range_name = "${replace(var.name, "_", "-")}-ip-range"
}

Expand Down Expand Up @@ -74,8 +74,8 @@ resource "google_compute_global_address" "private_ip_range" {
}

resource "google_service_networking_connection" "sql_vpc_connection" {
network = var.vpc
service = "servicenetworking.googleapis.com"
network = var.vpc
service = "servicenetworking.googleapis.com"
reserved_peering_ranges = [
google_compute_global_address.private_ip_range.name
]
Expand Down

0 comments on commit 27c1ec9

Please sign in to comment.