Skip to content

Latest commit

 

History

History
119 lines (94 loc) · 2.17 KB

kubernetes_pod.md

File metadata and controls

119 lines (94 loc) · 2.17 KB

kubernetes_pod

back

Index

Terraform

terraform {
  required_providers {
    kubernetes = ">= 2.0.3"
  }
}

top

Example Usage

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

Variables

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

Datasource

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

Outputs

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