---
title: Secrets Store
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/terraform)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Secrets Store

#### Secrets StoreStores

#### resource cloudflare\_secrets\_store

##### required Expand Collapse

account\_id: String

[Link to this property](<#(resource)%20secrets_store.stores%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20account_id>)

name: String

The name of the store.

[Link to this property](<#(resource)%20secrets_store.stores%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20name>)

##### computed Expand Collapse

id: String

Store Identifier.

[Link to this property](<#(resource)%20secrets_store.stores%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20id>)

created: Time

When the secret was created.

[Link to this property](<#(resource)%20secrets_store.stores%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20created>)

modified: Time

When the secret was modified.

[Link to this property](<#(resource)%20secrets_store.stores%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20modified>)

### cloudflare\_secrets\_store

Terraform

HTTPTypeScriptPythonGoTerraform

```
resource "cloudflare_secrets_store" "example_secrets_store" {
  account_id = "985e105f4ecef8ad9ca31a8372d0c353"
  name = "service_x_keys"
}
```

#### data cloudflare\_secrets\_store

##### required Expand Collapse

account\_id: String

[Link to this property](<#(resource)%20secrets_store.stores%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20account_id>)

##### optional Expand Collapse

store\_id?: String

[Link to this property](<#(resource)%20secrets_store.stores%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20store_id>)

<details>

<summary>

filter?: Attributes

</summary>

direction?: String

Direction to sort objects.

<a href="#(resource)%20secrets_store.stores%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20filter%20%3E%20(attribute)%20direction">Link to this property</a>

order?: String

Order stores by values in the given field.

<a href="#(resource)%20secrets_store.stores%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20filter%20%3E%20(attribute)%20order">Link to this property</a>

</details>

[Link to this property](<#(resource)%20secrets_store.stores%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20filter>)

##### computed Expand Collapse

id: String

[Link to this property](<#(resource)%20secrets_store.stores%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20id>)

created: Time

When the secret was created.

[Link to this property](<#(resource)%20secrets_store.stores%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20created>)

modified: Time

When the secret was modified.

[Link to this property](<#(resource)%20secrets_store.stores%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20modified>)

name: String

The name of the store.

[Link to this property](<#(resource)%20secrets_store.stores%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20name>)

### cloudflare\_secrets\_store

Terraform

HTTPTypeScriptPythonGoTerraform

```
data "cloudflare_secrets_store" "example_secrets_store" {
  account_id = "985e105f4ecef8ad9ca31a8372d0c353"
  store_id = "023e105f4ecef8ad9ca31a8372d0c353"
}
```

#### data cloudflare\_secrets\_stores

##### required Expand Collapse

account\_id: String

[Link to this property](<#(resource)%20secrets_store.stores%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20account_id>)

##### optional Expand Collapse

direction?: String

Direction to sort objects.

[Link to this property](<#(resource)%20secrets_store.stores%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20direction>)

order?: String

Order stores by values in the given field.

[Link to this property](<#(resource)%20secrets_store.stores%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20order>)

max\_items?: Int64

Max items to fetch, default: 1000

[Link to this property](<#(resource)%20secrets_store.stores%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20max_items>)

##### computed Expand Collapse

<details>

<summary>

result: List\[Attributes]

The items returned by the data source

</summary>

id: String

Store Identifier.

<a href="#(resource)%20secrets_store.stores%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20id">Link to this property</a>

created: Time

When the secret was created.

<a href="#(resource)%20secrets_store.stores%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20created">Link to this property</a>

modified: Time

When the secret was modified.

<a href="#(resource)%20secrets_store.stores%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20modified">Link to this property</a>

name: String

The name of the store.

<a href="#(resource)%20secrets_store.stores%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20name">Link to this property</a>

account\_id: String

Account Identifier.

<a href="#(resource)%20secrets_store.stores%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20account_id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20secrets_store.stores%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result>)

### cloudflare\_secrets\_stores

Terraform

HTTPTypeScriptPythonGoTerraform

```
data "cloudflare_secrets_stores" "example_secrets_stores" {
  account_id = "985e105f4ecef8ad9ca31a8372d0c353"
}
```

#### Secrets StoreStoresSecrets

#### resource cloudflare\_secrets\_store\_secret

##### required Expand Collapse

account\_id: String

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20account_id>)

store\_id: String

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20store_id>)

<details>

<summary>

body: List\[Attributes]

</summary>

name: String

The name of the secret.

<a href="#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20body%20%3E%20(attribute)%20name">Link to this property</a>

scopes: List\[String]

The list of services that can use this secret.

<a href="#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20body%20%3E%20(attribute)%20scopes">Link to this property</a>

value: String

The value of the secret. Maximum 64 KiB (65,536 bytes). Note that this is ‘write only’ - the API never returns this value; it exists only to create or modify secrets.

<a href="#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20body%20%3E%20(attribute)%20value">Link to this property</a>

comment?: String

Freeform text describing the secret.

<a href="#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20body%20%3E%20(attribute)%20comment">Link to this property</a>

</details>

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20body>)

##### optional Expand Collapse

comment?: String

Freeform text describing the secret.

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20comment>)

value?: String

The value of the secret. Maximum 64 KiB (65,536 bytes). Note that this is ‘write only’ - the API never returns this value; it exists only to create or modify secrets.

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20value>)

scopes?: List\[String]

The list of services that can use this secret.

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20scopes>)

##### computed Expand Collapse

id: String

Secret identifier tag.

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20id>)

created: Time

When the secret was created.

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20created>)

modified: Time

When the secret was modified.

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20modified>)

name: String

The name of the secret.

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20name>)

status: String

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20status>)

### cloudflare\_secrets\_store\_secret

Terraform

HTTPTypeScriptPythonGoTerraform

```
resource "cloudflare_secrets_store_secret" "example_secrets_store_secret" {
  account_id = "985e105f4ecef8ad9ca31a8372d0c353"
  store_id = "023e105f4ecef8ad9ca31a8372d0c353"
}
```

#### data cloudflare\_secrets\_store\_secret

##### required Expand Collapse

account\_id: String

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20account_id>)

store\_id: String

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20store_id>)

##### optional Expand Collapse

secret\_id?: String

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20secret_id>)

<details>

<summary>

filter?: Attributes

</summary>

direction?: String

Direction to sort objects.

<a href="#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20filter%20%3E%20(attribute)%20direction">Link to this property</a>

order?: String

Order secrets by values in the given field.

<a href="#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20filter%20%3E%20(attribute)%20order">Link to this property</a>

scopes?: List\[String]

Only secrets with the given scopes will be returned.

<a href="#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20filter%20%3E%20(attribute)%20scopes">Link to this property</a>

search?: String

Search secrets using a filter string, filtering across name and comment.

<a href="#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20filter%20%3E%20(attribute)%20search">Link to this property</a>

</details>

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20filter>)

##### computed Expand Collapse

id: String

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20id>)

