avx-pmarie-aws-infra/infra/eks-aws-auth/terragrunt.hcl
2022-07-01 14:12:11 +02:00

50 lines
1.5 KiB
HCL

include "root" {
path = find_in_parent_folders()
}
terraform {
source = "${get_repo_root()}//modules/eks-auth"
}
dependency "eks" {
config_path = "../eks"
# Configure mock outputs for the `validate` and `plan` commands that are returned when there are no outputs available
# (e.g the module hasn't been applied yet)
mock_outputs_allowed_terraform_commands = ["validate", "plan"]
mock_outputs = {
aws_auth_configmap_yaml = <<EOT
apiVersion: v1
kind: ConfigMap
metadata:
name: aws-auth
namespace: kube-system
data:
mapRoles: |
- rolearn: arn:aws:iam::505686222560:role/aviatrix-dev-node-group-20220309105644518100000003
username: system:node:{{EC2PrivateDNSName}}
groups:
- system:bootstrappers
- system:nodes
EOT
cluster_id = "fake-cluster-id"
cluster_endpoint = "https://fake-cluster-endpoint.eks.amazonaws.com"
cluster_certificate_authority_data = "ZmFrZS1jYS1jZXJ0LWRhdGE="
}
}
locals {
config_vars = read_terragrunt_config(find_in_parent_folders("config.hcl"))
}
generate = local.config_vars.generate
inputs = {
aws_auth_configmap_yaml = dependency.eks.outputs.aws_auth_configmap_yaml
cluster_id = dependency.eks.outputs.cluster_id
cluster_endpoint = dependency.eks.outputs.cluster_endpoint
cluster_certificate_authority_data = dependency.eks.outputs.cluster_certificate_authority_data
aws_auth_additional_roles = local.config_vars.locals.eks_aws_auth_additional_roles
}