Skip to content

Instantly share code, notes, and snippets.

@micahnoland
Last active March 4, 2022 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micahnoland/517da4d27064a5c1e9cfba8ef0f2704a to your computer and use it in GitHub Desktop.
Save micahnoland/517da4d27064a5c1e9cfba8ef0f2704a to your computer and use it in GitHub Desktop.
terraform {
required_providers {
kustomization = {
source = "kbst/kustomization"
version = ">= 0.7.0"
}
}
}
data "kustomization_build" "argo_managed" {
path = "${path.module}/argocd"
}
resource "kustomization_resource" "argo_managed" {
for_each = data.kustomization_build.argo_managed.ids
manifest = data.kustomization_build.argo_managed.manifests[each.value]
}
module "bootstrap_managed" {
source = "./bootstrap_managed"
count = var.managed_cluster_bootstrap ? 1 : 0
/* using count like this will throw an error:
The "for_each" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
*/
cluster_name = local.cluster_name
depends_on = [module.bootstrap_common]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment