back
terraform {
required_providers {
kubernetes = ">= 2.0.3"
}
}
top
module "kubernetes_pod" {
source = "./modules/kubernetes/d/kubernetes_pod"
metadata = [{
annotations = {}
generate_name = null
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)
generate_name = string
generation = number
labels = map(string)
name = string
namespace = string
resource_version = string
self_link = string
uid = string
}
))
}
top
data "kubernetes_pod" "this" {
dynamic "metadata" {
for_each = var.metadata
content {
# annotations - (optional) is a type of map of string
annotations = metadata.value["annotations"]
# generate_name - (optional) is a type of string
generate_name = metadata.value["generate_name"]
# 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 "id" {
description = "returns a string"
value = data.kubernetes_pod.this.id
}
output "spec" {
description = "returns a list of object"
value = data.kubernetes_pod.this.spec
}
output "status" {
description = "returns a string"
value = data.kubernetes_pod.this.status
}
output "this" {
value = kubernetes_pod.this
}
top