Skip to content

Instantly share code, notes, and snippets.

@steven-terrana
Created September 30, 2020 17:06
Show Gist options
  • Save steven-terrana/57278ea75744c435466be0f8ef739c95 to your computer and use it in GitHub Desktop.
Save steven-terrana/57278ea75744c435466be0f8ef739c95 to your computer and use it in GitHub Desktop.
use outputs from co-created resources with kubernetes-alpha provider
apiVersion: v1
kind: ConfigMap
metadata:
name: test-config-${int}
namespace: default
data:
something: "value"
provider "kubernetes-alpha"{
config_path = "~/.kube/config"
}
resource "random_integer" "priority" {
min = 1
max = 50000
}
resource "kubernetes_manifest" "test-configmap" {
provider = kubernetes-alpha
manifest = yamldecode(templatefile("application.yaml", { int: random_integer.priority.result }))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment