---
title: Resource Sharing
---

[Skip to content](#%5Ftop) 

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

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# Resource Sharing

#### resource cloudflare\_share

##### required Expand Collapse 

account\_id: String

Account identifier.

recipients: List\[Attributes\]

Deprecatedaccount\_id?: String

This field has been renamed to `recipient_account_id`. Both names are accepted during the deprecation period.

Deprecated alias for `recipient_account_id`. Use `recipient_account_id` instead. The body field collided with the URL path parameter of the same name, which prevented SDK generators from distinguishing the source account (in the URL) from the recipient account (in the body). Both names will continue to be accepted until 2027-05-26 (see `x-sunset`).

organization\_id?: String

Organization identifier.

recipient\_account\_id?: String

The account that will receive the share.

resources: List\[Attributes\]

meta: JSON

Resource Metadata.

resource\_account\_id: String

Account identifier.

resource\_id: String

Share Resource identifier.

resource\_type: String

Resource Type.

name: String

The name of the share.

##### computed Expand Collapse 

id: String

Share identifier tag.

account\_name: String

The display name of an account.

associated\_recipient\_count: Int64

The number of recipients in the ‘associated’ state. This field is only included when requested via the ‘include\_recipient\_counts’ parameter.

associating\_recipient\_count: Int64

The number of recipients in the ‘associating’ state. This field is only included when requested via the ‘include\_recipient\_counts’ parameter.

created: Time

When the share was created.

disassociated\_recipient\_count: Int64

The number of recipients in the ‘disassociated’ state. This field is only included when requested via the ‘include\_recipient\_counts’ parameter.

disassociating\_recipient\_count: Int64

The number of recipients in the ‘disassociating’ state. This field is only included when requested via the ‘include\_recipient\_counts’ parameter.

kind: String

modified: Time

When the share was modified.

organization\_id: String

Organization identifier.

status: String

target\_type: String

### cloudflare\_share

Terraform

HTTPHTTP

TypeScriptTypeScript

PythonPython

GoGo

TerraformTerraform

```
resource "cloudflare_share" "example_share" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  name = "My Shared WAF Managed Rule"
  recipients = [{
    organization_id = "023e105f4ecef8ad9ca31a8372d0c353"
    recipient_account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  }]
  resources = [{
    meta = {

    }
    resource_account_id = "023e105f4ecef8ad9ca31a8372d0c353"
    resource_id = "023e105f4ecef8ad9ca31a8372d0c353"
    resource_type = "custom-ruleset"
  }]
}

```

#### data cloudflare\_share

##### required Expand Collapse 

account\_id: String

Account identifier.

##### optional Expand Collapse 

share\_id?: String

Share identifier tag.

include\_recipient\_counts?: Bool

Include recipient counts in the response.

include\_resources?: Bool

Include resources in the response.

filter?: Attributes

direction?: String

Direction to sort objects.

kind?: String

Filter shares by kind.

order?: String

Order shares by values in the given field.

resource\_types?: List\[String\]

Filter share resources by resource\_types.

status?: String

Filter shares by status.

tag?: List\[String\]

Filter shares by tag. Each value is either `key=value` (matches shares whose tags contain that key/value pair) or `key` alone (matches shares that have any value for that key). May be repeated; multiple `tag` parameters are ANDed together. Maximum 20 `tag` parameters per request.

target\_type?: String

Filter shares by target\_type.

##### computed Expand Collapse 

id: String

Share identifier tag.

account\_name: String

The display name of an account.

associated\_recipient\_count: Int64

The number of recipients in the ‘associated’ state. This field is only included when requested via the ‘include\_recipient\_counts’ parameter.

associating\_recipient\_count: Int64

The number of recipients in the ‘associating’ state. This field is only included when requested via the ‘include\_recipient\_counts’ parameter.

created: Time

When the share was created.

disassociated\_recipient\_count: Int64

The number of recipients in the ‘disassociated’ state. This field is only included when requested via the ‘include\_recipient\_counts’ parameter.

disassociating\_recipient\_count: Int64

The number of recipients in the ‘disassociating’ state. This field is only included when requested via the ‘include\_recipient\_counts’ parameter.

kind: String

modified: Time

When the share was modified.

name: String

The name of the share.

organization\_id: String

Organization identifier.

status: String

target\_type: String

resources: List\[Attributes\]

A list of resources that are part of the share. This field is only included when requested via the ‘include\_resources’ parameter.

id: String

Share Resource identifier.

created: Time

When the share was created.

meta: JSON

Resource Metadata.

modified: Time

When the share was modified.

resource\_account\_id: String

Account identifier.

resource\_id: String

Share Resource identifier.

resource\_type: String

Resource Type.

resource\_version: Int64

Resource Version.

status: String

Resource Status.

### cloudflare\_share

Terraform

HTTPHTTP

TypeScriptTypeScript

PythonPython

GoGo

TerraformTerraform

```
data "cloudflare_share" "example_share" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  share_id = "3fd85f74b32742f1bff64a85009dda07"
  include_recipient_counts = true
  include_resources = true
}

```

#### data cloudflare\_shares

##### required Expand Collapse 

account\_id: String

Account identifier.

##### optional Expand Collapse 

include\_recipient\_counts?: Bool

Include recipient counts in the response.

include\_resources?: Bool

Include resources in the response.

kind?: String

Filter shares by kind.

status?: String

Filter shares by status.

target\_type?: String

Filter shares by target\_type.

resource\_types?: List\[String\]

Filter share resources by resource\_types.

tag?: List\[String\]

Filter shares by tag. Each value is either `key=value` (matches shares whose tags contain that key/value pair) or `key` alone (matches shares that have any value for that key). May be repeated; multiple `tag` parameters are ANDed together. Maximum 20 `tag` parameters per request.

direction?: String

Direction to sort objects.

order?: String

Order shares by values in the given field.

max\_items?: Int64

Max items to fetch, default: 1000

##### computed Expand Collapse 

result: List\[Attributes\]

The items returned by the data source

id: String

Share identifier tag.

account\_id: String

Account identifier.

account\_name: String

The display name of an account.

created: Time

When the share was created.

modified: Time

When the share was modified.

name: String

The name of the share.

organization\_id: String

Organization identifier.

status: String

target\_type: String

associated\_recipient\_count: Int64

The number of recipients in the ‘associated’ state. This field is only included when requested via the ‘include\_recipient\_counts’ parameter.

associating\_recipient\_count: Int64

The number of recipients in the ‘associating’ state. This field is only included when requested via the ‘include\_recipient\_counts’ parameter.

disassociated\_recipient\_count: Int64

The number of recipients in the ‘disassociated’ state. This field is only included when requested via the ‘include\_recipient\_counts’ parameter.

disassociating\_recipient\_count: Int64

The number of recipients in the ‘disassociating’ state. This field is only included when requested via the ‘include\_recipient\_counts’ parameter.

kind: String

resources: List\[Attributes\]

A list of resources that are part of the share. This field is only included when requested via the ‘include\_resources’ parameter.

id: String

Share Resource identifier.

created: Time

When the share was created.

meta: JSON

Resource Metadata.

modified: Time

When the share was modified.

resource\_account\_id: String

Account identifier.

resource\_id: String

Share Resource identifier.

resource\_type: String

Resource Type.

resource\_version: Int64

Resource Version.

status: String

Resource Status.

### cloudflare\_shares

Terraform

HTTPHTTP

TypeScriptTypeScript

PythonPython

GoGo

TerraformTerraform

```
data "cloudflare_shares" "example_shares" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  include_recipient_counts = true
  include_resources = true
  kind = "sent"
  resource_types = ["custom-ruleset"]
  status = "active"
  tag = ["env=production"]
  target_type = "account"
}

```

#### Resource SharingRecipients

#### resource cloudflare\_share\_recipient

##### required Expand Collapse 

share\_id: String

Share identifier tag.

Deprecatedaccount\_id: String

This field has been renamed to `recipient_account_id`. Both names are accepted during the deprecation period.

Deprecated alias for `recipient_account_id`. Use `recipient_account_id` instead. The body field collided with the URL path parameter of the same name, which prevented SDK generators from distinguishing the source account (in the URL) from the recipient account (in the body). Both names will continue to be accepted until 2027-05-26 (see `x-sunset`).

##### optional Expand Collapse 

organization\_id?: String

Organization identifier.

recipient\_account\_id?: String

The account that will receive the share.

##### computed Expand Collapse 

id: String

Share Recipient identifier tag.

association\_status: String

The current state of the recipient relative to the share. The `desired_association_status` (not exposed in the response) tracks the target state set by the API; the background reconciliation workflow drives `current_association_status` toward it.

* `associating` — The recipient was recently added; the workflow is pushing shared resources into the recipient account.
* `associated` — Shared resources have been successfully applied to the recipient account.
* `disassociating` — The recipient was removed (via DELETE or PUT replacement); the workflow is removing shared resources from the recipient account.
* `disassociated` — Shared resources have been removed from the recipient account. The recipient record remains in the database.

created: Time

When the share was created.

modified: Time

When the share was modified.

resources: List\[Attributes\]

error: String

Share Recipient error message.

resource\_id: String

Share Resource identifier.

resource\_version: Int64

Resource Version.

terminal: Bool

Whether the error is terminal or will be continually retried.

### cloudflare\_share\_recipient

Terraform

HTTPHTTP

TypeScriptTypeScript

PythonPython

GoGo

TerraformTerraform

```
resource "cloudflare_share_recipient" "example_share_recipient" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  share_id = "3fd85f74b32742f1bff64a85009dda07"
  organization_id = "023e105f4ecef8ad9ca31a8372d0c353"
  recipient_account_id = "023e105f4ecef8ad9ca31a8372d0c353"
}

```

#### data cloudflare\_share\_recipient

##### required Expand Collapse 

recipient\_id: String

Share Recipient identifier tag.

account\_id: String

Account identifier.

share\_id: String

Share identifier tag.

##### optional Expand Collapse 

include\_resources?: Bool

Include resources in the response.

##### computed Expand Collapse 

id: String

Share Recipient identifier tag.

association\_status: String

The current state of the recipient relative to the share. The `desired_association_status` (not exposed in the response) tracks the target state set by the API; the background reconciliation workflow drives `current_association_status` toward it.

* `associating` — The recipient was recently added; the workflow is pushing shared resources into the recipient account.
* `associated` — Shared resources have been successfully applied to the recipient account.
* `disassociating` — The recipient was removed (via DELETE or PUT replacement); the workflow is removing shared resources from the recipient account.
* `disassociated` — Shared resources have been removed from the recipient account. The recipient record remains in the database.

created: Time

When the share was created.

modified: Time

When the share was modified.

resources: List\[Attributes\]

error: String

Share Recipient error message.

resource\_id: String

Share Resource identifier.

resource\_version: Int64

Resource Version.

terminal: Bool

Whether the error is terminal or will be continually retried.

### cloudflare\_share\_recipient

Terraform

HTTPHTTP

TypeScriptTypeScript

PythonPython

GoGo

TerraformTerraform

```
data "cloudflare_share_recipient" "example_share_recipient" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  share_id = "3fd85f74b32742f1bff64a85009dda07"
  recipient_id = "3fd85f74b32742f1bff64a85009dda07"
  include_resources = true
}

```

#### data cloudflare\_share\_recipients

##### required Expand Collapse 

account\_id: String

Account identifier.

share\_id: String

Share identifier tag.

##### optional Expand Collapse 

include\_resources?: Bool

Include resources in the response.

max\_items?: Int64

Max items to fetch, default: 1000

##### computed Expand Collapse 

result: List\[Attributes\]

The items returned by the data source

id: String

Share Recipient identifier tag.

account\_id: String

Account identifier.

association\_status: String

The current state of the recipient relative to the share. The `desired_association_status` (not exposed in the response) tracks the target state set by the API; the background reconciliation workflow drives `current_association_status` toward it.

* `associating` — The recipient was recently added; the workflow is pushing shared resources into the recipient account.
* `associated` — Shared resources have been successfully applied to the recipient account.
* `disassociating` — The recipient was removed (via DELETE or PUT replacement); the workflow is removing shared resources from the recipient account.
* `disassociated` — Shared resources have been removed from the recipient account. The recipient record remains in the database.

created: Time

When the share was created.

modified: Time

When the share was modified.

resources: List\[Attributes\]

error: String

Share Recipient error message.

resource\_id: String

Share Resource identifier.

resource\_version: Int64

Resource Version.

terminal: Bool

Whether the error is terminal or will be continually retried.

### cloudflare\_share\_recipients

Terraform

HTTPHTTP

TypeScriptTypeScript

PythonPython

GoGo

TerraformTerraform

```
data "cloudflare_share_recipients" "example_share_recipients" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  share_id = "3fd85f74b32742f1bff64a85009dda07"
  include_resources = true
}

```

#### Resource SharingResources

#### resource cloudflare\_share\_resource

##### required Expand Collapse 

account\_id: String

Account identifier.

share\_id: String

Share identifier tag.

resource\_account\_id: String

Account identifier.

resource\_id: String

Share Resource identifier.

resource\_type: String

Resource Type.

meta: JSON

Resource Metadata.

##### computed Expand Collapse 

id: String

Share Resource identifier.

created: Time

When the share was created.

modified: Time

When the share was modified.

resource\_version: Int64

Resource Version.

status: String

Resource Status.

### cloudflare\_share\_resource

Terraform

HTTPHTTP

TypeScriptTypeScript

PythonPython

GoGo

TerraformTerraform

```
resource "cloudflare_share_resource" "example_share_resource" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  share_id = "3fd85f74b32742f1bff64a85009dda07"
  meta = {

  }
  resource_account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  resource_id = "023e105f4ecef8ad9ca31a8372d0c353"
  resource_type = "custom-ruleset"
}

```

#### data cloudflare\_share\_resource

##### required Expand Collapse 

account\_id: String

Account identifier.

share\_id: String

Share identifier tag.

##### optional Expand Collapse 

share\_resource\_id?: String

Share Resource identifier.

filter?: Attributes

resource\_type?: String

Filter share resources by resource\_type.

status?: String

Filter share resources by status.

##### computed Expand Collapse 

id: String

Share Resource identifier.

created: Time

When the share was created.

modified: Time

When the share was modified.

resource\_account\_id: String

Account identifier.

resource\_id: String

Share Resource identifier.

resource\_type: String

Resource Type.

resource\_version: Int64

Resource Version.

status: String

Resource Status.

meta: JSON

Resource Metadata.

### cloudflare\_share\_resource

Terraform

HTTPHTTP

TypeScriptTypeScript

PythonPython

GoGo

TerraformTerraform

```
data "cloudflare_share_resource" "example_share_resource" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  share_id = "3fd85f74b32742f1bff64a85009dda07"
  share_resource_id = "023e105f4ecef8ad9ca31a8372d0c353"
}

```

#### data cloudflare\_share\_resources

##### required Expand Collapse 

account\_id: String

Account identifier.

share\_id: String

Share identifier tag.

##### optional Expand Collapse 

resource\_type?: String

Filter share resources by resource\_type.

status?: String

Filter share resources by status.

max\_items?: Int64

Max items to fetch, default: 1000

##### computed Expand Collapse 

result: List\[Attributes\]

The items returned by the data source

id: String

Share Resource identifier.

created: Time

When the share was created.

meta: JSON

Resource Metadata.

modified: Time

When the share was modified.

resource\_account\_id: String

Account identifier.

resource\_id: String

Share Resource identifier.

resource\_type: String

Resource Type.

resource\_version: Int64

Resource Version.

status: String

Resource Status.

### cloudflare\_share\_resources

Terraform

HTTPHTTP

TypeScriptTypeScript

PythonPython

GoGo

TerraformTerraform

```
data "cloudflare_share_resources" "example_share_resources" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  share_id = "3fd85f74b32742f1bff64a85009dda07"
  resource_type = "custom-ruleset"
  status = "active"
}

```