Skip to content
Start here

Resource Sharing

resource cloudflare_share

required Expand Collapse
account_id: String

Account identifier.

name: String

The name of the share.

optional Expand Collapse
excluded_recipients?: List[Attributes]

Accounts to exclude from an organization-targeted share. Only allowed when recipients contains no account entries. The share owner cannot be excluded. Duplicate entries are ignored.

account_id: String

The account to exclude from the organization-targeted share.

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

The account that owns the resource. Must match the account_id in the path.

resource_id: String

Identifier assigned by the service that owns the shared resource.

resource_type: String

Resource Type.

tags?: Map[String]

Tags associated with 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 object 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 object was last 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"
  excluded_recipients = [{
    account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  }]
  recipients = [{
    organization_id = "023e105f4ecef8ad9ca31a8372d0c353"
    recipient_account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  }]
  resources = [{
    meta = {

    }
    resource_account_id = "023e105f4ecef8ad9ca31a8372d0c353"
    resource_id = "0a679032-bbb2-4b7e-9acc-dd5c5cb27a17"
    resource_type = "custom-ruleset"
  }]
  tags = {
    foo = "string"
  }
}

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.

include_tags_from?: String

Include share tags in the response. api reads tags from the tag service; mirror reads a local, eventually consistent replica. If the tag lookup fails, the response omits tags.

filter?: Attributes
direction?: String

Direction to sort objects.

include_tags_from?: String

Include share tags in the response. api reads tags from the tag service; mirror reads a local, eventually consistent replica. If the tag lookup fails, the response omits tags.

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 object 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 object was last modified.

name: String

The name of the share.

organization_id: String

Organization identifier.

status: String
target_type: String
tags: Map[String]

Tags associated with the share. Included in create and update responses when tags are supplied, and in read responses when the include_tags_from parameter is set.

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 object was created.

meta: JSON

Resource Metadata.

modified: Time

When the object was last modified.

resource_account_id: String

Account identifier.

resource_id: String

Identifier assigned by the service that owns the shared resource.

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
  include_tags_from = "api"
}

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.

include_tags_from?: String

Include share tags in the response. api reads tags from the tag service; mirror reads a local, eventually consistent replica. If the tag lookup fails, the response omits tags.

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 object was created.

modified: Time

When the object was last 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 object was created.

meta: JSON

Resource Metadata.

modified: Time

When the object was last modified.

resource_account_id: String

Account identifier.

resource_id: String

Identifier assigned by the service that owns the shared resource.

resource_type: String

Resource Type.

resource_version: Int64

Resource Version.

status: String

Resource Status.

tags: Map[String]

Tags associated with the share. Included in create and update responses when tags are supplied, and in read responses when the include_tags_from parameter is set.

cloudflare_shares

data "cloudflare_shares" "example_shares" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  include_recipient_counts = true
  include_resources = true
  include_tags_from = "api"
  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
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 object was created.

modified: Time

When the object was last modified.

resources: List[Attributes]
error: String

Error from the most recent attempt to apply the resource to the recipient. Empty string when no error has been recorded.

resource_id: String

Identifier assigned by the service that owns the shared resource.

resource_version: Int64

Resource version applied to the recipient, if reconciliation has occurred.

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"
  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 object was created.

modified: Time

When the object was last modified.

resources: List[Attributes]
error: String

Error from the most recent attempt to apply the resource to the recipient. Empty string when no error has been recorded.

resource_id: String

Identifier assigned by the service that owns the shared resource.

resource_version: Int64

Resource version applied to the recipient, if reconciliation has occurred.

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

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 object was created.

modified: Time

When the object was last modified.

resources: List[Attributes]
error: String

Error from the most recent attempt to apply the resource to the recipient. Empty string when no error has been recorded.

resource_id: String

Identifier assigned by the service that owns the shared resource.

resource_version: Int64

Resource version applied to the recipient, if reconciliation has occurred.

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

The account that owns the resource. Must match the account_id in the path.

resource_id: String

Identifier assigned by the service that owns the shared resource.

resource_type: String

Resource Type.

meta: JSON

Resource Metadata.

computed Expand Collapse
id: String

Share Resource identifier.

created: Time

When the object was created.

modified: Time

When the object was last 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 = "0a679032-bbb2-4b7e-9acc-dd5c5cb27a17"
  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 object was created.

modified: Time

When the object was last modified.

resource_account_id: String

Account identifier.

resource_id: String

Identifier assigned by the service that owns the shared resource.

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 object was created.

meta: JSON

Resource Metadata.

modified: Time

When the object was last modified.

resource_account_id: String

Account identifier.

resource_id: String

Identifier assigned by the service that owns the shared resource.

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"
}