Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 1848
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ca8fbfa82d19dca400ec61b8c93392de1acd157860e435419f9a5e9ec8c586e0.yml
openapi_spec_hash: 77d55c70bc3824ac61bd056e2319ee18
configured_endpoints: 1862
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c17ba1999aa95652686a2474ad415475d728e5c831b79be5e540a82887b024a0.yml
openapi_spec_hash: b68c7fcf549383e09823c071b1f2e037
config_hash: 4b8075dcc6a5884435b2e16c80fc020f
1 change: 0 additions & 1 deletion examples/data-sources/cloudflare_api_shield/data-source.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
data "cloudflare_api_shield" "example_api_shield" {
zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
properties = ["auth_id_characteristics"]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
data "cloudflare_notification_policy" "example_notification_policy" {
account_id = "023e105f4ecef8ad9ca31a8372d0c353"
policy_id = "0da2b59e-f118-439d-8097-bdfb215203c9"
policy_id = "0da2b59ef118439d8097bdfb215203c9"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
data "cloudflare_notification_policy_webhooks" "example_notification_policy_webhooks" {
account_id = "023e105f4ecef8ad9ca31a8372d0c353"
webhook_id = "b115d5ec-15c6-41ee-8b76-92c449b5227b"
webhook_id = "b115d5ec15c641ee8b7692c449b5227b"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
data "cloudflare_organization" "example_organization" {
organization_id = "organization_id"
organization_id = "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
data "cloudflare_organization_profile" "example_organization_profile" {
organization_id = "organization_id"
organization_id = "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8"
}
18 changes: 18 additions & 0 deletions examples/data-sources/cloudflare_organizations/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
data "cloudflare_organizations" "example_organizations" {
id = ["a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8"]
containing = {
account = "account"
organization = "organization"
user = "user"
}
name = {
contains = "contains"
ends_with = "endsWith"
starts_with = "startsWith"
}
page_size = 0
page_token = "page_token"
parent = {
id = "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8"
}
}
5 changes: 3 additions & 2 deletions examples/resources/cloudflare_byo_ip_prefix/resource.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
resource "cloudflare_byo_ip_prefix" "example_byo_ip_prefix" {
account_id = "258def64c72dae45f3e4c8516e2111f2"
asn = 209242
asn = 13335
cidr = "192.0.2.0/24"
loa_document_id = "d933b1530bc56c9953cf8ce166da8004"
delegate_loa_creation = true
description = "Internal test prefix"
}
Empty file modified examples/resources/cloudflare_logpull_retention/import.sh
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ resource "cloudflare_magic_transit_connector" "example_magic_transit_connector"
account_id = "023e105f4ecef8ad9ca31a8372d0c353"
device = {
id = "id"
provision_license = true
serial_number = "serial_number"
}
activated = true
Expand Down
7 changes: 4 additions & 3 deletions examples/resources/cloudflare_notification_policy/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ resource "cloudflare_notification_policy" "example_notification_policy" {
enabled = true
mechanisms = {
email = [{
id = "test@example.com"
id = "id"
}]
pagerduty = [{
id = "e8133a15-00a4-4d69-aec1-32f70c51f6e5"
id = "f174e90afafe4643bbbc4a0ed4fc8415"
}]
webhooks = [{
id = "14cc1190-5d2b-4b98-a696-c424cb2ad05f"
id = "f174e90afafe4643bbbc4a0ed4fc8415"
}]
}
name = "SSL Notification Event Policy"
Expand Down Expand Up @@ -57,6 +57,7 @@ resource "cloudflare_notification_policy" "example_notification_policy" {
traffic_exclusions = ["security_events"]
tunnel_id = ["string"]
tunnel_name = ["string"]
type = ["string"]
where = ["string"]
zones = ["string"]
}
Expand Down
2 changes: 1 addition & 1 deletion examples/resources/cloudflare_organization/resource.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "cloudflare_organization" "example_organization" {
name = "name"
parent = {
id = "id"
id = "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8"
}
profile = {
business_address = "business_address"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "cloudflare_organization_profile" "example_organization_profile" {
organization_id = "organization_id"
organization_id = "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8"
business_address = "business_address"
business_email = "business_email"
business_name = "business_name"
Expand Down
32 changes: 24 additions & 8 deletions examples/resources/cloudflare_pages_project/resource.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
resource "cloudflare_pages_project" "example_pages_project" {
account_id = "023e105f4ecef8ad9ca31a8372d0c353"
name = "my-pages-app"
production_branch = "main"
build_config = {
build_caching = true
build_command = "npm run build"
Expand All @@ -15,6 +17,7 @@ resource "cloudflare_pages_project" "example_pages_project" {
project_id = "some-project-id"
}
}
always_use_latest_compatibility_date = false
analytics_engine_datasets = {
ANALYTICS_ENGINE_BINDING = {
dataset = "api_analytics"
Expand All @@ -25,7 +28,8 @@ resource "cloudflare_pages_project" "example_pages_project" {

}
}
compatibility_date = "2022-01-01"
build_image_major_version = 3
compatibility_date = "2025-01-01"
compatibility_flags = ["url_standard"]
d1_databases = {
D1_BINDING = {
Expand All @@ -43,6 +47,7 @@ resource "cloudflare_pages_project" "example_pages_project" {
value = "hello world"
}
}
fail_open = true
hyperdrive_bindings = {
HYPERDRIVE = {
id = "a76a99bc342644deb02c38d66082262a"
Expand All @@ -53,6 +58,9 @@ resource "cloudflare_pages_project" "example_pages_project" {
namespace_id = "5eb63bbbe01eeed093cb22bb8f5acdc3"
}
}
limits = {
cpu_ms = 100
}
mtls_certificates = {
MTLS = {
certificate_id = "d7cdd17c-916f-4cb7-aabe-585eb382ec4e"
Expand All @@ -79,18 +87,21 @@ resource "cloudflare_pages_project" "example_pages_project" {
service = "example-worker"
}
}
usage_model = "standard"
vectorize_bindings = {
VECTORIZE = {
index_name = "my_index"
}
}
wrangler_config_hash = "abc123def456"
}
production = {
ai_bindings = {
AI_BINDING = {
project_id = "some-project-id"
}
}
always_use_latest_compatibility_date = false
analytics_engine_datasets = {
ANALYTICS_ENGINE_BINDING = {
dataset = "api_analytics"
Expand All @@ -101,7 +112,8 @@ resource "cloudflare_pages_project" "example_pages_project" {

}
}
compatibility_date = "2022-01-01"
build_image_major_version = 3
compatibility_date = "2025-01-01"
compatibility_flags = ["url_standard"]
d1_databases = {
D1_BINDING = {
Expand All @@ -119,6 +131,7 @@ resource "cloudflare_pages_project" "example_pages_project" {
value = "hello world"
}
}
fail_open = true
hyperdrive_bindings = {
HYPERDRIVE = {
id = "a76a99bc342644deb02c38d66082262a"
Expand All @@ -129,6 +142,9 @@ resource "cloudflare_pages_project" "example_pages_project" {
namespace_id = "5eb63bbbe01eeed093cb22bb8f5acdc3"
}
}
limits = {
cpu_ms = 100
}
mtls_certificates = {
MTLS = {
certificate_id = "d7cdd17c-916f-4cb7-aabe-585eb382ec4e"
Expand All @@ -155,29 +171,29 @@ resource "cloudflare_pages_project" "example_pages_project" {
service = "example-worker"
}
}
usage_model = "standard"
vectorize_bindings = {
VECTORIZE = {
index_name = "my_index"
}
}
wrangler_config_hash = "abc123def456"
}
}
name = "NextJS Blog"
production_branch = "main"
source = {
config = {
deployments_enabled = true
owner = "owner"
owner = "my-org"
path_excludes = ["string"]
path_includes = ["string"]
pr_comments_enabled = true
preview_branch_excludes = ["string"]
preview_branch_includes = ["string"]
preview_deployment_setting = "all"
production_branch = "production_branch"
production_branch = "main"
production_deployments_enabled = true
repo_name = "repo_name"
repo_name = "my-repo"
}
type = "type"
type = "github"
}
}
1 change: 1 addition & 0 deletions examples/resources/cloudflare_sso_connector/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ resource "cloudflare_sso_connector" "example_sso_connector" {
account_id = "023e105f4ecef8ad9ca31a8372d0c353"
email_domain = "example.com"
begin_verification = true
use_fedramp_language = false
}
Empty file modified examples/resources/cloudflare_workflow/import.sh
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ resource "cloudflare_zero_trust_tunnel_cloudflared_config" "example_zero_trust_t
http_host_header = "httpHostHeader"
keep_alive_connections = 100
keep_alive_timeout = 90
match_sn_ito_host = false
no_happy_eyeballs = false
no_tls_verify = false
origin_server_name = "originServerName"
Expand All @@ -40,6 +41,7 @@ resource "cloudflare_zero_trust_tunnel_cloudflared_config" "example_zero_trust_t
http_host_header = "httpHostHeader"
keep_alive_connections = 100
keep_alive_timeout = 90
match_sn_ito_host = false
no_happy_eyeballs = false
no_tls_verify = false
origin_server_name = "originServerName"
Expand Down
1 change: 1 addition & 0 deletions internal/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ func (p *CloudflareProvider) DataSources(ctx context.Context) []func() datasourc
account_api_token_permission_groups.NewAccountAPITokenPermissionGroupsDataSource,
account_api_token_permission_groups.NewAccountAPITokenPermissionGroupsListDataSource,
organization.NewOrganizationDataSource,
organization.NewOrganizationsDataSource,
organization_profile.NewOrganizationProfileDataSource,
origin_ca_certificate.NewOriginCACertificateDataSource,
origin_ca_certificate.NewOriginCACertificatesDataSource,
Expand Down
20 changes: 13 additions & 7 deletions internal/services/account/data_source_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ type AccountResultDataSourceEnvelope struct {
}

type AccountDataSourceModel struct {
ID types.String `tfsdk:"id" path:"account_id,computed"`
AccountID types.String `tfsdk:"account_id" path:"account_id,optional"`
CreatedOn timetypes.RFC3339 `tfsdk:"created_on" json:"created_on,computed" format:"date-time"`
Name types.String `tfsdk:"name" json:"name,computed"`
Type types.String `tfsdk:"type" json:"type,computed"`
Settings customfield.NestedObject[AccountSettingsDataSourceModel] `tfsdk:"settings" json:"settings,computed"`
Filter *AccountFindOneByDataSourceModel `tfsdk:"filter"`
ID types.String `tfsdk:"id" path:"account_id,computed"`
AccountID types.String `tfsdk:"account_id" path:"account_id,optional"`
CreatedOn timetypes.RFC3339 `tfsdk:"created_on" json:"created_on,computed" format:"date-time"`
Name types.String `tfsdk:"name" json:"name,computed"`
Type types.String `tfsdk:"type" json:"type,computed"`
ManagedBy customfield.NestedObject[AccountManagedByDataSourceModel] `tfsdk:"managed_by" json:"managed_by,computed"`
Settings customfield.NestedObject[AccountSettingsDataSourceModel] `tfsdk:"settings" json:"settings,computed"`
Filter *AccountFindOneByDataSourceModel `tfsdk:"filter"`
}

func (m *AccountDataSourceModel) toReadParams(_ context.Context) (params accounts.AccountGetParams, diags diag.Diagnostics) {
Expand All @@ -48,6 +49,11 @@ func (m *AccountDataSourceModel) toListParams(_ context.Context) (params account
return
}

type AccountManagedByDataSourceModel struct {
ParentOrgID types.String `tfsdk:"parent_org_id" json:"parent_org_id,computed"`
ParentOrgName types.String `tfsdk:"parent_org_name" json:"parent_org_name,computed"`
}

type AccountSettingsDataSourceModel struct {
AbuseContactEmail types.String `tfsdk:"abuse_contact_email" json:"abuse_contact_email,computed"`
EnforceTwofactor types.Bool `tfsdk:"enforce_twofactor" json:"enforce_twofactor,computed"`
Expand Down
15 changes: 15 additions & 0 deletions internal/services/account/data_source_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ func DataSourceSchema(ctx context.Context) schema.Schema {
stringvalidator.OneOfCaseInsensitive("standard", "enterprise"),
},
},
"managed_by": schema.SingleNestedAttribute{
Description: "Parent container details",
Computed: true,
CustomType: customfield.NewNestedObjectType[AccountManagedByDataSourceModel](ctx),
Attributes: map[string]schema.Attribute{
"parent_org_id": schema.StringAttribute{
Description: "ID of the parent Organization, if one exists",
Computed: true,
},
"parent_org_name": schema.StringAttribute{
Description: "Name of the parent Organization, if one exists",
Computed: true,
},
},
},
"settings": schema.SingleNestedAttribute{
Description: "Account settings",
Computed: true,
Expand Down
16 changes: 11 additions & 5 deletions internal/services/account/list_data_source_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,17 @@ func (m *AccountsDataSourceModel) toListParams(_ context.Context) (params accoun
}

type AccountsResultDataSourceModel struct {
ID types.String `tfsdk:"id" json:"id,computed"`
Name types.String `tfsdk:"name" json:"name,computed"`
Type types.String `tfsdk:"type" json:"type,computed"`
CreatedOn timetypes.RFC3339 `tfsdk:"created_on" json:"created_on,computed" format:"date-time"`
Settings customfield.NestedObject[AccountsSettingsDataSourceModel] `tfsdk:"settings" json:"settings,computed"`
ID types.String `tfsdk:"id" json:"id,computed"`
Name types.String `tfsdk:"name" json:"name,computed"`
Type types.String `tfsdk:"type" json:"type,computed"`
CreatedOn timetypes.RFC3339 `tfsdk:"created_on" json:"created_on,computed" format:"date-time"`
ManagedBy customfield.NestedObject[AccountsManagedByDataSourceModel] `tfsdk:"managed_by" json:"managed_by,computed"`
Settings customfield.NestedObject[AccountsSettingsDataSourceModel] `tfsdk:"settings" json:"settings,computed"`
}

type AccountsManagedByDataSourceModel struct {
ParentOrgID types.String `tfsdk:"parent_org_id" json:"parent_org_id,computed"`
ParentOrgName types.String `tfsdk:"parent_org_name" json:"parent_org_name,computed"`
}

type AccountsSettingsDataSourceModel struct {
Expand Down
15 changes: 15 additions & 0 deletions internal/services/account/list_data_source_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,21 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema {
Computed: true,
CustomType: timetypes.RFC3339Type{},
},
"managed_by": schema.SingleNestedAttribute{
Description: "Parent container details",
Computed: true,
CustomType: customfield.NewNestedObjectType[AccountsManagedByDataSourceModel](ctx),
Attributes: map[string]schema.Attribute{
"parent_org_id": schema.StringAttribute{
Description: "ID of the parent Organization, if one exists",
Computed: true,
},
"parent_org_name": schema.StringAttribute{
Description: "Name of the parent Organization, if one exists",
Computed: true,
},
},
},
"settings": schema.SingleNestedAttribute{
Description: "Account settings",
Computed: true,
Expand Down
Loading