Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Jul 30, 2024
1 parent 238a6a1 commit 12b9ca3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
12 changes: 6 additions & 6 deletions dns_zones.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ locals {
vpc_domain_name = var.vpc_domain_name
cluster_domain_name = format("%v.%v", var.cluster_name, local.vpc_domain_name)
cluster_domain_description = format("%v EKS Cluster DNS Zone", var.cluster_name)
region = var.region
region = var.region
}

#---
Expand Down Expand Up @@ -32,7 +32,7 @@ provider "aws" {
# dummy vpc, so we can associate the zone to this account
#---
data "aws_vpc" "dummy_vpc" {
count = ! (var.shared_vpc_label == null || var.shared_vpc_label == "") ? 1 : 0
count = !(var.shared_vpc_label == null || var.shared_vpc_label == "") ? 1 : 0
filter {
name = "tag:Name"
values = ["vpc0-dummy"]
Expand All @@ -45,14 +45,14 @@ resource "aws_route53_zone" "cluster_domain" {
force_destroy = false

vpc {
vpc_id = ! (var.shared_vpc_label == null || var.shared_vpc_label == "") ? try(data.aws_vpc.dummy_vpc[0].id, null) : data.aws_vpc.eks_vpc.id
vpc_id = !(var.shared_vpc_label == null || var.shared_vpc_label == "") ? try(data.aws_vpc.dummy_vpc[0].id, null) : data.aws_vpc.eks_vpc.id
vpc_region = local.region
}

lifecycle {
ignore_changes = [vpc]
precondition {
condition = (var.shared_vpc_label == null || var.shared_vpc_label == "") || (! (var.shared_vpc_label == null || var.shared_vpc_label == "") && ! (var.vpc_domain_name == null || var.vpc_domain_name == ""))
condition = (var.shared_vpc_label == null || var.shared_vpc_label == "") || (!(var.shared_vpc_label == null || var.shared_vpc_label == "") && !(var.vpc_domain_name == null || var.vpc_domain_name == ""))
error_message = "var.vpc_domain_name must be provided when shared VPCs are in use."
}
}
Expand All @@ -68,7 +68,7 @@ resource "aws_route53_zone" "cluster_domain" {
# need to also associate with network-prod account and this vpc
#---
module "route53_cluster_domain_east" {
count = local.region == "us-gov-east-1" && ! (var.shared_vpc_label == null || var.shared_vpc_label == "") ? 1 : 0
count = local.region == "us-gov-east-1" && !(var.shared_vpc_label == null || var.shared_vpc_label == "") ? 1 : 0
providers = {
aws.self = aws
aws.peer = aws.route53_main_east
Expand All @@ -83,7 +83,7 @@ module "route53_cluster_domain_east" {
}

module "route53_cluster_domain_west" {
count = local.region == "us-gov-west-1" && ! (var.shared_vpc_label == null || var.shared_vpc_label == "") ? 1 : 0
count = local.region == "us-gov-west-1" && !(var.shared_vpc_label == null || var.shared_vpc_label == "") ? 1 : 0
providers = {
aws.self = aws
aws.peer = aws.route53_main_west
Expand Down
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ module "cluster" {
xvda = {
device_name = "/dev/xvda"
ebs = {
volume_size = var.eks_instance_disk_size
volume_type = "gp3"
volume_size = var.eks_instance_disk_size
volume_type = "gp3"
# iops = 3000
# throughput = 125
encrypted = true
Expand Down
3 changes: 2 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ variable "shared_vpc_label" {
variable "region_map" {
description = "AWS region map"
type = map(string)
default = {"east": "us-gov-east-1", "west": "us-gov-west-1"}
default = { "east" : "us-gov-east-1", "west" : "us-gov-west-1" }
}

variable "route53_endpoints" {
Expand All @@ -172,5 +172,6 @@ variable "route53_endpoints" {
"us-gov-east-1" = "vpc-070595c5b133243dd"
"us-gov-west-1" = "vpc-08b7b4db6a5ddf9c1"
}
route53_main_legacy = {}
}
}
4 changes: 2 additions & 2 deletions version.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
locals {
_module_name = "tfmod-eks"
_module_version = "0.0.2"
_module_name = "tfmod-eks"
_module_version = "0.0.2"
_module_providers = []
}

0 comments on commit 12b9ca3

Please sign in to comment.