Skip to content

Commit

Permalink
generate provider
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Jul 22, 2024
1 parent 8f8f8c6 commit 730f0ba
Showing 1 changed file with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
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 All @@ -24,3 +23,33 @@ inputs = {
profile = dependency.eks.inputs.profile
contact_email = dependency.eks.inputs.creator
}

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
}

0 comments on commit 730f0ba

Please sign in to comment.