back
terraform {
required_providers {
kubernetes = ">= 2.0.3"
}
}
top
module "kubernetes_secret" {
source = "./modules/kubernetes/d/kubernetes_secret"
metadata = [{
annotations = {}
generation = null
labels = {}
name = null
namespace = null
resource_version = null
self_link = null
uid = null
}]
}
top
variable "metadata" {
description = "nested block: NestingList, min items: 1, max items: 1"
type = set(object(
{
annotations = map(string)
generation = number
labels = map(string)
name = string
namespace = string
resource_version = string
self_link = string
uid = string
}
))
}
top
data "kubernetes_secret" "this" {
dynamic "metadata" {
for_each = var.metadata
content {
# annotations - (optional) is a type of map of string
annotations = metadata.value["annotations"]
# labels - (optional) is a type of map of string
labels = metadata.value["labels"]
# name - (optional) is a type of string
name = metadata.value["name"]
# namespace - (optional) is a type of string
namespace = metadata.value["namespace"]
}
}
}
top
output "data" {
description = "returns a map of string"
value = data.kubernetes_secret.this.data
sensitive = true
}
output "id" {
description = "returns a string"
value = data.kubernetes_secret.this.id
}
output "type" {
description = "returns a string"
value = data.kubernetes_secret.this.type
}
output "this" {
value = kubernetes_secret.this
}
top