kubernetes_env

This resource provides a way to manage environment variables in resources that were created outside of Terraform. This resource provides functionality similar to the kubectl set env command.

Example Usage

resource "kubernetes_env" "example" {
  container = "nginx"
  metadata {
    name = "nginx-deployment"
  }

  api_version = "apps/v1"
  kind        = "Deployment"

  env {
    name  = "NGINX_HOST"
    value = "google.com"
  }

  env {
    name  = "NGINX_PORT"
    value = "90"
  }
}

Argument Reference

The following arguments are supported:

Nested Blocks

metadata

Arguments

env

Arguments

value_from

Arguments

config_map_key_ref

Arguments

field_ref

Arguments

resource_field_ref

Arguments

secret_key_ref

Arguments

Import

This resource does not support the import command. As this resource operates on Kubernetes resources that already exist, creating the resource is equivalent to importing it.