comment: String

Freeform text describing the secret.

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20comment>)

created: Time

When the secret was created.

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20created>)

modified: Time

When the secret was modified.

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20modified>)

name: String

The name of the secret.

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20name>)

status: String

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20status>)

scopes: List\[String]

The list of services that can use this secret.

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20scopes>)

### cloudflare\_secrets\_store\_secret

Terraform

HTTPTypeScriptPythonGoTerraform

```
data "cloudflare_secrets_store_secret" "example_secrets_store_secret" {
  account_id = "985e105f4ecef8ad9ca31a8372d0c353"
  store_id = "023e105f4ecef8ad9ca31a8372d0c353"
  secret_id = "3fd85f74b32742f1bff64a85009dda07"
}
```

#### data cloudflare\_secrets\_store\_secrets

##### required Expand Collapse

account\_id: String

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20account_id>)

store\_id: String

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20store_id>)

##### optional Expand Collapse

search?: String

Search secrets using a filter string, filtering across name and comment.

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20search>)

scopes?: List\[String]

Only secrets with the given scopes will be returned.

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20scopes>)

direction?: String

Direction to sort objects.

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20direction>)

order?: String

Order secrets by values in the given field.

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20order>)

max\_items?: Int64

Max items to fetch, default: 1000

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20max_items>)

##### computed Expand Collapse

<details>

<summary>

result: List\[Attributes]

The items returned by the data source

</summary>

id: String

Secret identifier tag.

<a href="#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20id">Link to this property</a>

created: Time

When the secret was created.

<a href="#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20created">Link to this property</a>

modified: Time

When the secret was modified.

<a href="#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20modified">Link to this property</a>

name: String

The name of the secret.

<a href="#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20name">Link to this property</a>

status: String

<a href="#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20status">Link to this property</a>

store\_id: String

Store Identifier.

<a href="#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20store_id">Link to this property</a>

comment: String

Freeform text describing the secret.

<a href="#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20comment">Link to this property</a>

scopes: List\[String]

The list of services that can use this secret.

<a href="#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20scopes">Link to this property</a>

</details>

[Link to this property](<#(resource)%20secrets_store.stores.secrets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result>)

### cloudflare\_secrets\_store\_secrets

Terraform

HTTPTypeScriptPythonGoTerraform

```
data "cloudflare_secrets_store_secrets" "example_secrets_store_secrets" {
  account_id = "985e105f4ecef8ad9ca31a8372d0c353"
  store_id = "023e105f4ecef8ad9ca31a8372d0c353"
  scopes = ["workers"]
  search = "search"
}
```