» kubernetes_config_map

The resource provides mechanisms to inject containers with configuration data while keeping containers agnostic of Kubernetes. Config Map can be used to store fine-grained information like individual properties or coarse-grained information like entire config files or JSON blobs.

» Example Usage

resource "kubernetes_config_map" "example" {
  metadata {
    name = "my-config"

  data {
    api_host = "myhost:443"
    db_host  = "dbhost:5432"
  data {
    my_config_file.yml = "${file("${path.module}/my_config_file.yml")}"

» Argument Reference

The following arguments are supported:

» Nested Blocks

» metadata

» Arguments

  • annotations - (Optional) An unstructured key value map stored with the config map that may be used to store arbitrary metadata. For more info see Kubernetes reference
  • generate_name - (Optional) Prefix, used by the server, to generate a unique name ONLY IF the name field has not been provided. This value will also be combined with a unique suffix. For more info see Kubernetes reference
  • labels - (Optional) Map of string keys and values that can be used to organize and categorize (scope and select) the config map. May match selectors of replication controllers and services. For more info see Kubernetes reference
  • name - (Optional) Name of the config map, must be unique. Cannot be updated. For more info see Kubernetes reference
  • namespace - (Optional) Namespace defines the space within which name of the config map must be unique.

» Attributes

  • generation - A sequence number representing a specific generation of the desired state.
  • resource_version - An opaque value that represents the internal version of this config map that can be used by clients to determine when config map has changed. For more info see Kubernetes reference
  • self_link - A URL representing this config map.
  • uid - The unique in time and space value for this config map. For more info see Kubernetes reference

» Import

Config Map can be imported using its namespace and name, e.g.

$ terraform import kubernetes_config_map.example default/my-config