Skip to content
Start here

KV

KVNamespaces

resource cloudflare_workers_kv_namespace

required Expand Collapse
account_id: String

Identifier.

title: String

A human-readable string name for a Namespace.

computed Expand Collapse
id: String

Namespace identifier tag.

supports_url_encoding: Bool

True if keys written on the URL will be URL-decoded before storing. For example, if set to "true", a key written on the URL as "%3F" will be stored as "?".

cloudflare_workers_kv_namespace

resource "cloudflare_workers_kv_namespace" "example_workers_kv_namespace" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  title = "My Own Namespace"
}

data cloudflare_workers_kv_namespace

required Expand Collapse
account_id: String

Identifier.

optional Expand Collapse
namespace_id?: String

Namespace identifier tag.

filter?: Attributes
direction?: String

Direction to order namespaces.

order?: String

Field to order results by.

computed Expand Collapse
id: String

Namespace identifier tag.

supports_url_encoding: Bool

True if keys written on the URL will be URL-decoded before storing. For example, if set to "true", a key written on the URL as "%3F" will be stored as "?".

title: String

A human-readable string name for a Namespace.

cloudflare_workers_kv_namespace

data "cloudflare_workers_kv_namespace" "example_workers_kv_namespace" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  namespace_id = "0f2ac74b498b48028cb68387c421e279"
}

data cloudflare_workers_kv_namespaces

required Expand Collapse
account_id: String

Identifier.

optional Expand Collapse
direction?: String

Direction to order namespaces.

order?: String

Field to order results by.

max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
result: List[Attributes]

The items returned by the data source

id: String

Namespace identifier tag.

title: String

A human-readable string name for a Namespace.

supports_url_encoding: Bool

True if keys written on the URL will be URL-decoded before storing. For example, if set to "true", a key written on the URL as "%3F" will be stored as "?".

cloudflare_workers_kv_namespaces

data "cloudflare_workers_kv_namespaces" "example_workers_kv_namespaces" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  direction = "asc"
  order = "id"
}

KVNamespacesValues

resource cloudflare_workers_kv

required Expand Collapse
key_name: String

A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.

account_id: String

Identifier.

namespace_id: String

Namespace identifier tag.

value: String

A byte sequence to be stored, up to 25 MiB in length.

optional Expand Collapse
metadata?: JSON

Associates arbitrary JSON data with a key/value pair.

computed Expand Collapse
id: String

A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.

cloudflare_workers_kv

resource "cloudflare_workers_kv" "example_workers_kv" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  namespace_id = "0f2ac74b498b48028cb68387c421e279"
  key_name = "My-Key"
  value = "Some Value"
  metadata = {

  }
}

data cloudflare_workers_kv

required Expand Collapse
key_name: String

A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.

account_id: String

Identifier.

namespace_id: String

Namespace identifier tag.

computed Expand Collapse
id: String

A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.

value: JSON

cloudflare_workers_kv

data "cloudflare_workers_kv" "example_workers_kv" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  namespace_id = "0f2ac74b498b48028cb68387c421e279"
  key_name = "My-Key"
}