Skip to content

Commit

Permalink
use dependency blocks again
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Feb 3, 2025
1 parent 5edf84e commit d5c00a2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions lab/_envcommon/helm-provider.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
dependencies {
paths = ["${get_original_terragrunt_dir()}/../eks"]
dependency "eks" {
config_path = "${get_original_terragrunt_dir()}/../eks"
mock_outputs = {
cluster_name = "a-cluster-name"
}
}

inputs = {
Expand All @@ -11,7 +14,6 @@ generate "helm_provider" {
path = "helm-provider.tf"
if_exists = "overwrite_terragrunt"
contents = <<-EOF
%{if "${dependency.eks.outputs.cluster_name}" != "a-cluster-name" ~}
data "aws_eks_cluster" "helm" {
name = "${dependency.eks.outputs.cluster_name}"
}
Expand All @@ -25,6 +27,5 @@ generate "helm_provider" {
token = data.aws_eks_cluster_auth.helm.token
}
}
%{ endif ~}
EOF
}
9 changes: 5 additions & 4 deletions lab/_envcommon/kube-provider.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
dependencies {
paths = ["${get_original_terragrunt_dir()}/../eks"]
dependency "eks" {
config_path = "${get_original_terragrunt_dir()}/../eks"
mock_outputs = {
cluster_name = "a-cluster-name"
}
}

inputs = {
Expand All @@ -11,7 +14,6 @@ generate "kube_provider" {
path = "kube-provider.tf"
if_exists = "overwrite_terragrunt"
contents = <<-EOF
%{if "${dependency.eks.outputs.cluster_name}" != "a-cluster-name" ~}
data "aws_eks_cluster" "kube" {
name = "${dependency.eks.outputs.cluster_name}"
}
Expand All @@ -23,6 +25,5 @@ generate "kube_provider" {
cluster_ca_certificate = base64decode(data.aws_eks_cluster.kube.certificate_authority[0].data)
token = data.aws_eks_cluster_auth.kube.token
}
%{ endif ~}
EOF
}

0 comments on commit d5c00a2

Please sign in to comment.