Skip to content

Latest commit

 

History

History
106 lines (82 loc) · 1.79 KB

kubernetes_namespace.md

File metadata and controls

106 lines (82 loc) · 1.79 KB

kubernetes_namespace

back

Index

Terraform

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

top

Example Usage

module "kubernetes_namespace" {
  source = "./modules/kubernetes/d/kubernetes_namespace"


  metadata = [{
    annotations      = {}
    generation       = null
    labels           = {}
    name             = 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)
      generation       = number
      labels           = map(string)
      name             = string
      resource_version = string
      self_link        = string
      uid              = string
    }
  ))
}

top

Datasource

data "kubernetes_namespace" "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"]
    }
  }

}

top

Outputs

output "id" {
  description = "returns a string"
  value       = data.kubernetes_namespace.this.id
}

output "spec" {
  description = "returns a list of object"
  value       = data.kubernetes_namespace.this.spec
}

output "this" {
  value = kubernetes_namespace.this
}

top