Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Jul 20, 2024
1 parent 31a17cb commit 4162c52
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ include "root" {

terraform {
source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-cert-mgr.git"
depends_on = [dependency.eks.outputs.oidc_provider_arn]
extra_arguments "retry_lock" {
commands = get_terraform_commands_that_need_locking()
arguments = ["-lock-timeout=20m"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
include "root" {
path = find_in_parent_folders()
expose = true
}

locals {
Expand Down Expand Up @@ -40,6 +39,7 @@ inputs = {
region = local.region
}


generate "provider-eks" {
path = "provider.tf"
if_exists = "overwrite_terragrunt"
Expand Down
30 changes: 0 additions & 30 deletions lab/us-gov-east-1/vpc/_mcmCluster/eks-istio/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,3 @@ inputs = {
istio_chart_version = "1.22.1"
istio_version = "1.22.1"
}

generate "provider-eks" {
path = "provider.tf"
if_exists = "overwrite_terragrunt"
contents = <<EOF
data "aws_eks_cluster" "cluster" {
name = "${dependency.eks.inputs.cluster_name}"
}
data "aws_eks_cluster_auth" "cluster" {
name = "${dependency.eks.inputs.cluster_name}"
}
provider "kubernetes" {
host = data.aws_eks_cluster.cluster.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
token = data.aws_eks_cluster_auth.cluster.token
}
provider "helm" {
kubernetes {
host = data.aws_eks_cluster.cluster.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
token = data.aws_eks_cluster_auth.cluster.token
}
}
EOF
}
30 changes: 0 additions & 30 deletions lab/us-gov-east-1/vpc/_mcmCluster/eks-loki/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,3 @@ inputs = {
oidc_provider_arn = dependency.eks.outputs.oidc_provider_arn
region = dependency.eks.inputs.region
}

generate "provider-eks" {
path = "provider.tf"
if_exists = "overwrite_terragrunt"
contents = <<EOF
data "aws_eks_cluster" "cluster" {
name = "${dependency.eks.inputs.cluster_name}"
}
data "aws_eks_cluster_auth" "cluster" {
name = "${dependency.eks.inputs.cluster_name}"
}
provider "kubernetes" {
host = data.aws_eks_cluster.cluster.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
token = data.aws_eks_cluster_auth.cluster.token
}
provider "helm" {
kubernetes {
host = data.aws_eks_cluster.cluster.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
token = data.aws_eks_cluster_auth.cluster.token
}
}
EOF
}
36 changes: 34 additions & 2 deletions lab/us-gov-east-1/vpc/_mcmCluster/eks/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ locals {
}

terraform {
source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-eks.git"
source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-eks.git?ref=mcmCluster"
extra_arguments "retry_lock" {
commands = get_terraform_commands_that_need_locking()
arguments = ["-lock-timeout=20m"]
Expand All @@ -66,7 +66,7 @@ inputs = {
cluster_version = local.cluster_version
eks_instance_disk_size = local.eks_instance_disk_size
eks_vpc_name = local.eks_vpc_name
#eks_instance_types = local.eks_instance_types
# eks_instance_types = local.eks_instance_types
eks_ng_desired_size = local.eks_ng_desired_size
eks_ng_max_size = local.eks_ng_max_size
eks_ng_min_size = local.eks_ng_min_size
Expand All @@ -79,3 +79,35 @@ inputs = {
region = local.region
creator = local.cluster_mailing_list
}

generate "provider-eks" {
path = "provider.tf"
if_exists = "overwrite_terragrunt"
contents = <<EOF
data "aws_eks_cluster" "cluster" {
depends_on = [module.cluster.oidc_provider]
name = "${local.cluster_name}"
}
data "aws_eks_cluster_auth" "cluster" {
depends_on = [module.cluster.oidc_provider]
name = "${local.cluster_name}"
}
provider "kubernetes" {
host = data.aws_eks_cluster.cluster.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
token = data.aws_eks_cluster_auth.cluster.token
}
provider "helm" {
kubernetes {
host = data.aws_eks_cluster.cluster.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority[0].data)
token = data.aws_eks_cluster_auth.cluster.token
}
}
EOF
}
3 changes: 1 addition & 2 deletions lab/us-gov-east-1/vpc/_mcmCluster/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ remote_state {
}
config = {
bucket = "tg-infrastructure-tf-state-lab-dev-ew-us-gov-east-1"
key = "${local.project_number}/${local.project_name}/${local.project_role}/terraform.tfstate"
key = "${local.project_number}/${local.project_name}/${local.project_role}/${path_relative_to_include()}/terraform.tfstate"
region = local.region_vars.locals.aws_region
encrypt = true
dynamodb_table = "tf_remote_state"
Expand All @@ -70,4 +70,3 @@ inputs = merge(
local.account_vars.locals,
local.region_vars.locals,
)

0 comments on commit 4162c52

Please sign in to comment.