Skip to content
Start here

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

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

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

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

Share Recipient association status.

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

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

Share Recipient association status.

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

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

Share Recipient association status.

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

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

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

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

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