Skip to content

Files

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Latest commit

Jul 29, 2022
b10fb1c · Jul 29, 2022

History

History
76 lines (55 loc) · 1.97 KB

metadata.md

File metadata and controls

76 lines (55 loc) · 1.97 KB
page_title subcategory description
coder_metadata Resource - terraform-provider-coder
Use this resource to attach key/value pairs to a resource. They will be displayed in the Coder dashboard.

coder_metadata (Resource)

Use this resource to attach key/value pairs to a resource. They will be displayed in the Coder dashboard.

Example Usage

data "coder_workspace" "me" {
}

resource "kubernetes_pod" "dev" {
  count = data.coder_workspace.me.start_count
}

resource "tls_private_key" "example_key_pair" {
  algorithm = "ECDSA"
  ecdsa_curve = "P256"
}

resource "coder_metadata" "pod_info" {
  count = data.coder_workspace.me.start_count
  resource_id = kubernetes_pod.dev[0].id
  pair {
    key = "description"
    value = "This description will show up in the Coder dashboard."
  }
  pair {
    key = "pod_uid"
    value = kubernetes_pod.dev[0].uid
  }
  pair {
    key = "public_key"
    value = tls_private_key.example_key_pair.public_key_openssh
     # The value of this item will be hidden from view by default
    sensitive = true
  }
}

Schema

Required

  • pair (Block List, Min: 1) Each "pair" block defines a single key/value metadata pair. (see below for nested schema)
  • resource_id (String) The "id" property of another resource that metadata should be attached to.

Read-Only

  • id (String) The ID of this resource.

Nested Schema for pair

Required:

  • key (String) The key of this metadata item.

Optional:

  • sensitive (Boolean) Set to "true" to for items such as API keys whose values should be hidden from view by default. Note that this does not prevent metadata from being retrieved using the API, so it is not suitable for secrets that should not be exposed to workspace users.
  • value (String) The value of this metadata item.

Read-Only:

  • is_null (Boolean)