diff --git a/.release-please-manifest.json b/.release-please-manifest.json index affd1ab3d1..b5e9157309 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "5.1.0" + ".": "5.2.0" } diff --git a/.stats.yml b/.stats.yml index c45e5590c6..029d9f1b4b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc562128cab85cd116a8c4e1fe17a0f09a5019da2d1bbe162c476aa999932c4e.yml +configured_endpoints: 1542 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bd2b482a83809b029aec6ad87f8bec570c067383f102c15fb9e8483110398194.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index eaaf581a75..c44d749780 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,62 @@ # Changelog +## 5.2.0 (2025-02-27) + +Full Changelog: [v5.1.0...v5.2.0](https://github.com/cloudflare/terraform-provider-cloudflare/compare/v5.1.0...v5.2.0) + +### ⚠ BREAKING CHANGES + +* **tunnels:** move all cloudflared resources into dedicated namespace ([#5143](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5143)) + +### Features + +* add doc string to specify what legal terraform values are for enums ([#5199](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5199)) ([b99d403](https://github.com/cloudflare/terraform-provider-cloudflare/commit/b99d403aa24264e538dcb98387741b1ae70307f6)) +* **api_token_permission_groups:** split off account/user into dedicated endpoints ([#5162](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5162)) ([c6d07be](https://github.com/cloudflare/terraform-provider-cloudflare/commit/c6d07be33998cc6f9f1c4064f81d4ed65fe74e89)) +* **api:** api update ([#5137](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5137)) ([222d9e1](https://github.com/cloudflare/terraform-provider-cloudflare/commit/222d9e1adcd47b8e459deb946babe42b952500ae)) +* **api:** api update ([#5154](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5154)) ([013bfea](https://github.com/cloudflare/terraform-provider-cloudflare/commit/013bfead10af49cc3f244a45b46cfef6f2f198c7)) +* **api:** api update ([#5160](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5160)) ([4214c9b](https://github.com/cloudflare/terraform-provider-cloudflare/commit/4214c9bb36dd50b752fca6f13d0818f904aa464c)) +* **api:** api update ([#5165](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5165)) ([89bf11e](https://github.com/cloudflare/terraform-provider-cloudflare/commit/89bf11ecb9d5cccf887cf1d78acddd66ce93ce26)) +* **api:** api update ([#5172](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5172)) ([a55499b](https://github.com/cloudflare/terraform-provider-cloudflare/commit/a55499b0e3f1819e17d66e7eb163e1face86b8aa)) +* **api:** api update ([#5188](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5188)) ([dc93f59](https://github.com/cloudflare/terraform-provider-cloudflare/commit/dc93f59d743049eaa4b6b3248f26a6550d793535)) +* **api:** api update ([#5193](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5193)) ([6077aff](https://github.com/cloudflare/terraform-provider-cloudflare/commit/6077aff3e62a2095c380f0abffb91b4d8c3a073b)) +* **api:** api update ([#5194](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5194)) ([8516e97](https://github.com/cloudflare/terraform-provider-cloudflare/commit/8516e979958c19b9bb58d2b6084aaebdf7d29ff2)) +* **api:** api update ([#5197](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5197)) ([4574dba](https://github.com/cloudflare/terraform-provider-cloudflare/commit/4574dbaa1ac2f32acf62721c328d6a79f210c250)) +* **api:** api update ([#5209](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5209)) ([6fed8b5](https://github.com/cloudflare/terraform-provider-cloudflare/commit/6fed8b57412586625ad5ca4a10ae22c4f75b80d9)) +* **api:** api update ([#5210](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5210)) ([ae0d2ce](https://github.com/cloudflare/terraform-provider-cloudflare/commit/ae0d2ce011a0c3da5fd09e706bf3f79196e516d2)) +* **authenticated_origin_pulls_settings:** add support ([#5180](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5180)) ([2e7eb91](https://github.com/cloudflare/terraform-provider-cloudflare/commit/2e7eb91fe6cd24fdf40f1d6a8213cd304b9913f5)) +* **authenticated_origin_pulls_settings:** handle upsert deletion ([b4fcc5c](https://github.com/cloudflare/terraform-provider-cloudflare/commit/b4fcc5cabef6be1bf33a26744738b51f6c423799)) +* **dns_record:** toggle stricter drift detection ([#5212](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5212)) ([b59d34c](https://github.com/cloudflare/terraform-provider-cloudflare/commit/b59d34c9665826939167b3f487590d8dcfbff6de)) +* **firewall_rules:** remove duplicated `id` query parameter ([#5155](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5155)) ([a163794](https://github.com/cloudflare/terraform-provider-cloudflare/commit/a163794281a4517afba103e99b27d6f45cc9b1cd)) +* **grit:** add `account_id` => `account.id` migration for cloudflare_zone ([7bb3f3f](https://github.com/cloudflare/terraform-provider-cloudflare/commit/7bb3f3f36c399dce62dcf204328e8ecce69ecef4)) +* **grit:** remove `plan` and `jump_start` from zone state ([091523e](https://github.com/cloudflare/terraform-provider-cloudflare/commit/091523e8d106d76e0d228787cf93751e1aea0a8a)) +* **r2:** add support for jurisdictions on all resources ([51961a9](https://github.com/cloudflare/terraform-provider-cloudflare/commit/51961a9aa4982637f87375496b5e4fc7a3ac90d6)) +* **ruleset:** toggle stricter drift detection ([#5213](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5213)) ([71156b0](https://github.com/cloudflare/terraform-provider-cloudflare/commit/71156b002b9336ef42d6438ed7301e81a3fb4395)) +* **terraform:** mark some attributes as sensitive ([#5170](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5170)) ([f7ac77e](https://github.com/cloudflare/terraform-provider-cloudflare/commit/f7ac77e81ddf82e258ca88e544b3eaf9f69c703c)) +* **tunnels:** move all cloudflared resources into dedicated namespace ([#5143](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5143)) ([010615f](https://github.com/cloudflare/terraform-provider-cloudflare/commit/010615fa7ca4989487bba7a1194c80ee0ebfc0cb)) + + +### Bug Fixes + +* **api_token:** store `value` out of band of marshaler ([4165021](https://github.com/cloudflare/terraform-provider-cloudflare/commit/416502103b9187b9d1be9e408cae2dc982a2b351)) +* **authenticated_origin_pulls_settings:** remove manual delete handling ([dc66e55](https://github.com/cloudflare/terraform-provider-cloudflare/commit/dc66e55f2cf3ffb318c6b7a28c7b9f372aa10f02)) +* **client:** mark some request bodies as optional ([#5168](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5168)) ([2416e12](https://github.com/cloudflare/terraform-provider-cloudflare/commit/2416e12a118347fd06c705c7bb75bf4f85293a16)) +* **datasource:** honor query params in non-list data sources ([#5151](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5151)) ([fd0cb35](https://github.com/cloudflare/terraform-provider-cloudflare/commit/fd0cb357bbc806fe991354955ae5868afe028578)) +* **datasource:** improve configurability of path parameters on data sources ([#5147](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5147)) ([7033468](https://github.com/cloudflare/terraform-provider-cloudflare/commit/7033468d093806d9376c64cb91e51e9ec282406d)) +* restrict schema version reset to cloudflare owned resources ([5565468](https://github.com/cloudflare/terraform-provider-cloudflare/commit/5565468988289c097d283a87d40954cf95e7fb30)) +* **zero_trust_tunnel_cloudflared_token:** map `token` to top level `result ([db778c1](https://github.com/cloudflare/terraform-provider-cloudflare/commit/db778c11678f5691052f3b894d83996e7e828fd4)) + + +### Chores + +* casing change in doc string ([#5200](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5200)) ([71e290f](https://github.com/cloudflare/terraform-provider-cloudflare/commit/71e290fd9e56e877731457695c1ccae3a998abad)) +* **internal:** codegen related update ([#5211](https://github.com/cloudflare/terraform-provider-cloudflare/issues/5211)) ([316b5f0](https://github.com/cloudflare/terraform-provider-cloudflare/commit/316b5f0716342f62a10f0885e8f7c041fcda3d07)) + + +### Documentation + +* clarify list_item split ([fb275ea](https://github.com/cloudflare/terraform-provider-cloudflare/commit/fb275ea35b7d21dedbef9248790ff9441a0d279c)) +* generate ([a62eeae](https://github.com/cloudflare/terraform-provider-cloudflare/commit/a62eeae98f45392260f8f5928493914fbaaa905f)) + ## 5.1.0 (2025-02-13) Full Changelog: [v5.0.0...v5.1.0](https://github.com/cloudflare/terraform-provider-cloudflare/compare/v5.0.0...v5.1.0) diff --git a/docs/data-sources/api_token_permissions_groups.md b/docs/data-sources/account_api_token_permission_groups.md similarity index 62% rename from docs/data-sources/api_token_permissions_groups.md rename to docs/data-sources/account_api_token_permission_groups.md index 9c9352f8f1..162ce7f8ae 100644 --- a/docs/data-sources/api_token_permissions_groups.md +++ b/docs/data-sources/account_api_token_permission_groups.md @@ -1,18 +1,18 @@ --- -page_title: "cloudflare_api_token_permissions_groups Data Source - Cloudflare" +page_title: "cloudflare_account_api_token_permission_groups Data Source - Cloudflare" subcategory: "" description: |- --- -# cloudflare_api_token_permissions_groups (Data Source) +# cloudflare_account_api_token_permission_groups (Data Source) ## Example Usage ```terraform -data "cloudflare_api_token_permissions_groups" "example_api_token_permissions_groups" { +data "cloudflare_account_api_token_permission_groups" "example_account_api_token_permission_groups" { account_id = "eb78d65290b24279ba6f44721b3ea3c4" } ``` diff --git a/docs/data-sources/api_token_permissions_groups_list.md b/docs/data-sources/account_api_token_permission_groups_list.md similarity index 71% rename from docs/data-sources/api_token_permissions_groups_list.md rename to docs/data-sources/account_api_token_permission_groups_list.md index ce5c40113c..41dc601801 100644 --- a/docs/data-sources/api_token_permissions_groups_list.md +++ b/docs/data-sources/account_api_token_permission_groups_list.md @@ -1,18 +1,18 @@ --- -page_title: "cloudflare_api_token_permissions_groups_list Data Source - Cloudflare" +page_title: "cloudflare_account_api_token_permission_groups_list Data Source - Cloudflare" subcategory: "" description: |- --- -# cloudflare_api_token_permissions_groups_list (Data Source) +# cloudflare_account_api_token_permission_groups_list (Data Source) ## Example Usage ```terraform -data "cloudflare_api_token_permissions_groups_list" "example_api_token_permissions_groups_list" { +data "cloudflare_account_api_token_permission_groups_list" "example_account_api_token_permission_groups_list" { account_id = "eb78d65290b24279ba6f44721b3ea3c4" } ``` diff --git a/docs/data-sources/permission_group.md b/docs/data-sources/account_permission_group.md similarity index 53% rename from docs/data-sources/permission_group.md rename to docs/data-sources/account_permission_group.md index 6180922beb..39f790713a 100644 --- a/docs/data-sources/permission_group.md +++ b/docs/data-sources/account_permission_group.md @@ -1,18 +1,18 @@ --- -page_title: "cloudflare_permission_group Data Source - Cloudflare" +page_title: "cloudflare_account_permission_group Data Source - Cloudflare" subcategory: "" description: |- --- -# cloudflare_permission_group (Data Source) +# cloudflare_account_permission_group (Data Source) ## Example Usage ```terraform -data "cloudflare_permission_group" "example_permission_group" { +data "cloudflare_account_permission_group" "example_account_permission_group" { account_id = "eb78d65290b24279ba6f44721b3ea3c4" permission_group_id = "6d7f2f5f5b1d4a0e9081fdc98d432fd1" } @@ -21,10 +21,9 @@ data "cloudflare_permission_group" "example_permission_group" { ## Schema -### Optional +### Required - `account_id` (String) Account identifier tag. -- `filter` (Attributes) (see [below for nested schema](#nestedatt--filter)) - `permission_group_id` (String) Permission Group identifier tag. ### Read-Only @@ -33,20 +32,6 @@ data "cloudflare_permission_group" "example_permission_group" { - `meta` (Attributes) Attributes associated to the permission group. (see [below for nested schema](#nestedatt--meta)) - `name` (String) Name of the group. - -### Nested Schema for `filter` - -Required: - -- `account_id` (String) Account identifier tag. - -Optional: - -- `id` (String) ID of the permission group to be fetched. -- `label` (String) Label of the permission group to be fetched. -- `name` (String) Name of the permission group to be fetched. - - ### Nested Schema for `meta` diff --git a/docs/data-sources/permission_groups.md b/docs/data-sources/account_permission_groups.md similarity index 84% rename from docs/data-sources/permission_groups.md rename to docs/data-sources/account_permission_groups.md index dc487b5e3d..bf242844bb 100644 --- a/docs/data-sources/permission_groups.md +++ b/docs/data-sources/account_permission_groups.md @@ -1,18 +1,18 @@ --- -page_title: "cloudflare_permission_groups Data Source - Cloudflare" +page_title: "cloudflare_account_permission_groups Data Source - Cloudflare" subcategory: "" description: |- --- -# cloudflare_permission_groups (Data Source) +# cloudflare_account_permission_groups (Data Source) ## Example Usage ```terraform -data "cloudflare_permission_groups" "example_permission_groups" { +data "cloudflare_account_permission_groups" "example_account_permission_groups" { account_id = "eb78d65290b24279ba6f44721b3ea3c4" id = "6d7f2f5f5b1d4a0e9081fdc98d432fd1" label = "labelOfThePermissionGroup" diff --git a/docs/data-sources/api_shield_schema.md b/docs/data-sources/api_shield_schema.md index f00c709651..2ca8c4c375 100644 --- a/docs/data-sources/api_shield_schema.md +++ b/docs/data-sources/api_shield_schema.md @@ -24,6 +24,7 @@ data "cloudflare_api_shield_schema" "example_api_shield_schema" { ### Required +- `schema_id` (String) - `zone_id` (String) Identifier ### Optional @@ -35,7 +36,6 @@ data "cloudflare_api_shield_schema" "example_api_shield_schema" { - `created_at` (String) - `kind` (String) Kind of schema - `name` (String) Name of the schema -- `schema_id` (String) - `source` (String) Source of the schema - `validation_enabled` (Boolean) Flag whether schema is enabled for validation. diff --git a/docs/data-sources/api_token_permission_groups_list.md b/docs/data-sources/api_token_permission_groups_list.md new file mode 100644 index 0000000000..44d02cc271 --- /dev/null +++ b/docs/data-sources/api_token_permission_groups_list.md @@ -0,0 +1,40 @@ +--- +page_title: "cloudflare_api_token_permission_groups_list Data Source - Cloudflare" +subcategory: "" +description: |- + +--- + +# cloudflare_api_token_permission_groups_list (Data Source) + + + +## Example Usage + +```terraform +data "cloudflare_api_token_permission_groups_list" "example_api_token_permission_groups_list" { + +} +``` + + +## Schema + +### Optional + +- `max_items` (Number) Max items to fetch, default: 1000 + +### Read-Only + +- `result` (Attributes List) The items returned by the data source (see [below for nested schema](#nestedatt--result)) + + +### Nested Schema for `result` + +Read-Only: + +- `id` (String) Public ID. +- `name` (String) Permission Group Name +- `scopes` (List of String) Resources to which the Permission Group is scoped + + diff --git a/docs/data-sources/authenticated_origin_pulls.md b/docs/data-sources/authenticated_origin_pulls.md index 596696e96a..fadaa07927 100644 --- a/docs/data-sources/authenticated_origin_pulls.md +++ b/docs/data-sources/authenticated_origin_pulls.md @@ -23,6 +23,7 @@ data "cloudflare_authenticated_origin_pulls" "example_authenticated_origin_pulls ### Required +- `hostname` (String) The hostname on the origin for which the client certificate uploaded will be used. - `zone_id` (String) Identifier ### Read-Only @@ -35,7 +36,6 @@ data "cloudflare_authenticated_origin_pulls" "example_authenticated_origin_pulls - `created_at` (String) The time when the certificate was created. - `enabled` (Boolean) Indicates whether hostname-level authenticated origin pulls is enabled. A null value voids the association. - `expires_on` (String) The date when the certificate expires. -- `hostname` (String) The hostname on the origin for which the client certificate uploaded will be used. - `issuer` (String) The certificate authority that issued the certificate. - `serial_number` (String) The serial number on the uploaded certificate. - `signature` (String) The type of hash used for the certificate. diff --git a/docs/data-sources/authenticated_origin_pulls_settings.md b/docs/data-sources/authenticated_origin_pulls_settings.md new file mode 100644 index 0000000000..5b78918cce --- /dev/null +++ b/docs/data-sources/authenticated_origin_pulls_settings.md @@ -0,0 +1,31 @@ +--- +page_title: "cloudflare_authenticated_origin_pulls_settings Data Source - Cloudflare" +subcategory: "" +description: |- + +--- + +# cloudflare_authenticated_origin_pulls_settings (Data Source) + + + +## Example Usage + +```terraform +data "cloudflare_authenticated_origin_pulls_settings" "example_authenticated_origin_pulls_settings" { + zone_id = "023e105f4ecef8ad9ca31a8372d0c353" +} +``` + + +## Schema + +### Required + +- `zone_id` (String) Identifier + +### Read-Only + +- `enabled` (Boolean) Indicates whether zone-level authenticated origin pulls is enabled. + + diff --git a/docs/data-sources/byo_ip_prefix.md b/docs/data-sources/byo_ip_prefix.md index 7dc62279b4..c7d52bb9e1 100644 --- a/docs/data-sources/byo_ip_prefix.md +++ b/docs/data-sources/byo_ip_prefix.md @@ -21,13 +21,16 @@ data "cloudflare_byo_ip_prefix" "example_byo_ip_prefix" { ## Schema +### Required + +- `account_id` (String) Identifier of a Cloudflare account. + ### Optional - `prefix_id` (String) Identifier of an IP Prefix. ### Read-Only -- `account_id` (String) Identifier of a Cloudflare account. - `advertised` (Boolean) Prefix advertisement status to the Internet. This field is only not 'null' if on demand is enabled. - `advertised_modified_at` (String) Last time the advertisement status was changed. This field is only not 'null' if on demand is enabled. - `approved` (String) Approval state of the prefix (P = pending, V = active). diff --git a/docs/data-sources/custom_ssl.md b/docs/data-sources/custom_ssl.md index 97c7aec44d..3414e2372c 100644 --- a/docs/data-sources/custom_ssl.md +++ b/docs/data-sources/custom_ssl.md @@ -21,6 +21,10 @@ data "cloudflare_custom_ssl" "example_custom_ssl" { ## Schema +### Required + +- `zone_id` (String) Identifier + ### Optional - `custom_certificate_id` (String) Identifier @@ -41,7 +45,6 @@ data "cloudflare_custom_ssl" "example_custom_ssl" { - `signature` (String) The type of hash used for the certificate. - `status` (String) Status of the zone's custom SSL. - `uploaded_on` (String) When the certificate was uploaded to Cloudflare. -- `zone_id` (String) Identifier ### Nested Schema for `filter` diff --git a/docs/data-sources/firewall_rule.md b/docs/data-sources/firewall_rule.md index d5ff7d2d3f..a1f33eb74a 100644 --- a/docs/data-sources/firewall_rule.md +++ b/docs/data-sources/firewall_rule.md @@ -15,7 +15,6 @@ description: |- data "cloudflare_firewall_rule" "example_firewall_rule" { zone_id = "023e105f4ecef8ad9ca31a8372d0c353" rule_id = "372e67954025e0ba6aaa6d586b9e0b60" - id = "372e67954025e0ba6aaa6d586b9e0b60" } ``` diff --git a/docs/data-sources/load_balancer.md b/docs/data-sources/load_balancer.md index 6c755de533..3ec96ac10f 100644 --- a/docs/data-sources/load_balancer.md +++ b/docs/data-sources/load_balancer.md @@ -69,6 +69,7 @@ data "cloudflare_load_balancer" "example_load_balancer" { - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client's ip address. - `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration. - `session_affinity_attributes` (Attributes) Configures attributes for session affinity. (see [below for nested schema](#nestedatt--session_affinity_attributes)) +- `zone_name` (String) ### Nested Schema for `adaptive_routing` diff --git a/docs/data-sources/load_balancers.md b/docs/data-sources/load_balancers.md index c876e54714..899b43f75f 100644 --- a/docs/data-sources/load_balancers.md +++ b/docs/data-sources/load_balancers.md @@ -78,6 +78,7 @@ Read-Only: - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client's ip address. - `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration. - `session_affinity_attributes` (Attributes) Configures attributes for session affinity. (see [below for nested schema](#nestedatt--result--session_affinity_attributes)) +- `zone_name` (String) ### Nested Schema for `result.adaptive_routing` diff --git a/docs/data-sources/magic_transit_site_lan.md b/docs/data-sources/magic_transit_site_lan.md index 5ddc23205e..c08ff412f8 100644 --- a/docs/data-sources/magic_transit_site_lan.md +++ b/docs/data-sources/magic_transit_site_lan.md @@ -25,6 +25,7 @@ data "cloudflare_magic_transit_site_lan" "example_magic_transit_site_lan" { ### Required - `account_id` (String) Identifier +- `site_id` (String) Identifier ### Optional @@ -38,7 +39,6 @@ data "cloudflare_magic_transit_site_lan" "example_magic_transit_site_lan" { - `nat` (Attributes) (see [below for nested schema](#nestedatt--nat)) - `physport` (Number) - `routed_subnets` (Attributes List) (see [below for nested schema](#nestedatt--routed_subnets)) -- `site_id` (String) Identifier - `static_addressing` (Attributes) If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address. (see [below for nested schema](#nestedatt--static_addressing)) - `vlan_tag` (Number) VLAN port number. diff --git a/docs/data-sources/magic_transit_site_wan.md b/docs/data-sources/magic_transit_site_wan.md index 7775a971b5..3cef71ee83 100644 --- a/docs/data-sources/magic_transit_site_wan.md +++ b/docs/data-sources/magic_transit_site_wan.md @@ -25,6 +25,7 @@ data "cloudflare_magic_transit_site_wan" "example_magic_transit_site_wan" { ### Required - `account_id` (String) Identifier +- `site_id` (String) Identifier ### Optional @@ -37,7 +38,6 @@ data "cloudflare_magic_transit_site_wan" "example_magic_transit_site_wan" { - `name` (String) - `physport` (Number) - `priority` (Number) Priority of WAN for traffic loadbalancing. -- `site_id` (String) Identifier - `static_addressing` (Attributes) (optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode. (see [below for nested schema](#nestedatt--static_addressing)) - `vlan_tag` (Number) VLAN port number. diff --git a/docs/data-sources/observatory_scheduled_test.md b/docs/data-sources/observatory_scheduled_test.md index 2734f27fe8..99f3b410ed 100644 --- a/docs/data-sources/observatory_scheduled_test.md +++ b/docs/data-sources/observatory_scheduled_test.md @@ -24,12 +24,15 @@ data "cloudflare_observatory_scheduled_test" "example_observatory_scheduled_test ### Required +- `url` (String) A URL. - `zone_id` (String) Identifier +### Optional + +- `region` (String) A test region. + ### Read-Only - `frequency` (String) The frequency of the test. -- `region` (String) A test region. -- `url` (String) A URL. diff --git a/docs/data-sources/queue_consumer.md b/docs/data-sources/queue_consumer.md index 2ffe9c6ebe..62f9f08f1f 100644 --- a/docs/data-sources/queue_consumer.md +++ b/docs/data-sources/queue_consumer.md @@ -24,12 +24,12 @@ data "cloudflare_queue_consumer" "example_queue_consumer" { ### Required - `account_id` (String) A Resource identifier. +- `queue_id` (String) A Resource identifier. ### Read-Only - `consumer_id` (String) A Resource identifier. - `created_on` (String) -- `queue_id` (String) A Resource identifier. - `script` (String) Name of a Worker - `script_name` (String) Name of a Worker - `settings` (Attributes) (see [below for nested schema](#nestedatt--settings)) diff --git a/docs/data-sources/snippets.md b/docs/data-sources/snippets.md index 1c46fcf068..4fc74742d3 100644 --- a/docs/data-sources/snippets.md +++ b/docs/data-sources/snippets.md @@ -23,12 +23,12 @@ data "cloudflare_snippets" "example_snippets" { ### Required +- `snippet_name` (String) Snippet identifying name - `zone_id` (String) Identifier ### Read-Only - `created_on` (String) Creation time of the snippet - `modified_on` (String) Modification time of the snippet -- `snippet_name` (String) Snippet identifying name diff --git a/docs/data-sources/stream_caption_language.md b/docs/data-sources/stream_caption_language.md index 13e5edbaae..050363f09f 100644 --- a/docs/data-sources/stream_caption_language.md +++ b/docs/data-sources/stream_caption_language.md @@ -26,12 +26,12 @@ data "cloudflare_stream_caption_language" "example_stream_caption_language" { - `account_id` (String) Identifier - `identifier` (String) A Cloudflare-generated unique identifier for a media item. +- `language` (String) The language tag in BCP 47 format. ### Read-Only - `generated` (Boolean) Whether the caption was generated via AI. - `label` (String) The language label displayed in the native language to users. -- `language` (String) The language tag in BCP 47 format. - `status` (String) The status of a generated caption. diff --git a/docs/data-sources/zero_trust_device_custom_profile.md b/docs/data-sources/zero_trust_device_custom_profile.md index ca43b3eb4f..2ada9bd285 100644 --- a/docs/data-sources/zero_trust_device_custom_profile.md +++ b/docs/data-sources/zero_trust_device_custom_profile.md @@ -39,6 +39,7 @@ data "cloudflare_zero_trust_device_custom_profile" "example_zero_trust_device_cu - `default` (Boolean) Whether the policy is the default policy for an account. - `description` (String) A description of the policy. - `disable_auto_fallback` (Boolean) If the `dns_server` field of a fallback domain is not present, the client will fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`. +- `doh_in_tunnel` (Boolean) Determines how the WARP client sends DNS requests to Cloudflare Gateway. When `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, the DoH connection operates outside of the WARP tunnel. - `enabled` (Boolean) Whether the policy will be applied to matching devices. - `exclude` (Attributes List) (see [below for nested schema](#nestedatt--exclude)) - `exclude_office_ips` (Boolean) Whether to add Microsoft IPs to Split Tunnel exclusions. @@ -51,6 +52,7 @@ data "cloudflare_zero_trust_device_custom_profile" "example_zero_trust_device_cu - `match` (String) The wirefilter expression to match devices. - `name` (String) The name of the device settings profile. - `precedence` (Number) The precedence of the policy. Lower values indicate higher precedence. Policies will be evaluated in ascending order of this field. +- `register_interface_ip_with_dns` (Boolean) Determines if the operating system will register WARP's local interface IP with your on-premises DNS server. - `service_mode_v2` (Attributes) (see [below for nested schema](#nestedatt--service_mode_v2)) - `support_url` (String) The URL to launch when the Send Feedback button is clicked. - `switch_locked` (Boolean) Whether to allow the user to turn off the WARP switch and disconnect the client. diff --git a/docs/data-sources/zero_trust_device_custom_profiles.md b/docs/data-sources/zero_trust_device_custom_profiles.md index ec67f8b997..e7d0cf3f4c 100644 --- a/docs/data-sources/zero_trust_device_custom_profiles.md +++ b/docs/data-sources/zero_trust_device_custom_profiles.md @@ -45,6 +45,7 @@ Read-Only: - `default` (Boolean) Whether the policy is the default policy for an account. - `description` (String) A description of the policy. - `disable_auto_fallback` (Boolean) If the `dns_server` field of a fallback domain is not present, the client will fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`. +- `doh_in_tunnel` (Boolean) Determines how the WARP client sends DNS requests to Cloudflare Gateway. When `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, the DoH connection operates outside of the WARP tunnel. - `enabled` (Boolean) Whether the policy will be applied to matching devices. - `exclude` (Attributes List) (see [below for nested schema](#nestedatt--result--exclude)) - `exclude_office_ips` (Boolean) Whether to add Microsoft IPs to Split Tunnel exclusions. @@ -57,6 +58,7 @@ Read-Only: - `name` (String) The name of the device settings profile. - `policy_id` (String) Device ID. - `precedence` (Number) The precedence of the policy. Lower values indicate higher precedence. Policies will be evaluated in ascending order of this field. +- `register_interface_ip_with_dns` (Boolean) Determines if the operating system will register WARP's local interface IP with your on-premises DNS server. - `service_mode_v2` (Attributes) (see [below for nested schema](#nestedatt--result--service_mode_v2)) - `support_url` (String) The URL to launch when the Send Feedback button is clicked. - `switch_locked` (Boolean) Whether to allow the user to turn off the WARP switch and disconnect the client. diff --git a/docs/data-sources/zero_trust_device_default_profile.md b/docs/data-sources/zero_trust_device_default_profile.md index d78bc6b650..a8271a4df7 100644 --- a/docs/data-sources/zero_trust_device_default_profile.md +++ b/docs/data-sources/zero_trust_device_default_profile.md @@ -33,12 +33,14 @@ data "cloudflare_zero_trust_device_default_profile" "example_zero_trust_device_d - `captive_portal` (Number) Turn on the captive portal after the specified amount of time. - `default` (Boolean) Whether the policy will be applied to matching devices. - `disable_auto_fallback` (Boolean) If the `dns_server` field of a fallback domain is not present, the client will fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`. +- `doh_in_tunnel` (Boolean) Determines how the WARP client sends DNS requests to Cloudflare Gateway. When `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, the DoH connection operates outside of the WARP tunnel. - `enabled` (Boolean) Whether the policy will be applied to matching devices. - `exclude` (Attributes List) (see [below for nested schema](#nestedatt--exclude)) - `exclude_office_ips` (Boolean) Whether to add Microsoft IPs to Split Tunnel exclusions. - `fallback_domains` (Attributes List) (see [below for nested schema](#nestedatt--fallback_domains)) - `gateway_unique_id` (String) - `include` (Attributes List) (see [below for nested schema](#nestedatt--include)) +- `register_interface_ip_with_dns` (Boolean) Determines if the operating system will register WARP's local interface IP with your on-premises DNS server. - `service_mode_v2` (Attributes) (see [below for nested schema](#nestedatt--service_mode_v2)) - `support_url` (String) The URL to launch when the Send Feedback button is clicked. - `switch_locked` (Boolean) Whether to allow the user to turn off the WARP switch and disconnect the client. diff --git a/docs/data-sources/zero_trust_dlp_custom_profile.md b/docs/data-sources/zero_trust_dlp_custom_profile.md index b24c6d55f6..d20830f621 100644 --- a/docs/data-sources/zero_trust_dlp_custom_profile.md +++ b/docs/data-sources/zero_trust_dlp_custom_profile.md @@ -81,9 +81,8 @@ Read-Only: Read-Only: -- `ai_context_available` (Boolean) -- `available` (Boolean) Indicates whether this entry can be made more or less sensitive by setting a confidence threshold. -Profiles that use an entry with `available` set to true can use confidence thresholds +- `ai_context_available` (Boolean) Indicates whether this entry has AI remote service validation +- `available` (Boolean) Indicates whether this entry has any form of validation that is not an AI remote service diff --git a/docs/data-sources/zero_trust_dlp_entries.md b/docs/data-sources/zero_trust_dlp_entries.md index 9537767504..8c7845f812 100644 --- a/docs/data-sources/zero_trust_dlp_entries.md +++ b/docs/data-sources/zero_trust_dlp_entries.md @@ -54,9 +54,8 @@ Read-Only: Read-Only: -- `ai_context_available` (Boolean) -- `available` (Boolean) Indicates whether this entry can be made more or less sensitive by setting a confidence threshold. -Profiles that use an entry with `available` set to true can use confidence thresholds +- `ai_context_available` (Boolean) Indicates whether this entry has AI remote service validation +- `available` (Boolean) Indicates whether this entry has any form of validation that is not an AI remote service diff --git a/docs/data-sources/zero_trust_dlp_entry.md b/docs/data-sources/zero_trust_dlp_entry.md index c53bf7d093..44133a7dbe 100644 --- a/docs/data-sources/zero_trust_dlp_entry.md +++ b/docs/data-sources/zero_trust_dlp_entry.md @@ -48,9 +48,8 @@ data "cloudflare_zero_trust_dlp_entry" "example_zero_trust_dlp_entry" { Read-Only: -- `ai_context_available` (Boolean) -- `available` (Boolean) Indicates whether this entry can be made more or less sensitive by setting a confidence threshold. -Profiles that use an entry with `available` set to true can use confidence thresholds +- `ai_context_available` (Boolean) Indicates whether this entry has AI remote service validation +- `available` (Boolean) Indicates whether this entry has any form of validation that is not an AI remote service diff --git a/docs/data-sources/zero_trust_dlp_predefined_profile.md b/docs/data-sources/zero_trust_dlp_predefined_profile.md index 7964802a75..77015fbdbf 100644 --- a/docs/data-sources/zero_trust_dlp_predefined_profile.md +++ b/docs/data-sources/zero_trust_dlp_predefined_profile.md @@ -81,9 +81,8 @@ Read-Only: Read-Only: -- `ai_context_available` (Boolean) -- `available` (Boolean) Indicates whether this entry can be made more or less sensitive by setting a confidence threshold. -Profiles that use an entry with `available` set to true can use confidence thresholds +- `ai_context_available` (Boolean) Indicates whether this entry has AI remote service validation +- `available` (Boolean) Indicates whether this entry has any form of validation that is not an AI remote service diff --git a/docs/data-sources/zero_trust_tunnel_cloudflared.md b/docs/data-sources/zero_trust_tunnel_cloudflared.md index 39cbb16bff..2f96e4fa74 100644 --- a/docs/data-sources/zero_trust_tunnel_cloudflared.md +++ b/docs/data-sources/zero_trust_tunnel_cloudflared.md @@ -51,7 +51,7 @@ data "cloudflare_zero_trust_tunnel_cloudflared" "example_zero_trust_tunnel_cloud Optional: - `exclude_prefix` (String) -- `existed_at` (String) If provided, include only tunnels that were created (and not deleted) before this time. +- `existed_at` (String) If provided, include only resources that were created (and not deleted) before this time. URL encoded. - `include_prefix` (String) - `is_deleted` (Boolean) If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included. - `name` (String) A user-friendly name for a tunnel. diff --git a/docs/data-sources/zero_trust_tunnel_cloudflared_config.md b/docs/data-sources/zero_trust_tunnel_cloudflared_config.md index f474994c94..87f5f2b83b 100644 --- a/docs/data-sources/zero_trust_tunnel_cloudflared_config.md +++ b/docs/data-sources/zero_trust_tunnel_cloudflared_config.md @@ -21,13 +21,16 @@ data "cloudflare_zero_trust_tunnel_cloudflared_config" "example_zero_trust_tunne ## Schema -### Read-Only +### Required - `account_id` (String) Identifier +- `tunnel_id` (String) UUID of the tunnel. + +### Read-Only + - `config` (Attributes) The tunnel configuration and ingress rules. (see [below for nested schema](#nestedatt--config)) - `created_at` (String) - `source` (String) Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel's configuration on the Zero Trust dashboard. -- `tunnel_id` (String) UUID of the tunnel. - `version` (Number) The version of the Tunnel Configuration. diff --git a/docs/data-sources/zero_trust_tunnel_cloudflared_route.md b/docs/data-sources/zero_trust_tunnel_cloudflared_route.md index c948ff9690..5d8389e969 100644 --- a/docs/data-sources/zero_trust_tunnel_cloudflared_route.md +++ b/docs/data-sources/zero_trust_tunnel_cloudflared_route.md @@ -46,7 +46,7 @@ data "cloudflare_zero_trust_tunnel_cloudflared_route" "example_zero_trust_tunnel Optional: - `comment` (String) Optional remark describing the route. -- `existed_at` (String) If provided, include only tunnels that were created (and not deleted) before this time. +- `existed_at` (String) If provided, include only resources that were created (and not deleted) before this time. URL encoded. - `is_deleted` (Boolean) If `true`, only include deleted routes. If `false`, exclude deleted routes. If empty, all routes will be included. - `network_subset` (String) If set, only list routes that are contained within this IP range. - `network_superset` (String) If set, only list routes that contain this IP range. diff --git a/docs/data-sources/zero_trust_tunnel_cloudflared_routes.md b/docs/data-sources/zero_trust_tunnel_cloudflared_routes.md index 555a5aacc0..3d94dee72d 100644 --- a/docs/data-sources/zero_trust_tunnel_cloudflared_routes.md +++ b/docs/data-sources/zero_trust_tunnel_cloudflared_routes.md @@ -15,7 +15,7 @@ description: |- data "cloudflare_zero_trust_tunnel_cloudflared_routes" "example_zero_trust_tunnel_cloudflared_routes" { account_id = "699d98642c564d2e855e9661899b7252" comment = "Example comment for this route." - existed_at = "2019-10-12T07:20:50.52Z" + existed_at = "2019-10-12T07%3A20%3A50.52Z" is_deleted = true network_subset = "172.16.0.0/16" network_superset = "172.16.0.0/16" @@ -36,7 +36,7 @@ data "cloudflare_zero_trust_tunnel_cloudflared_routes" "example_zero_trust_tunne ### Optional - `comment` (String) Optional remark describing the route. -- `existed_at` (String) If provided, include only tunnels that were created (and not deleted) before this time. +- `existed_at` (String) If provided, include only resources that were created (and not deleted) before this time. URL encoded. - `is_deleted` (Boolean) If `true`, only include deleted routes. If `false`, exclude deleted routes. If empty, all routes will be included. - `max_items` (Number) Max items to fetch, default: 1000 - `network_subset` (String) If set, only list routes that are contained within this IP range. diff --git a/docs/data-sources/zero_trust_tunnel_cloudflared_token.md b/docs/data-sources/zero_trust_tunnel_cloudflared_token.md index 608f2755b7..830ae81c22 100644 --- a/docs/data-sources/zero_trust_tunnel_cloudflared_token.md +++ b/docs/data-sources/zero_trust_tunnel_cloudflared_token.md @@ -26,4 +26,8 @@ data "cloudflare_zero_trust_tunnel_cloudflared_token" "example_zero_trust_tunnel - `account_id` (String) Cloudflare account ID - `tunnel_id` (String) UUID of the tunnel. +### Read-Only + +- `token` (String) The Tunnel Token is used as a mechanism to authenticate the operation of a tunnel. + diff --git a/docs/data-sources/zero_trust_tunnel_cloudflareds.md b/docs/data-sources/zero_trust_tunnel_cloudflareds.md index f00cdb7252..f26edf8418 100644 --- a/docs/data-sources/zero_trust_tunnel_cloudflareds.md +++ b/docs/data-sources/zero_trust_tunnel_cloudflareds.md @@ -15,7 +15,7 @@ description: |- data "cloudflare_zero_trust_tunnel_cloudflareds" "example_zero_trust_tunnel_cloudflareds" { account_id = "699d98642c564d2e855e9661899b7252" exclude_prefix = "vpc1-" - existed_at = "2019-10-12T07:20:50.52Z" + existed_at = "2019-10-12T07%3A20%3A50.52Z" include_prefix = "vpc1-" is_deleted = true name = "blog" @@ -36,7 +36,7 @@ data "cloudflare_zero_trust_tunnel_cloudflareds" "example_zero_trust_tunnel_clou ### Optional - `exclude_prefix` (String) -- `existed_at` (String) If provided, include only tunnels that were created (and not deleted) before this time. +- `existed_at` (String) If provided, include only resources that were created (and not deleted) before this time. URL encoded. - `include_prefix` (String) - `is_deleted` (Boolean) If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included. - `max_items` (Number) Max items to fetch, default: 1000 diff --git a/docs/guides/version-5-upgrade.md b/docs/guides/version-5-upgrade.md index 47106a90cd..df584edbe0 100644 --- a/docs/guides/version-5-upgrade.md +++ b/docs/guides/version-5-upgrade.md @@ -1090,10 +1090,32 @@ resource "cloudflare_api_token" "example" { ## cloudflare_list -- `hostname` is now a list of objects (`hostname = [{ ... }]`) instead of multiple block attribute (`hostname { ... }`). -- `item` is now a list of objects (`item = [{ ... }]`) instead of multiple block attribute (`item { ... }`). -- `redirect` is now a list of objects (`redirect = [{ ... }]`) instead of multiple block attribute (`redirect { ... }`). -- `value` is now a list of objects (`value = [{ ... }]`) instead of multiple block attribute (`value { ... }`). +- Items are no longer attached on the `cloudflare_list` resource. Instead, they should live in their own resources. + +Before + +```hcl +resource "cloudflare_list" "example" { + account_id = "f037e56e89293a057740de681ac9abbe" + item { + ip = "198.51.100.1" + } +} +``` + +After + +```hcl +resource "cloudflare_list" "example" { + account_id = "f037e56e89293a057740de681ac9abbe" +} + +resource "cloudflare_list_item" "example" { + account_id = "f037e56e89293a057740de681ac9abbe" + list_id = cloudflare_list.example.id + ip = "198.51.100.1" +} +``` ## cloudflare_list_item diff --git a/docs/resources/account_token.md b/docs/resources/account_token.md index 66d744dd93..01c8d8e947 100644 --- a/docs/resources/account_token.md +++ b/docs/resources/account_token.md @@ -68,7 +68,7 @@ resource "cloudflare_account_token" "example_account_token" { - `issued_on` (String) The time on which the token was created. - `last_used_on` (String) Last time the token was used. - `modified_on` (String) Last time the token was modified. -- `value` (String) The token value. +- `value` (String, Sensitive) The token value. ### Nested Schema for `policies` diff --git a/docs/resources/api_token.md b/docs/resources/api_token.md index 36c57cfe96..a443412e4d 100644 --- a/docs/resources/api_token.md +++ b/docs/resources/api_token.md @@ -66,7 +66,7 @@ resource "cloudflare_api_token" "example_api_token" { - `issued_on` (String) The time on which the token was created. - `last_used_on` (String) Last time the token was used. - `modified_on` (String) Last time the token was modified. -- `value` (String) The token value. +- `value` (String, Sensitive) The token value. ### Nested Schema for `policies` diff --git a/docs/resources/authenticated_origin_pulls_settings.md b/docs/resources/authenticated_origin_pulls_settings.md new file mode 100644 index 0000000000..fbca1dde08 --- /dev/null +++ b/docs/resources/authenticated_origin_pulls_settings.md @@ -0,0 +1,29 @@ +--- +page_title: "cloudflare_authenticated_origin_pulls_settings Resource - Cloudflare" +subcategory: "" +description: |- + +--- + +# cloudflare_authenticated_origin_pulls_settings (Resource) + + + +## Example Usage + +```terraform +resource "cloudflare_authenticated_origin_pulls_settings" "example_authenticated_origin_pulls_settings" { + zone_id = "023e105f4ecef8ad9ca31a8372d0c353" + enabled = true +} +``` + + +## Schema + +### Required + +- `enabled` (Boolean) Indicates whether zone-level authenticated origin pulls is enabled. +- `zone_id` (String) Identifier + + diff --git a/docs/resources/cloud_connector_rules.md b/docs/resources/cloud_connector_rules.md index 5a6a23b20d..6c7261d088 100644 --- a/docs/resources/cloud_connector_rules.md +++ b/docs/resources/cloud_connector_rules.md @@ -32,9 +32,12 @@ resource "cloudflare_cloud_connector_rules" "example_cloud_connector_rules" { ### Required -- `rules` (Attributes List) List of Cloud Connector rules (see [below for nested schema](#nestedatt--rules)) - `zone_id` (String) Identifier +### Optional + +- `rules` (Attributes List) List of Cloud Connector rules (see [below for nested schema](#nestedatt--rules)) + ### Read-Only - `cloud_provider` (String) Cloud Provider type diff --git a/docs/resources/list_item.md b/docs/resources/list_item.md index 8f6021558c..08c9e494dd 100644 --- a/docs/resources/list_item.md +++ b/docs/resources/list_item.md @@ -15,23 +15,7 @@ description: |- resource "cloudflare_list_item" "example_list_item" { account_id = "023e105f4ecef8ad9ca31a8372d0c353" list_id = "2c0fc9fa937b11eaa1b71c4d701ab86e" - body = [{ - asn = 5567 - comment = "Private IP address" - hostname = { - url_hostname = "example.com" - } - ip = "10.0.0.1" - redirect = { - source_url = "example.com/arch" - target_url = "https://archlinux.org/" - include_subdomains = true - preserve_path_suffix = true - preserve_query_string = true - status_code = 301 - subpath_matching = true - } - }] + ip = "10.0.0.1" } ``` diff --git a/docs/resources/load_balancer.md b/docs/resources/load_balancer.md index c9dbfafa7b..9fd5b30957 100644 --- a/docs/resources/load_balancer.md +++ b/docs/resources/load_balancer.md @@ -168,6 +168,7 @@ resource "cloudflare_load_balancer" "example_load_balancer" { - `created_on` (String) - `id` (String) The ID of this resource. - `modified_on` (String) +- `zone_name` (String) ### Nested Schema for `adaptive_routing` diff --git a/docs/resources/r2_bucket_cors.md b/docs/resources/r2_bucket_cors.md index 264bef2b64..c1ad72922b 100644 --- a/docs/resources/r2_bucket_cors.md +++ b/docs/resources/r2_bucket_cors.md @@ -38,6 +38,7 @@ resource "cloudflare_r2_bucket_cors" "example_r2_bucket_cors" { ### Optional +- `jurisdiction` (String) Jurisdiction of the bucket - `rules` (Attributes List) (see [below for nested schema](#nestedatt--rules)) diff --git a/docs/resources/r2_bucket_event_notification.md b/docs/resources/r2_bucket_event_notification.md index 38d8507a1a..c72a327567 100644 --- a/docs/resources/r2_bucket_event_notification.md +++ b/docs/resources/r2_bucket_event_notification.md @@ -35,6 +35,7 @@ resource "cloudflare_r2_bucket_event_notification" "example_r2_bucket_event_noti ### Optional +- `jurisdiction` (String) Jurisdiction of the bucket - `queue_id` (String) Queue ID - `rules` (Attributes List) Array of rules to drive notifications (see [below for nested schema](#nestedatt--rules)) diff --git a/docs/resources/r2_bucket_lifecycle.md b/docs/resources/r2_bucket_lifecycle.md index 063a18f603..dd036ceed4 100644 --- a/docs/resources/r2_bucket_lifecycle.md +++ b/docs/resources/r2_bucket_lifecycle.md @@ -54,6 +54,7 @@ resource "cloudflare_r2_bucket_lifecycle" "example_r2_bucket_lifecycle" { ### Optional +- `jurisdiction` (String) Jurisdiction of the bucket - `rules` (Attributes List) (see [below for nested schema](#nestedatt--rules)) diff --git a/docs/resources/r2_bucket_lock.md b/docs/resources/r2_bucket_lock.md index fdfbdeaaed..c8154f497c 100644 --- a/docs/resources/r2_bucket_lock.md +++ b/docs/resources/r2_bucket_lock.md @@ -37,6 +37,7 @@ resource "cloudflare_r2_bucket_lock" "example_r2_bucket_lock" { ### Optional +- `jurisdiction` (String) Jurisdiction of the bucket - `rules` (Attributes List) (see [below for nested schema](#nestedatt--rules)) diff --git a/docs/resources/r2_bucket_sippy.md b/docs/resources/r2_bucket_sippy.md index d7e5439f15..4c8abe1618 100644 --- a/docs/resources/r2_bucket_sippy.md +++ b/docs/resources/r2_bucket_sippy.md @@ -41,6 +41,7 @@ resource "cloudflare_r2_bucket_sippy" "example_r2_bucket_sippy" { ### Optional - `destination` (Attributes) R2 bucket to copy objects to (see [below for nested schema](#nestedatt--destination)) +- `jurisdiction` (String) Jurisdiction of the bucket - `source` (Attributes) AWS S3 bucket to copy objects from (see [below for nested schema](#nestedatt--source)) ### Read-Only diff --git a/docs/resources/r2_managed_domain.md b/docs/resources/r2_managed_domain.md index 64181f0415..01c09064b5 100644 --- a/docs/resources/r2_managed_domain.md +++ b/docs/resources/r2_managed_domain.md @@ -28,6 +28,10 @@ resource "cloudflare_r2_managed_domain" "example_r2_managed_domain" { - `bucket_name` (String) Name of the bucket - `enabled` (Boolean) Whether to enable public bucket access at the r2.dev domain +### Optional + +- `jurisdiction` (String) Jurisdiction of the bucket + ### Read-Only - `bucket_id` (String) Bucket ID diff --git a/docs/resources/ruleset.md b/docs/resources/ruleset.md index 37b9102c41..0f0c7a2720 100644 --- a/docs/resources/ruleset.md +++ b/docs/resources/ruleset.md @@ -16,6 +16,8 @@ resource "cloudflare_ruleset" "example_ruleset" { kind = "managed" name = "My ruleset" phase = "ddos_l4" + zone_id = "zone_id" + description = "My ruleset to execute managed rulesets" rules = [{ id = "3a03d665bac047339bb530ecb439a90d" action = "block" @@ -53,8 +55,6 @@ resource "cloudflare_ruleset" "example_ruleset" { } ref = "my_ref" }] - zone_id = "zone_id" - description = "My ruleset to execute managed rulesets" } ``` @@ -66,12 +66,12 @@ resource "cloudflare_ruleset" "example_ruleset" { - `kind` (String) The kind of the ruleset. - `name` (String) The human-readable name of the ruleset. - `phase` (String) The phase of the ruleset. -- `rules` (Attributes List) The list of rules in the ruleset. (see [below for nested schema](#nestedatt--rules)) ### Optional - `account_id` (String) The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. - `description` (String) An informative description of the ruleset. +- `rules` (Attributes List) The list of rules in the ruleset. (see [below for nested schema](#nestedatt--rules)) - `zone_id` (String) The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. ### Read-Only diff --git a/docs/resources/zero_trust_device_custom_profile.md b/docs/resources/zero_trust_device_custom_profile.md index 1c3d3fc4a0..1c5a970d89 100644 --- a/docs/resources/zero_trust_device_custom_profile.md +++ b/docs/resources/zero_trust_device_custom_profile.md @@ -24,10 +24,12 @@ resource "cloudflare_zero_trust_device_custom_profile" "example_zero_trust_devic captive_portal = 180 description = "Policy for test teams." disable_auto_fallback = true + doh_in_tunnel = true enabled = true exclude_office_ips = true lan_allow_minutes = 30 lan_allow_subnet_size = 24 + register_interface_ip_with_dns = true service_mode_v2 = { mode = "proxy" port = 3000 @@ -57,10 +59,12 @@ resource "cloudflare_zero_trust_device_custom_profile" "example_zero_trust_devic - `captive_portal` (Number) Turn on the captive portal after the specified amount of time. - `description` (String) A description of the policy. - `disable_auto_fallback` (Boolean) If the `dns_server` field of a fallback domain is not present, the client will fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`. +- `doh_in_tunnel` (Boolean) Determines how the WARP client sends DNS requests to Cloudflare Gateway. When `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, the DoH connection operates outside of the WARP tunnel. - `enabled` (Boolean) Whether the policy will be applied to matching devices. - `exclude_office_ips` (Boolean) Whether to add Microsoft IPs to Split Tunnel exclusions. - `lan_allow_minutes` (Number) The amount of time in minutes a user is allowed access to their LAN. A value of 0 will allow LAN access until the next WARP reconnection, such as a reboot or a laptop waking from sleep. Note that this field is omitted from the response if null or unset. - `lan_allow_subnet_size` (Number) The size of the subnet for the local access network. Note that this field is omitted from the response if null or unset. +- `register_interface_ip_with_dns` (Boolean) Determines if the operating system will register WARP's local interface IP with your on-premises DNS server. - `service_mode_v2` (Attributes) (see [below for nested schema](#nestedatt--service_mode_v2)) - `support_url` (String) The URL to launch when the Send Feedback button is clicked. - `switch_locked` (Boolean) Whether to allow the user to turn off the WARP switch and disconnect the client. diff --git a/docs/resources/zero_trust_device_default_profile.md b/docs/resources/zero_trust_device_default_profile.md index 3281fdfb3e..86e7d7ee6a 100644 --- a/docs/resources/zero_trust_device_default_profile.md +++ b/docs/resources/zero_trust_device_default_profile.md @@ -20,7 +20,9 @@ resource "cloudflare_zero_trust_device_default_profile" "example_zero_trust_devi auto_connect = 0 captive_portal = 180 disable_auto_fallback = true + doh_in_tunnel = true exclude_office_ips = true + register_interface_ip_with_dns = true service_mode_v2 = { mode = "proxy" port = 3000 @@ -46,7 +48,9 @@ resource "cloudflare_zero_trust_device_default_profile" "example_zero_trust_devi - `auto_connect` (Number) The amount of time in seconds to reconnect after having been disabled. - `captive_portal` (Number) Turn on the captive portal after the specified amount of time. - `disable_auto_fallback` (Boolean) If the `dns_server` field of a fallback domain is not present, the client will fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`. +- `doh_in_tunnel` (Boolean) Determines how the WARP client sends DNS requests to Cloudflare Gateway. When `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, the DoH connection operates outside of the WARP tunnel. - `exclude_office_ips` (Boolean) Whether to add Microsoft IPs to Split Tunnel exclusions. +- `register_interface_ip_with_dns` (Boolean) Determines if the operating system will register WARP's local interface IP with your on-premises DNS server. - `service_mode_v2` (Attributes) (see [below for nested schema](#nestedatt--service_mode_v2)) - `support_url` (String) The URL to launch when the Send Feedback button is clicked. - `switch_locked` (Boolean) Whether to allow the user to turn off the WARP switch and disconnect the client. diff --git a/docs/resources/zero_trust_dlp_entry.md b/docs/resources/zero_trust_dlp_entry.md index dc1b5109fa..7e3626b263 100644 --- a/docs/resources/zero_trust_dlp_entry.md +++ b/docs/resources/zero_trust_dlp_entry.md @@ -65,9 +65,8 @@ Optional: Read-Only: -- `ai_context_available` (Boolean) -- `available` (Boolean) Indicates whether this entry can be made more or less sensitive by setting a confidence threshold. -Profiles that use an entry with `available` set to true can use confidence thresholds +- `ai_context_available` (Boolean) Indicates whether this entry has AI remote service validation +- `available` (Boolean) Indicates whether this entry has any form of validation that is not an AI remote service ## Import diff --git a/examples/data-sources/cloudflare_account_api_token_permission_groups/data-source.tf b/examples/data-sources/cloudflare_account_api_token_permission_groups/data-source.tf new file mode 100644 index 0000000000..f12aed82be --- /dev/null +++ b/examples/data-sources/cloudflare_account_api_token_permission_groups/data-source.tf @@ -0,0 +1,3 @@ +data "cloudflare_account_api_token_permission_groups" "example_account_api_token_permission_groups" { + account_id = "eb78d65290b24279ba6f44721b3ea3c4" +} diff --git a/examples/data-sources/cloudflare_account_api_token_permission_groups_list/data-source.tf b/examples/data-sources/cloudflare_account_api_token_permission_groups_list/data-source.tf new file mode 100644 index 0000000000..a5b40aa9e5 --- /dev/null +++ b/examples/data-sources/cloudflare_account_api_token_permission_groups_list/data-source.tf @@ -0,0 +1,3 @@ +data "cloudflare_account_api_token_permission_groups_list" "example_account_api_token_permission_groups_list" { + account_id = "eb78d65290b24279ba6f44721b3ea3c4" +} diff --git a/examples/data-sources/cloudflare_permission_group/data-source.tf b/examples/data-sources/cloudflare_account_permission_group/data-source.tf similarity index 58% rename from examples/data-sources/cloudflare_permission_group/data-source.tf rename to examples/data-sources/cloudflare_account_permission_group/data-source.tf index bbad1190df..5f3bbeb4ad 100644 --- a/examples/data-sources/cloudflare_permission_group/data-source.tf +++ b/examples/data-sources/cloudflare_account_permission_group/data-source.tf @@ -1,4 +1,4 @@ -data "cloudflare_permission_group" "example_permission_group" { +data "cloudflare_account_permission_group" "example_account_permission_group" { account_id = "eb78d65290b24279ba6f44721b3ea3c4" permission_group_id = "6d7f2f5f5b1d4a0e9081fdc98d432fd1" } diff --git a/examples/data-sources/cloudflare_permission_groups/data-source.tf b/examples/data-sources/cloudflare_account_permission_groups/data-source.tf similarity index 67% rename from examples/data-sources/cloudflare_permission_groups/data-source.tf rename to examples/data-sources/cloudflare_account_permission_groups/data-source.tf index a48f5f3d02..a459e563ae 100644 --- a/examples/data-sources/cloudflare_permission_groups/data-source.tf +++ b/examples/data-sources/cloudflare_account_permission_groups/data-source.tf @@ -1,4 +1,4 @@ -data "cloudflare_permission_groups" "example_permission_groups" { +data "cloudflare_account_permission_groups" "example_account_permission_groups" { account_id = "eb78d65290b24279ba6f44721b3ea3c4" id = "6d7f2f5f5b1d4a0e9081fdc98d432fd1" label = "labelOfThePermissionGroup" diff --git a/examples/data-sources/cloudflare_api_token_permission_groups_list/data-source.tf b/examples/data-sources/cloudflare_api_token_permission_groups_list/data-source.tf new file mode 100644 index 0000000000..de319ad826 --- /dev/null +++ b/examples/data-sources/cloudflare_api_token_permission_groups_list/data-source.tf @@ -0,0 +1,3 @@ +data "cloudflare_api_token_permission_groups_list" "example_api_token_permission_groups_list" { + +} diff --git a/examples/data-sources/cloudflare_api_token_permissions_groups/data-source.tf b/examples/data-sources/cloudflare_api_token_permissions_groups/data-source.tf deleted file mode 100644 index b1566883b0..0000000000 --- a/examples/data-sources/cloudflare_api_token_permissions_groups/data-source.tf +++ /dev/null @@ -1,3 +0,0 @@ -data "cloudflare_api_token_permissions_groups" "example_api_token_permissions_groups" { - account_id = "eb78d65290b24279ba6f44721b3ea3c4" -} diff --git a/examples/data-sources/cloudflare_api_token_permissions_groups_list/data-source.tf b/examples/data-sources/cloudflare_api_token_permissions_groups_list/data-source.tf deleted file mode 100644 index f0c735b78f..0000000000 --- a/examples/data-sources/cloudflare_api_token_permissions_groups_list/data-source.tf +++ /dev/null @@ -1,3 +0,0 @@ -data "cloudflare_api_token_permissions_groups_list" "example_api_token_permissions_groups_list" { - account_id = "eb78d65290b24279ba6f44721b3ea3c4" -} diff --git a/examples/data-sources/cloudflare_authenticated_origin_pulls_settings/data-source.tf b/examples/data-sources/cloudflare_authenticated_origin_pulls_settings/data-source.tf new file mode 100644 index 0000000000..a3f933d497 --- /dev/null +++ b/examples/data-sources/cloudflare_authenticated_origin_pulls_settings/data-source.tf @@ -0,0 +1,3 @@ +data "cloudflare_authenticated_origin_pulls_settings" "example_authenticated_origin_pulls_settings" { + zone_id = "023e105f4ecef8ad9ca31a8372d0c353" +} diff --git a/examples/data-sources/cloudflare_firewall_rule/data-source.tf b/examples/data-sources/cloudflare_firewall_rule/data-source.tf index 7dac69ae64..7d2ab48034 100644 --- a/examples/data-sources/cloudflare_firewall_rule/data-source.tf +++ b/examples/data-sources/cloudflare_firewall_rule/data-source.tf @@ -1,5 +1,4 @@ data "cloudflare_firewall_rule" "example_firewall_rule" { zone_id = "023e105f4ecef8ad9ca31a8372d0c353" rule_id = "372e67954025e0ba6aaa6d586b9e0b60" - id = "372e67954025e0ba6aaa6d586b9e0b60" } diff --git a/examples/data-sources/cloudflare_zero_trust_tunnel_cloudflared_routes/data-source.tf b/examples/data-sources/cloudflare_zero_trust_tunnel_cloudflared_routes/data-source.tf index 49f1ec2208..404517a2b9 100644 --- a/examples/data-sources/cloudflare_zero_trust_tunnel_cloudflared_routes/data-source.tf +++ b/examples/data-sources/cloudflare_zero_trust_tunnel_cloudflared_routes/data-source.tf @@ -1,7 +1,7 @@ data "cloudflare_zero_trust_tunnel_cloudflared_routes" "example_zero_trust_tunnel_cloudflared_routes" { account_id = "699d98642c564d2e855e9661899b7252" comment = "Example comment for this route." - existed_at = "2019-10-12T07:20:50.52Z" + existed_at = "2019-10-12T07%3A20%3A50.52Z" is_deleted = true network_subset = "172.16.0.0/16" network_superset = "172.16.0.0/16" diff --git a/examples/data-sources/cloudflare_zero_trust_tunnel_cloudflareds/data-source.tf b/examples/data-sources/cloudflare_zero_trust_tunnel_cloudflareds/data-source.tf index 47a1396ddb..106de4e7b5 100644 --- a/examples/data-sources/cloudflare_zero_trust_tunnel_cloudflareds/data-source.tf +++ b/examples/data-sources/cloudflare_zero_trust_tunnel_cloudflareds/data-source.tf @@ -1,7 +1,7 @@ data "cloudflare_zero_trust_tunnel_cloudflareds" "example_zero_trust_tunnel_cloudflareds" { account_id = "699d98642c564d2e855e9661899b7252" exclude_prefix = "vpc1-" - existed_at = "2019-10-12T07:20:50.52Z" + existed_at = "2019-10-12T07%3A20%3A50.52Z" include_prefix = "vpc1-" is_deleted = true name = "blog" diff --git a/examples/resources/cloudflare_authenticated_origin_pulls_settings/resource.tf b/examples/resources/cloudflare_authenticated_origin_pulls_settings/resource.tf new file mode 100644 index 0000000000..83e1b99d6f --- /dev/null +++ b/examples/resources/cloudflare_authenticated_origin_pulls_settings/resource.tf @@ -0,0 +1,4 @@ +resource "cloudflare_authenticated_origin_pulls_settings" "example_authenticated_origin_pulls_settings" { + zone_id = "023e105f4ecef8ad9ca31a8372d0c353" + enabled = true +} diff --git a/examples/resources/cloudflare_list_item/resource.tf b/examples/resources/cloudflare_list_item/resource.tf index 5ffa932ba5..f9a91b6ced 100644 --- a/examples/resources/cloudflare_list_item/resource.tf +++ b/examples/resources/cloudflare_list_item/resource.tf @@ -1,21 +1,5 @@ resource "cloudflare_list_item" "example_list_item" { account_id = "023e105f4ecef8ad9ca31a8372d0c353" list_id = "2c0fc9fa937b11eaa1b71c4d701ab86e" - body = [{ - asn = 5567 - comment = "Private IP address" - hostname = { - url_hostname = "example.com" - } - ip = "10.0.0.1" - redirect = { - source_url = "example.com/arch" - target_url = "https://archlinux.org/" - include_subdomains = true - preserve_path_suffix = true - preserve_query_string = true - status_code = 301 - subpath_matching = true - } - }] + ip = "10.0.0.1" } diff --git a/examples/resources/cloudflare_magic_network_monitoring_rule/resource.tf b/examples/resources/cloudflare_magic_network_monitoring_rule/resource.tf index 960e1f5039..f74fe63696 100644 --- a/examples/resources/cloudflare_magic_network_monitoring_rule/resource.tf +++ b/examples/resources/cloudflare_magic_network_monitoring_rule/resource.tf @@ -1,6 +1,6 @@ resource "cloudflare_magic_network_monitoring_rule" "example_magic_network_monitoring_rule" { account_id = "6f91088a406011ed95aed352566e8d4c" - duration = "300s" + duration = "1m" name = "my_rule_1" automatic_advertisement = true bandwidth = 1000 diff --git a/examples/resources/cloudflare_ruleset/resource.tf b/examples/resources/cloudflare_ruleset/resource.tf index 57276f3d53..840ce2b908 100644 --- a/examples/resources/cloudflare_ruleset/resource.tf +++ b/examples/resources/cloudflare_ruleset/resource.tf @@ -2,6 +2,8 @@ resource "cloudflare_ruleset" "example_ruleset" { kind = "managed" name = "My ruleset" phase = "ddos_l4" + zone_id = "zone_id" + description = "My ruleset to execute managed rulesets" rules = [{ id = "3a03d665bac047339bb530ecb439a90d" action = "block" @@ -39,6 +41,4 @@ resource "cloudflare_ruleset" "example_ruleset" { } ref = "my_ref" }] - zone_id = "zone_id" - description = "My ruleset to execute managed rulesets" } diff --git a/examples/resources/cloudflare_workers_script/resource.tf b/examples/resources/cloudflare_workers_script/resource.tf index 83e65c27c1..4b8749412b 100644 --- a/examples/resources/cloudflare_workers_script/resource.tf +++ b/examples/resources/cloudflare_workers_script/resource.tf @@ -12,7 +12,6 @@ resource "cloudflare_workers_script" "example_workers_script" { } bindings = [{ name = "MY_ENV_VAR" - text = "my_data" type = "plain_text" }] body_part = "worker.js" diff --git a/examples/resources/cloudflare_zero_trust_device_custom_profile/resource.tf b/examples/resources/cloudflare_zero_trust_device_custom_profile/resource.tf index fb92264529..6d76654703 100644 --- a/examples/resources/cloudflare_zero_trust_device_custom_profile/resource.tf +++ b/examples/resources/cloudflare_zero_trust_device_custom_profile/resource.tf @@ -10,10 +10,12 @@ resource "cloudflare_zero_trust_device_custom_profile" "example_zero_trust_devic captive_portal = 180 description = "Policy for test teams." disable_auto_fallback = true + doh_in_tunnel = true enabled = true exclude_office_ips = true lan_allow_minutes = 30 lan_allow_subnet_size = 24 + register_interface_ip_with_dns = true service_mode_v2 = { mode = "proxy" port = 3000 diff --git a/examples/resources/cloudflare_zero_trust_device_default_profile/resource.tf b/examples/resources/cloudflare_zero_trust_device_default_profile/resource.tf index 2d10ac4705..7e9dfff599 100644 --- a/examples/resources/cloudflare_zero_trust_device_default_profile/resource.tf +++ b/examples/resources/cloudflare_zero_trust_device_default_profile/resource.tf @@ -6,7 +6,9 @@ resource "cloudflare_zero_trust_device_default_profile" "example_zero_trust_devi auto_connect = 0 captive_portal = 180 disable_auto_fallback = true + doh_in_tunnel = true exclude_office_ips = true + register_interface_ip_with_dns = true service_mode_v2 = { mode = "proxy" port = 3000 diff --git a/go.mod b/go.mod index cd93cba11b..da5c2e2ace 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,12 @@ module github.com/cloudflare/terraform-provider-cloudflare go 1.22.7 require ( - github.com/cloudflare/cloudflare-go/v4 v4.1.0 github.com/aws/aws-sdk-go-v2 v1.31.0 github.com/aws/aws-sdk-go-v2/config v1.27.36 github.com/aws/aws-sdk-go-v2/credentials v1.17.34 github.com/aws/aws-sdk-go-v2/service/s3 v1.63.0 github.com/cloudflare/cloudflare-go v0.104.0 + github.com/cloudflare/cloudflare-go/v4 v4.1.0 github.com/davecgh/go-spew v1.1.1 github.com/hashicorp/terraform-plugin-docs v0.20.1 github.com/hashicorp/terraform-plugin-framework v1.13.0 diff --git a/go.sum b/go.sum index e3e781f3e6..f252118630 100644 --- a/go.sum +++ b/go.sum @@ -65,10 +65,10 @@ github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZ github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= -github.com/cloudflare/cloudflare-go/v4 v4.1.0 h1:1SjQZaPbUe23fSoCuMuN7EblVo+RIldNGd4pfkPCpW4= -github.com/cloudflare/cloudflare-go/v4 v4.1.0/go.mod h1:XcYpLe7Mf6FN87kXzEWVnJ6z+vskW/k6eUqgqfhFE9k= github.com/cloudflare/cloudflare-go v0.104.0 h1:R/lB0dZupaZbOgibAH/BRrkFbZ6Acn/WsKg2iX2xXuY= github.com/cloudflare/cloudflare-go v0.104.0/go.mod h1:pfUQ4PIG4ISI0/Mmc21Bp86UnFU0ktmPf3iTgbSL+cM= +github.com/cloudflare/cloudflare-go/v4 v4.1.0 h1:1SjQZaPbUe23fSoCuMuN7EblVo+RIldNGd4pfkPCpW4= +github.com/cloudflare/cloudflare-go/v4 v4.1.0/go.mod h1:XcYpLe7Mf6FN87kXzEWVnJ6z+vskW/k6eUqgqfhFE9k= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/internal/consts/consts.go b/internal/consts/consts.go index 1418a0773d..a7e43f3610 100644 --- a/internal/consts/consts.go +++ b/internal/consts/consts.go @@ -59,4 +59,6 @@ const ( // Environment variable key for the client base URL. BaseURLEnvVarKey = "CLOUDFLARE_BASE_URL" + + R2JurisdictionHTTPHeaderName = "cf-r2-jurisdiction" ) diff --git a/internal/provider.go b/internal/provider.go index fcb222c1af..b7cb2e8cbe 100644 --- a/internal/provider.go +++ b/internal/provider.go @@ -13,7 +13,9 @@ import ( "github.com/cloudflare/terraform-provider-cloudflare/internal/consts" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/access_rule" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/account" + "github.com/cloudflare/terraform-provider-cloudflare/internal/services/account_api_token_permission_groups" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/account_member" + "github.com/cloudflare/terraform-provider-cloudflare/internal/services/account_permission_group" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/account_role" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/account_subscription" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/account_token" @@ -25,11 +27,12 @@ import ( "github.com/cloudflare/terraform-provider-cloudflare/internal/services/api_shield_schema" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/api_shield_schema_validation_settings" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/api_token" - "github.com/cloudflare/terraform-provider-cloudflare/internal/services/api_token_permissions_groups" + "github.com/cloudflare/terraform-provider-cloudflare/internal/services/api_token_permission_groups" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/argo_smart_routing" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/argo_tiered_caching" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/authenticated_origin_pulls" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/authenticated_origin_pulls_certificate" + "github.com/cloudflare/terraform-provider-cloudflare/internal/services/authenticated_origin_pulls_settings" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/bot_management" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/botnet_feed_config_asn" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/byo_ip_prefix" @@ -108,7 +111,6 @@ import ( "github.com/cloudflare/terraform-provider-cloudflare/internal/services/page_shield_scripts" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/pages_domain" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/pages_project" - "github.com/cloudflare/terraform-provider-cloudflare/internal/services/permission_group" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/queue" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/queue_consumer" "github.com/cloudflare/terraform-provider-cloudflare/internal/services/r2_bucket" @@ -429,6 +431,7 @@ func (p *CloudflareProvider) Resources(ctx context.Context) []func() resource.Re logpull_retention.NewResource, authenticated_origin_pulls_certificate.NewResource, authenticated_origin_pulls.NewResource, + authenticated_origin_pulls_settings.NewResource, page_rule.NewResource, rate_limit.NewResource, waiting_room.NewResource, @@ -571,14 +574,15 @@ func (p *CloudflareProvider) DataSources(ctx context.Context) []func() datasourc account_subscription.NewAccountSubscriptionDataSource, account_token.NewAccountTokenDataSource, account_token.NewAccountTokensDataSource, - api_token_permissions_groups.NewAPITokenPermissionsGroupsDataSource, - api_token_permissions_groups.NewAPITokenPermissionsGroupsListDataSource, + account_api_token_permission_groups.NewAccountAPITokenPermissionGroupsDataSource, + account_api_token_permission_groups.NewAccountAPITokenPermissionGroupsListDataSource, origin_ca_certificate.NewOriginCACertificateDataSource, origin_ca_certificate.NewOriginCACertificatesDataSource, ip_ranges.NewIPRangesDataSource, user.NewUserDataSource, api_token.NewAPITokenDataSource, api_token.NewAPITokensDataSource, + api_token_permission_groups.NewAPITokenPermissionGroupsListDataSource, zone.NewZoneDataSource, zone.NewZonesDataSource, zone_setting.NewZoneSettingDataSource, @@ -655,6 +659,7 @@ func (p *CloudflareProvider) DataSources(ctx context.Context) []func() datasourc authenticated_origin_pulls_certificate.NewAuthenticatedOriginPullsCertificateDataSource, authenticated_origin_pulls_certificate.NewAuthenticatedOriginPullsCertificatesDataSource, authenticated_origin_pulls.NewAuthenticatedOriginPullsDataSource, + authenticated_origin_pulls_settings.NewAuthenticatedOriginPullsSettingsDataSource, page_rule.NewPageRuleDataSource, rate_limit.NewRateLimitDataSource, rate_limit.NewRateLimitsDataSource, @@ -856,8 +861,8 @@ func (p *CloudflareProvider) DataSources(ctx context.Context) []func() datasourc cloudforce_one_request_message.NewCloudforceOneRequestMessageDataSource, cloudforce_one_request_priority.NewCloudforceOneRequestPriorityDataSource, cloudforce_one_request_asset.NewCloudforceOneRequestAssetDataSource, - permission_group.NewPermissionGroupDataSource, - permission_group.NewPermissionGroupsDataSource, + account_permission_group.NewAccountPermissionGroupDataSource, + account_permission_group.NewAccountPermissionGroupsDataSource, resource_group.NewResourceGroupDataSource, resource_group.NewResourceGroupsDataSource, cloud_connector_rules.NewCloudConnectorRulesListDataSource, diff --git a/internal/services/access_rule/data_source_schema.go b/internal/services/access_rule/data_source_schema.go index 242cfb3f92..538eb4a0e2 100644 --- a/internal/services/access_rule/data_source_schema.go +++ b/internal/services/access_rule/data_source_schema.go @@ -44,7 +44,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "mode": schema.StringAttribute{ - Description: "The action to apply to a matched request.", + Description: "The action to apply to a matched request.\nAvailable values: \"block\", \"challenge\", \"whitelist\", \"js_challenge\", \"managed_challenge\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -88,7 +88,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[AccessRuleConfigurationDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "target": schema.StringAttribute{ - Description: "The configuration target. You must set the target to `ip` when specifying an IP address in the rule.", + Description: "The configuration target. You must set the target to `ip` when specifying an IP address in the rule.\nAvailable values: \"ip\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -120,7 +120,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The scope of the rule.", + Description: "The scope of the rule.\nAvailable values: \"user\", \"organization\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("user", "organization"), @@ -135,7 +135,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "target": schema.StringAttribute{ - Description: "The target to search in existing rules.", + Description: "The target to search in existing rules.\nAvailable values: \"ip\", \"ip_range\", \"asn\", \"country\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -153,14 +153,14 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "direction": schema.StringAttribute{ - Description: "The direction used to sort returned rules.", + Description: "The direction used to sort returned rules.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), }, }, "match": schema.StringAttribute{ - Description: "When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.", + Description: "When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.\nAvailable values: \"any\", \"all\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -168,7 +168,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "mode": schema.StringAttribute{ - Description: "The action to apply to a matched request.", + Description: "The action to apply to a matched request.\nAvailable values: \"block\", \"challenge\", \"whitelist\", \"js_challenge\", \"managed_challenge\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -185,7 +185,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "order": schema.StringAttribute{ - Description: "The field used to sort returned rules.", + Description: "The field used to sort returned rules.\nAvailable values: \"configuration.target\", \"configuration.value\", \"mode\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/access_rule/list_data_source_schema.go b/internal/services/access_rule/list_data_source_schema.go index a4d02a62cd..41afc4daf2 100644 --- a/internal/services/access_rule/list_data_source_schema.go +++ b/internal/services/access_rule/list_data_source_schema.go @@ -32,14 +32,14 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "direction": schema.StringAttribute{ - Description: "The direction used to sort returned rules.", + Description: "The direction used to sort returned rules.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), }, }, "mode": schema.StringAttribute{ - Description: "The action to apply to a matched request.", + Description: "The action to apply to a matched request.\nAvailable values: \"block\", \"challenge\", \"whitelist\", \"js_challenge\", \"managed_challenge\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -56,7 +56,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "order": schema.StringAttribute{ - Description: "The field used to sort returned rules.", + Description: "The field used to sort returned rules.\nAvailable values: \"configuration.target\", \"configuration.value\", \"mode\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -70,7 +70,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "target": schema.StringAttribute{ - Description: "The target to search in existing rules.", + Description: "The target to search in existing rules.\nAvailable values: \"ip\", \"ip_range\", \"asn\", \"country\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -88,7 +88,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "match": schema.StringAttribute{ - Description: "When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.", + Description: "When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.\nAvailable values: \"any\", \"all\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -135,7 +135,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[AccessRulesConfigurationDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "target": schema.StringAttribute{ - Description: "The configuration target. You must set the target to `ip` when specifying an IP address in the rule.", + Description: "The configuration target. You must set the target to `ip` when specifying an IP address in the rule.\nAvailable values: \"ip\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -154,7 +154,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "mode": schema.StringAttribute{ - Description: "The action to apply to a matched request.", + Description: "The action to apply to a matched request.\nAvailable values: \"block\", \"challenge\", \"whitelist\", \"js_challenge\", \"managed_challenge\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -194,7 +194,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The scope of the rule.", + Description: "The scope of the rule.\nAvailable values: \"user\", \"organization\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("user", "organization"), diff --git a/internal/services/access_rule/schema.go b/internal/services/access_rule/schema.go index 0e698b2572..e3d73c3cb4 100644 --- a/internal/services/access_rule/schema.go +++ b/internal/services/access_rule/schema.go @@ -38,7 +38,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "mode": schema.StringAttribute{ - Description: "The action to apply to a matched request.", + Description: "The action to apply to a matched request.\nAvailable values: \"block\", \"challenge\", \"whitelist\", \"js_challenge\", \"managed_challenge\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -55,7 +55,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, Attributes: map[string]schema.Attribute{ "target": schema.StringAttribute{ - Description: "The configuration target. You must set the target to `ip` when specifying an IP address in the rule.", + Description: "The configuration target. You must set the target to `ip` when specifying an IP address in the rule.\nAvailable values: \"ip\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -118,7 +118,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The scope of the rule.", + Description: "The scope of the rule.\nAvailable values: \"user\", \"organization\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("user", "organization"), diff --git a/internal/services/account/data_source_schema.go b/internal/services/account/data_source_schema.go index 84633d9088..9fb428cd6c 100644 --- a/internal/services/account/data_source_schema.go +++ b/internal/services/account/data_source_schema.go @@ -47,7 +47,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "default_nameservers": schema.StringAttribute{ - Description: "Specifies the default nameservers to be used for new zones added to this account.\n\n- `cloudflare.standard` for Cloudflare-branded nameservers\n- `custom.account` for account custom nameservers\n- `custom.tenant` for tenant custom nameservers\n\nSee [Custom Nameservers](https://developers.cloudflare.com/dns/additional-options/custom-nameservers/)\nfor more information.\n\nDeprecated in favor of [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings).", + Description: "Specifies the default nameservers to be used for new zones added to this account.\n\n- `cloudflare.standard` for Cloudflare-branded nameservers\n- `custom.account` for account custom nameservers\n- `custom.tenant` for tenant custom nameservers\n\nSee [Custom Nameservers](https://developers.cloudflare.com/dns/additional-options/custom-nameservers/)\nfor more information.\n\nDeprecated in favor of [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings).\nAvailable values: \"cloudflare.standard\", \"custom.account\", \"custom.tenant\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -71,7 +71,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "Direction to order results.", + Description: "Direction to order results.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), diff --git a/internal/services/account/list_data_source_schema.go b/internal/services/account/list_data_source_schema.go index 4403ab4a60..c9c5f2d379 100644 --- a/internal/services/account/list_data_source_schema.go +++ b/internal/services/account/list_data_source_schema.go @@ -20,7 +20,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { return schema.Schema{ Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "Direction to order results.", + Description: "Direction to order results.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), @@ -66,7 +66,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "default_nameservers": schema.StringAttribute{ - Description: "Specifies the default nameservers to be used for new zones added to this account.\n\n- `cloudflare.standard` for Cloudflare-branded nameservers\n- `custom.account` for account custom nameservers\n- `custom.tenant` for tenant custom nameservers\n\nSee [Custom Nameservers](https://developers.cloudflare.com/dns/additional-options/custom-nameservers/)\nfor more information.\n\nDeprecated in favor of [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings).", + Description: "Specifies the default nameservers to be used for new zones added to this account.\n\n- `cloudflare.standard` for Cloudflare-branded nameservers\n- `custom.account` for account custom nameservers\n- `custom.tenant` for tenant custom nameservers\n\nSee [Custom Nameservers](https://developers.cloudflare.com/dns/additional-options/custom-nameservers/)\nfor more information.\n\nDeprecated in favor of [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings).\nAvailable values: \"cloudflare.standard\", \"custom.account\", \"custom.tenant\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/account/schema.go b/internal/services/account/schema.go index a8a098a721..56c46034aa 100644 --- a/internal/services/account/schema.go +++ b/internal/services/account/schema.go @@ -29,7 +29,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, }, "type": schema.StringAttribute{ - Description: "the type of account being created. For self-serve customers, use standard. for enterprise customers, use enterprise.", + Description: "the type of account being created. For self-serve customers, use standard. for enterprise customers, use enterprise.\nAvailable values: \"standard\", \"enterprise\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("standard", "enterprise"), @@ -64,7 +64,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "default_nameservers": schema.StringAttribute{ - Description: "Specifies the default nameservers to be used for new zones added to this account.\n\n- `cloudflare.standard` for Cloudflare-branded nameservers\n- `custom.account` for account custom nameservers\n- `custom.tenant` for tenant custom nameservers\n\nSee [Custom Nameservers](https://developers.cloudflare.com/dns/additional-options/custom-nameservers/)\nfor more information.\n\nDeprecated in favor of [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings).", + Description: "Specifies the default nameservers to be used for new zones added to this account.\n\n- `cloudflare.standard` for Cloudflare-branded nameservers\n- `custom.account` for account custom nameservers\n- `custom.tenant` for tenant custom nameservers\n\nSee [Custom Nameservers](https://developers.cloudflare.com/dns/additional-options/custom-nameservers/)\nfor more information.\n\nDeprecated in favor of [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings).\nAvailable values: \"cloudflare.standard\", \"custom.account\", \"custom.tenant\".", Computed: true, Optional: true, Validators: []validator.String{ diff --git a/internal/services/api_token_permissions_groups/data_source.go b/internal/services/account_api_token_permission_groups/data_source.go similarity index 62% rename from internal/services/api_token_permissions_groups/data_source.go rename to internal/services/account_api_token_permission_groups/data_source.go index 30464a30d5..7d4b472e1e 100644 --- a/internal/services/api_token_permissions_groups/data_source.go +++ b/internal/services/account_api_token_permission_groups/data_source.go @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -package api_token_permissions_groups +package account_api_token_permission_groups import ( "context" @@ -15,21 +15,21 @@ import ( "github.com/hashicorp/terraform-plugin-framework/datasource" ) -type APITokenPermissionsGroupsDataSource struct { +type AccountAPITokenPermissionGroupsDataSource struct { client *cloudflare.Client } -var _ datasource.DataSourceWithConfigure = (*APITokenPermissionsGroupsDataSource)(nil) +var _ datasource.DataSourceWithConfigure = (*AccountAPITokenPermissionGroupsDataSource)(nil) -func NewAPITokenPermissionsGroupsDataSource() datasource.DataSource { - return &APITokenPermissionsGroupsDataSource{} +func NewAccountAPITokenPermissionGroupsDataSource() datasource.DataSource { + return &AccountAPITokenPermissionGroupsDataSource{} } -func (d *APITokenPermissionsGroupsDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_api_token_permissions_groups" +func (d *AccountAPITokenPermissionGroupsDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_account_api_token_permission_groups" } -func (d *APITokenPermissionsGroupsDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { +func (d *AccountAPITokenPermissionGroupsDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -48,8 +48,8 @@ func (d *APITokenPermissionsGroupsDataSource) Configure(ctx context.Context, req d.client = client } -func (d *APITokenPermissionsGroupsDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var data *APITokenPermissionsGroupsDataSourceModel +func (d *AccountAPITokenPermissionGroupsDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var data *AccountAPITokenPermissionGroupsDataSourceModel resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) @@ -64,7 +64,7 @@ func (d *APITokenPermissionsGroupsDataSource) Read(ctx context.Context, req data } res := new(http.Response) - env := APITokenPermissionsGroupsResultDataSourceEnvelope{*data} + env := AccountAPITokenPermissionGroupsResultDataSourceEnvelope{*data} _, err := d.client.Accounts.Tokens.PermissionGroups.Get( ctx, params, diff --git a/internal/services/api_token_permissions_groups/data_source_model.go b/internal/services/account_api_token_permission_groups/data_source_model.go similarity index 66% rename from internal/services/api_token_permissions_groups/data_source_model.go rename to internal/services/account_api_token_permission_groups/data_source_model.go index 4435e5d4da..fac5e3485a 100644 --- a/internal/services/api_token_permissions_groups/data_source_model.go +++ b/internal/services/account_api_token_permission_groups/data_source_model.go @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -package api_token_permissions_groups +package account_api_token_permission_groups import ( "context" @@ -12,18 +12,18 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) -type APITokenPermissionsGroupsResultDataSourceEnvelope struct { - Result APITokenPermissionsGroupsDataSourceModel `json:"result,computed"` +type AccountAPITokenPermissionGroupsResultDataSourceEnvelope struct { + Result AccountAPITokenPermissionGroupsDataSourceModel `json:"result,computed"` } -type APITokenPermissionsGroupsDataSourceModel struct { +type AccountAPITokenPermissionGroupsDataSourceModel struct { AccountID types.String `tfsdk:"account_id" path:"account_id,required"` ID types.String `tfsdk:"id" json:"id,computed"` Name types.String `tfsdk:"name" json:"name,computed"` Scopes customfield.List[types.String] `tfsdk:"scopes" json:"scopes,computed"` } -func (m *APITokenPermissionsGroupsDataSourceModel) toReadParams(_ context.Context) (params accounts.TokenPermissionGroupGetParams, diags diag.Diagnostics) { +func (m *AccountAPITokenPermissionGroupsDataSourceModel) toReadParams(_ context.Context) (params accounts.TokenPermissionGroupGetParams, diags diag.Diagnostics) { params = accounts.TokenPermissionGroupGetParams{ AccountID: cloudflare.F(m.AccountID.ValueString()), } diff --git a/internal/services/api_token_permissions_groups/data_source_schema.go b/internal/services/account_api_token_permission_groups/data_source_schema.go similarity index 80% rename from internal/services/api_token_permissions_groups/data_source_schema.go rename to internal/services/account_api_token_permission_groups/data_source_schema.go index 1502317335..07cd247988 100644 --- a/internal/services/api_token_permissions_groups/data_source_schema.go +++ b/internal/services/account_api_token_permission_groups/data_source_schema.go @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -package api_token_permissions_groups +package account_api_token_permission_groups import ( "context" @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) -var _ datasource.DataSourceWithConfigValidators = (*APITokenPermissionsGroupsDataSource)(nil) +var _ datasource.DataSourceWithConfigValidators = (*AccountAPITokenPermissionGroupsDataSource)(nil) func DataSourceSchema(ctx context.Context) schema.Schema { return schema.Schema{ @@ -51,10 +51,10 @@ func DataSourceSchema(ctx context.Context) schema.Schema { } } -func (d *APITokenPermissionsGroupsDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { +func (d *AccountAPITokenPermissionGroupsDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = DataSourceSchema(ctx) } -func (d *APITokenPermissionsGroupsDataSource) ConfigValidators(_ context.Context) []datasource.ConfigValidator { +func (d *AccountAPITokenPermissionGroupsDataSource) ConfigValidators(_ context.Context) []datasource.ConfigValidator { return []datasource.ConfigValidator{} } diff --git a/internal/services/api_token_permissions_groups/list_data_source_schema_test.go b/internal/services/account_api_token_permission_groups/data_source_schema_test.go similarity index 50% rename from internal/services/api_token_permissions_groups/list_data_source_schema_test.go rename to internal/services/account_api_token_permission_groups/data_source_schema_test.go index dcbfecaf7e..1da2bd54a0 100644 --- a/internal/services/api_token_permissions_groups/list_data_source_schema_test.go +++ b/internal/services/account_api_token_permission_groups/data_source_schema_test.go @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -package api_token_permissions_groups_test +package account_api_token_permission_groups_test import ( "context" "testing" - "github.com/cloudflare/terraform-provider-cloudflare/internal/services/api_token_permissions_groups" + "github.com/cloudflare/terraform-provider-cloudflare/internal/services/account_api_token_permission_groups" "github.com/cloudflare/terraform-provider-cloudflare/internal/test_helpers" ) -func TestAPITokenPermissionsGroupsListDataSourceModelSchemaParity(t *testing.T) { +func TestAccountAPITokenPermissionGroupsDataSourceModelSchemaParity(t *testing.T) { t.Parallel() - model := (*api_token_permissions_groups.APITokenPermissionsGroupsListDataSourceModel)(nil) - schema := api_token_permissions_groups.ListDataSourceSchema(context.TODO()) + model := (*account_api_token_permission_groups.AccountAPITokenPermissionGroupsDataSourceModel)(nil) + schema := account_api_token_permission_groups.DataSourceSchema(context.TODO()) errs := test_helpers.ValidateDataSourceModelSchemaIntegrity(model, schema) errs.Report(t) } diff --git a/internal/services/api_token_permissions_groups/list_data_source.go b/internal/services/account_api_token_permission_groups/list_data_source.go similarity index 63% rename from internal/services/api_token_permissions_groups/list_data_source.go rename to internal/services/account_api_token_permission_groups/list_data_source.go index 2f1db6a583..601312bf32 100644 --- a/internal/services/api_token_permissions_groups/list_data_source.go +++ b/internal/services/account_api_token_permission_groups/list_data_source.go @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -package api_token_permissions_groups +package account_api_token_permission_groups import ( "context" @@ -13,21 +13,21 @@ import ( "github.com/hashicorp/terraform-plugin-framework/datasource" ) -type APITokenPermissionsGroupsListDataSource struct { +type AccountAPITokenPermissionGroupsListDataSource struct { client *cloudflare.Client } -var _ datasource.DataSourceWithConfigure = (*APITokenPermissionsGroupsListDataSource)(nil) +var _ datasource.DataSourceWithConfigure = (*AccountAPITokenPermissionGroupsListDataSource)(nil) -func NewAPITokenPermissionsGroupsListDataSource() datasource.DataSource { - return &APITokenPermissionsGroupsListDataSource{} +func NewAccountAPITokenPermissionGroupsListDataSource() datasource.DataSource { + return &AccountAPITokenPermissionGroupsListDataSource{} } -func (d *APITokenPermissionsGroupsListDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_api_token_permissions_groups_list" +func (d *AccountAPITokenPermissionGroupsListDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_account_api_token_permission_groups_list" } -func (d *APITokenPermissionsGroupsListDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { +func (d *AccountAPITokenPermissionGroupsListDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -46,8 +46,8 @@ func (d *APITokenPermissionsGroupsListDataSource) Configure(ctx context.Context, d.client = client } -func (d *APITokenPermissionsGroupsListDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var data *APITokenPermissionsGroupsListDataSourceModel +func (d *AccountAPITokenPermissionGroupsListDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var data *AccountAPITokenPermissionGroupsListDataSourceModel resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) @@ -61,7 +61,7 @@ func (d *APITokenPermissionsGroupsListDataSource) Read(ctx context.Context, req return } - env := APITokenPermissionsGroupsListResultListDataSourceEnvelope{} + env := AccountAPITokenPermissionGroupsListResultListDataSourceEnvelope{} maxItems := int(data.MaxItems.ValueInt64()) acc := []attr.Value{} if maxItems <= 0 { @@ -92,7 +92,7 @@ func (d *APITokenPermissionsGroupsListDataSource) Read(ctx context.Context, req } acc = acc[:min(len(acc), maxItems)] - result, diags := customfield.NewObjectListFromAttributes[APITokenPermissionsGroupsListResultDataSourceModel](ctx, acc) + result, diags := customfield.NewObjectListFromAttributes[AccountAPITokenPermissionGroupsListResultDataSourceModel](ctx, acc) resp.Diagnostics.Append(diags...) data.Result = result diff --git a/internal/services/api_token_permissions_groups/list_data_source_model.go b/internal/services/account_api_token_permission_groups/list_data_source_model.go similarity index 52% rename from internal/services/api_token_permissions_groups/list_data_source_model.go rename to internal/services/account_api_token_permission_groups/list_data_source_model.go index 08954dfc7d..8294da6c80 100644 --- a/internal/services/api_token_permissions_groups/list_data_source_model.go +++ b/internal/services/account_api_token_permission_groups/list_data_source_model.go @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -package api_token_permissions_groups +package account_api_token_permission_groups import ( "context" @@ -12,17 +12,17 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) -type APITokenPermissionsGroupsListResultListDataSourceEnvelope struct { - Result customfield.NestedObjectList[APITokenPermissionsGroupsListResultDataSourceModel] `json:"result,computed"` +type AccountAPITokenPermissionGroupsListResultListDataSourceEnvelope struct { + Result customfield.NestedObjectList[AccountAPITokenPermissionGroupsListResultDataSourceModel] `json:"result,computed"` } -type APITokenPermissionsGroupsListDataSourceModel struct { - AccountID types.String `tfsdk:"account_id" path:"account_id,required"` - MaxItems types.Int64 `tfsdk:"max_items"` - Result customfield.NestedObjectList[APITokenPermissionsGroupsListResultDataSourceModel] `tfsdk:"result"` +type AccountAPITokenPermissionGroupsListDataSourceModel struct { + AccountID types.String `tfsdk:"account_id" path:"account_id,required"` + MaxItems types.Int64 `tfsdk:"max_items"` + Result customfield.NestedObjectList[AccountAPITokenPermissionGroupsListResultDataSourceModel] `tfsdk:"result"` } -func (m *APITokenPermissionsGroupsListDataSourceModel) toListParams(_ context.Context) (params accounts.TokenPermissionGroupListParams, diags diag.Diagnostics) { +func (m *AccountAPITokenPermissionGroupsListDataSourceModel) toListParams(_ context.Context) (params accounts.TokenPermissionGroupListParams, diags diag.Diagnostics) { params = accounts.TokenPermissionGroupListParams{ AccountID: cloudflare.F(m.AccountID.ValueString()), } @@ -30,7 +30,7 @@ func (m *APITokenPermissionsGroupsListDataSourceModel) toListParams(_ context.Co return } -type APITokenPermissionsGroupsListResultDataSourceModel struct { +type AccountAPITokenPermissionGroupsListResultDataSourceModel struct { ID types.String `tfsdk:"id" json:"id,computed"` Name types.String `tfsdk:"name" json:"name,computed"` Scopes customfield.List[types.String] `tfsdk:"scopes" json:"scopes,computed"` diff --git a/internal/services/account_api_token_permission_groups/list_data_source_schema.go b/internal/services/account_api_token_permission_groups/list_data_source_schema.go new file mode 100644 index 0000000000..31b7d233a5 --- /dev/null +++ b/internal/services/account_api_token_permission_groups/list_data_source_schema.go @@ -0,0 +1,77 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package account_api_token_permission_groups + +import ( + "context" + + "github.com/cloudflare/terraform-provider-cloudflare/internal/customfield" + "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +var _ datasource.DataSourceWithConfigValidators = (*AccountAPITokenPermissionGroupsListDataSource)(nil) + +func ListDataSourceSchema(ctx context.Context) schema.Schema { + return schema.Schema{ + Attributes: map[string]schema.Attribute{ + "account_id": schema.StringAttribute{ + Description: "Account identifier tag.", + Required: true, + }, + "max_items": schema.Int64Attribute{ + Description: "Max items to fetch, default: 1000", + Optional: true, + Validators: []validator.Int64{ + int64validator.AtLeast(0), + }, + }, + "result": schema.ListNestedAttribute{ + Description: "The items returned by the data source", + Computed: true, + CustomType: customfield.NewNestedObjectListType[AccountAPITokenPermissionGroupsListResultDataSourceModel](ctx), + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Description: "Public ID.", + Computed: true, + }, + "name": schema.StringAttribute{ + Description: "Permission Group Name", + Computed: true, + }, + "scopes": schema.ListAttribute{ + Description: "Resources to which the Permission Group is scoped", + Computed: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre( + stringvalidator.OneOfCaseInsensitive( + "com.cloudflare.api.account", + "com.cloudflare.api.account.zone", + "com.cloudflare.api.user", + "com.cloudflare.edge.r2.bucket", + ), + ), + }, + CustomType: customfield.NewListType[types.String](ctx), + ElementType: types.StringType, + }, + }, + }, + }, + }, + } +} + +func (d *AccountAPITokenPermissionGroupsListDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { + resp.Schema = ListDataSourceSchema(ctx) +} + +func (d *AccountAPITokenPermissionGroupsListDataSource) ConfigValidators(_ context.Context) []datasource.ConfigValidator { + return []datasource.ConfigValidator{} +} diff --git a/internal/services/account_api_token_permission_groups/list_data_source_schema_test.go b/internal/services/account_api_token_permission_groups/list_data_source_schema_test.go new file mode 100644 index 0000000000..0270dcea3e --- /dev/null +++ b/internal/services/account_api_token_permission_groups/list_data_source_schema_test.go @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package account_api_token_permission_groups_test + +import ( + "context" + "testing" + + "github.com/cloudflare/terraform-provider-cloudflare/internal/services/account_api_token_permission_groups" + "github.com/cloudflare/terraform-provider-cloudflare/internal/test_helpers" +) + +func TestAccountAPITokenPermissionGroupsListDataSourceModelSchemaParity(t *testing.T) { + t.Parallel() + model := (*account_api_token_permission_groups.AccountAPITokenPermissionGroupsListDataSourceModel)(nil) + schema := account_api_token_permission_groups.ListDataSourceSchema(context.TODO()) + errs := test_helpers.ValidateDataSourceModelSchemaIntegrity(model, schema) + errs.Report(t) +} diff --git a/internal/services/account_member/data_source_schema.go b/internal/services/account_member/data_source_schema.go index 8042e208b5..aa7e21aceb 100644 --- a/internal/services/account_member/data_source_schema.go +++ b/internal/services/account_member/data_source_schema.go @@ -32,7 +32,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "status": schema.StringAttribute{ - Description: "A member's status in the account.", + Description: "A member's status in the account.\nAvailable values: \"accepted\", \"pending\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("accepted", "pending"), @@ -49,7 +49,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "access": schema.StringAttribute{ - Description: "Allow or deny operations against the resources.", + Description: "Allow or deny operations against the resources.\nAvailable values: \"allow\", \"deny\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("allow", "deny"), @@ -346,14 +346,14 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "Direction to order results.", + Description: "Direction to order results.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), }, }, "order": schema.StringAttribute{ - Description: "Field to order results by.", + Description: "Field to order results by.\nAvailable values: \"user.first_name\", \"user.last_name\", \"user.email\", \"status\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -365,7 +365,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "status": schema.StringAttribute{ - Description: "A member's status in the account.", + Description: "A member's status in the account.\nAvailable values: \"accepted\", \"pending\", \"rejected\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/account_member/list_data_source_schema.go b/internal/services/account_member/list_data_source_schema.go index 9e0fb93add..b41490b53e 100644 --- a/internal/services/account_member/list_data_source_schema.go +++ b/internal/services/account_member/list_data_source_schema.go @@ -23,14 +23,14 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "direction": schema.StringAttribute{ - Description: "Direction to order results.", + Description: "Direction to order results.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), }, }, "order": schema.StringAttribute{ - Description: "Field to order results by.", + Description: "Field to order results by.\nAvailable values: \"user.first_name\", \"user.last_name\", \"user.email\", \"status\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -42,7 +42,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "status": schema.StringAttribute{ - Description: "A member's status in the account.", + Description: "A member's status in the account.\nAvailable values: \"accepted\", \"pending\", \"rejected\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -80,7 +80,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "access": schema.StringAttribute{ - Description: "Allow or deny operations against the resources.", + Description: "Allow or deny operations against the resources.\nAvailable values: \"allow\", \"deny\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("allow", "deny"), @@ -347,7 +347,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "status": schema.StringAttribute{ - Description: "A member's status in the account.", + Description: "A member's status in the account.\nAvailable values: \"accepted\", \"pending\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("accepted", "pending"), diff --git a/internal/services/account_member/schema.go b/internal/services/account_member/schema.go index 44f5373793..9ab34148d5 100644 --- a/internal/services/account_member/schema.go +++ b/internal/services/account_member/schema.go @@ -38,8 +38,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "status": schema.StringAttribute{ - Computed: true, - Optional: true, + Description: "Available values: \"accepted\", \"pending\".", + Computed: true, + Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("accepted", "pending"), }, @@ -63,7 +64,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "access": schema.StringAttribute{ - Description: "Allow or deny operations against the resources.", + Description: "Allow or deny operations against the resources.\nAvailable values: \"allow\", \"deny\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("allow", "deny"), diff --git a/internal/services/permission_group/data_source.go b/internal/services/account_permission_group/data_source.go similarity index 66% rename from internal/services/permission_group/data_source.go rename to internal/services/account_permission_group/data_source.go index f5626ed3a7..3de1960d47 100644 --- a/internal/services/permission_group/data_source.go +++ b/internal/services/account_permission_group/data_source.go @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -package permission_group +package account_permission_group import ( "context" @@ -15,21 +15,21 @@ import ( "github.com/hashicorp/terraform-plugin-framework/datasource" ) -type PermissionGroupDataSource struct { +type AccountPermissionGroupDataSource struct { client *cloudflare.Client } -var _ datasource.DataSourceWithConfigure = (*PermissionGroupDataSource)(nil) +var _ datasource.DataSourceWithConfigure = (*AccountPermissionGroupDataSource)(nil) -func NewPermissionGroupDataSource() datasource.DataSource { - return &PermissionGroupDataSource{} +func NewAccountPermissionGroupDataSource() datasource.DataSource { + return &AccountPermissionGroupDataSource{} } -func (d *PermissionGroupDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_permission_group" +func (d *AccountPermissionGroupDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_account_permission_group" } -func (d *PermissionGroupDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { +func (d *AccountPermissionGroupDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -48,8 +48,8 @@ func (d *PermissionGroupDataSource) Configure(ctx context.Context, req datasourc d.client = client } -func (d *PermissionGroupDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var data *PermissionGroupDataSourceModel +func (d *AccountPermissionGroupDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var data *AccountPermissionGroupDataSourceModel resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) diff --git a/internal/services/permission_group/data_source_model.go b/internal/services/account_permission_group/data_source_model.go similarity index 56% rename from internal/services/permission_group/data_source_model.go rename to internal/services/account_permission_group/data_source_model.go index 372b705d09..9f0e0e0813 100644 --- a/internal/services/permission_group/data_source_model.go +++ b/internal/services/account_permission_group/data_source_model.go @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -package permission_group +package account_permission_group import ( "context" @@ -12,15 +12,15 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) -type PermissionGroupDataSourceModel struct { - AccountID types.String `tfsdk:"account_id" path:"account_id,required"` - PermissionGroupID types.String `tfsdk:"permission_group_id" path:"permission_group_id,required"` - ID types.String `tfsdk:"id" json:"id,computed"` - Name types.String `tfsdk:"name" json:"name,computed"` - Meta customfield.NestedObject[PermissionGroupMetaDataSourceModel] `tfsdk:"meta" json:"meta,computed"` +type AccountPermissionGroupDataSourceModel struct { + AccountID types.String `tfsdk:"account_id" path:"account_id,required"` + PermissionGroupID types.String `tfsdk:"permission_group_id" path:"permission_group_id,required"` + ID types.String `tfsdk:"id" json:"id,computed"` + Name types.String `tfsdk:"name" json:"name,computed"` + Meta customfield.NestedObject[AccountPermissionGroupMetaDataSourceModel] `tfsdk:"meta" json:"meta,computed"` } -func (m *PermissionGroupDataSourceModel) toReadParams(_ context.Context) (params iam.PermissionGroupGetParams, diags diag.Diagnostics) { +func (m *AccountPermissionGroupDataSourceModel) toReadParams(_ context.Context) (params iam.PermissionGroupGetParams, diags diag.Diagnostics) { params = iam.PermissionGroupGetParams{ AccountID: cloudflare.F(m.AccountID.ValueString()), } @@ -28,7 +28,7 @@ func (m *PermissionGroupDataSourceModel) toReadParams(_ context.Context) (params return } -type PermissionGroupMetaDataSourceModel struct { +type AccountPermissionGroupMetaDataSourceModel struct { Key types.String `tfsdk:"key" json:"key,computed"` Value types.String `tfsdk:"value" json:"value,computed"` } diff --git a/internal/services/permission_group/data_source_schema.go b/internal/services/account_permission_group/data_source_schema.go similarity index 73% rename from internal/services/permission_group/data_source_schema.go rename to internal/services/account_permission_group/data_source_schema.go index e09f3f911e..90975f80fc 100644 --- a/internal/services/permission_group/data_source_schema.go +++ b/internal/services/account_permission_group/data_source_schema.go @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -package permission_group +package account_permission_group import ( "context" @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/datasource/schema" ) -var _ datasource.DataSourceWithConfigValidators = (*PermissionGroupDataSource)(nil) +var _ datasource.DataSourceWithConfigValidators = (*AccountPermissionGroupDataSource)(nil) func DataSourceSchema(ctx context.Context) schema.Schema { return schema.Schema{ @@ -34,7 +34,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { "meta": schema.SingleNestedAttribute{ Description: "Attributes associated to the permission group.", Computed: true, - CustomType: customfield.NewNestedObjectType[PermissionGroupMetaDataSourceModel](ctx), + CustomType: customfield.NewNestedObjectType[AccountPermissionGroupMetaDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ Computed: true, @@ -48,10 +48,10 @@ func DataSourceSchema(ctx context.Context) schema.Schema { } } -func (d *PermissionGroupDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { +func (d *AccountPermissionGroupDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = DataSourceSchema(ctx) } -func (d *PermissionGroupDataSource) ConfigValidators(_ context.Context) []datasource.ConfigValidator { +func (d *AccountPermissionGroupDataSource) ConfigValidators(_ context.Context) []datasource.ConfigValidator { return []datasource.ConfigValidator{} } diff --git a/internal/services/permission_group/data_source_schema_test.go b/internal/services/account_permission_group/data_source_schema_test.go similarity index 55% rename from internal/services/permission_group/data_source_schema_test.go rename to internal/services/account_permission_group/data_source_schema_test.go index bbb652e784..7db94aa36b 100644 --- a/internal/services/permission_group/data_source_schema_test.go +++ b/internal/services/account_permission_group/data_source_schema_test.go @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -package permission_group_test +package account_permission_group_test import ( "context" "testing" - "github.com/cloudflare/terraform-provider-cloudflare/internal/services/permission_group" + "github.com/cloudflare/terraform-provider-cloudflare/internal/services/account_permission_group" "github.com/cloudflare/terraform-provider-cloudflare/internal/test_helpers" ) -func TestPermissionGroupDataSourceModelSchemaParity(t *testing.T) { +func TestAccountPermissionGroupDataSourceModelSchemaParity(t *testing.T) { t.Parallel() - model := (*permission_group.PermissionGroupDataSourceModel)(nil) - schema := permission_group.DataSourceSchema(context.TODO()) + model := (*account_permission_group.AccountPermissionGroupDataSourceModel)(nil) + schema := account_permission_group.DataSourceSchema(context.TODO()) errs := test_helpers.ValidateDataSourceModelSchemaIntegrity(model, schema) errs.Report(t) } diff --git a/internal/services/permission_group/list_data_source.go b/internal/services/account_permission_group/list_data_source.go similarity index 66% rename from internal/services/permission_group/list_data_source.go rename to internal/services/account_permission_group/list_data_source.go index 849cdc69c3..c79d4e7a49 100644 --- a/internal/services/permission_group/list_data_source.go +++ b/internal/services/account_permission_group/list_data_source.go @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -package permission_group +package account_permission_group import ( "context" @@ -13,21 +13,21 @@ import ( "github.com/hashicorp/terraform-plugin-framework/datasource" ) -type PermissionGroupsDataSource struct { +type AccountPermissionGroupsDataSource struct { client *cloudflare.Client } -var _ datasource.DataSourceWithConfigure = (*PermissionGroupsDataSource)(nil) +var _ datasource.DataSourceWithConfigure = (*AccountPermissionGroupsDataSource)(nil) -func NewPermissionGroupsDataSource() datasource.DataSource { - return &PermissionGroupsDataSource{} +func NewAccountPermissionGroupsDataSource() datasource.DataSource { + return &AccountPermissionGroupsDataSource{} } -func (d *PermissionGroupsDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_permission_groups" +func (d *AccountPermissionGroupsDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_account_permission_groups" } -func (d *PermissionGroupsDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { +func (d *AccountPermissionGroupsDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -46,8 +46,8 @@ func (d *PermissionGroupsDataSource) Configure(ctx context.Context, req datasour d.client = client } -func (d *PermissionGroupsDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var data *PermissionGroupsDataSourceModel +func (d *AccountPermissionGroupsDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var data *AccountPermissionGroupsDataSourceModel resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) @@ -61,7 +61,7 @@ func (d *PermissionGroupsDataSource) Read(ctx context.Context, req datasource.Re return } - env := PermissionGroupsResultListDataSourceEnvelope{} + env := AccountPermissionGroupsResultListDataSourceEnvelope{} maxItems := int(data.MaxItems.ValueInt64()) acc := []attr.Value{} if maxItems <= 0 { @@ -92,7 +92,7 @@ func (d *PermissionGroupsDataSource) Read(ctx context.Context, req datasource.Re } acc = acc[:min(len(acc), maxItems)] - result, diags := customfield.NewObjectListFromAttributes[PermissionGroupsResultDataSourceModel](ctx, acc) + result, diags := customfield.NewObjectListFromAttributes[AccountPermissionGroupsResultDataSourceModel](ctx, acc) resp.Diagnostics.Append(diags...) data.Result = result diff --git a/internal/services/permission_group/list_data_source_model.go b/internal/services/account_permission_group/list_data_source_model.go similarity index 53% rename from internal/services/permission_group/list_data_source_model.go rename to internal/services/account_permission_group/list_data_source_model.go index fa79788cd7..9837eb0a1f 100644 --- a/internal/services/permission_group/list_data_source_model.go +++ b/internal/services/account_permission_group/list_data_source_model.go @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -package permission_group +package account_permission_group import ( "context" @@ -12,20 +12,20 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) -type PermissionGroupsResultListDataSourceEnvelope struct { - Result customfield.NestedObjectList[PermissionGroupsResultDataSourceModel] `json:"result,computed"` +type AccountPermissionGroupsResultListDataSourceEnvelope struct { + Result customfield.NestedObjectList[AccountPermissionGroupsResultDataSourceModel] `json:"result,computed"` } -type PermissionGroupsDataSourceModel struct { - AccountID types.String `tfsdk:"account_id" path:"account_id,required"` - ID types.String `tfsdk:"id" query:"id,optional"` - Label types.String `tfsdk:"label" query:"label,optional"` - Name types.String `tfsdk:"name" query:"name,optional"` - MaxItems types.Int64 `tfsdk:"max_items"` - Result customfield.NestedObjectList[PermissionGroupsResultDataSourceModel] `tfsdk:"result"` +type AccountPermissionGroupsDataSourceModel struct { + AccountID types.String `tfsdk:"account_id" path:"account_id,required"` + ID types.String `tfsdk:"id" query:"id,optional"` + Label types.String `tfsdk:"label" query:"label,optional"` + Name types.String `tfsdk:"name" query:"name,optional"` + MaxItems types.Int64 `tfsdk:"max_items"` + Result customfield.NestedObjectList[AccountPermissionGroupsResultDataSourceModel] `tfsdk:"result"` } -func (m *PermissionGroupsDataSourceModel) toListParams(_ context.Context) (params iam.PermissionGroupListParams, diags diag.Diagnostics) { +func (m *AccountPermissionGroupsDataSourceModel) toListParams(_ context.Context) (params iam.PermissionGroupListParams, diags diag.Diagnostics) { params = iam.PermissionGroupListParams{ AccountID: cloudflare.F(m.AccountID.ValueString()), } @@ -43,13 +43,13 @@ func (m *PermissionGroupsDataSourceModel) toListParams(_ context.Context) (param return } -type PermissionGroupsResultDataSourceModel struct { - ID types.String `tfsdk:"id" json:"id,computed"` - Meta customfield.NestedObject[PermissionGroupsMetaDataSourceModel] `tfsdk:"meta" json:"meta,computed"` - Name types.String `tfsdk:"name" json:"name,computed"` +type AccountPermissionGroupsResultDataSourceModel struct { + ID types.String `tfsdk:"id" json:"id,computed"` + Meta customfield.NestedObject[AccountPermissionGroupsMetaDataSourceModel] `tfsdk:"meta" json:"meta,computed"` + Name types.String `tfsdk:"name" json:"name,computed"` } -type PermissionGroupsMetaDataSourceModel struct { +type AccountPermissionGroupsMetaDataSourceModel struct { Key types.String `tfsdk:"key" json:"key,computed"` Value types.String `tfsdk:"value" json:"value,computed"` } diff --git a/internal/services/permission_group/list_data_source_schema.go b/internal/services/account_permission_group/list_data_source_schema.go similarity index 79% rename from internal/services/permission_group/list_data_source_schema.go rename to internal/services/account_permission_group/list_data_source_schema.go index b49280cbac..233967f4e7 100644 --- a/internal/services/permission_group/list_data_source_schema.go +++ b/internal/services/account_permission_group/list_data_source_schema.go @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -package permission_group +package account_permission_group import ( "context" @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/schema/validator" ) -var _ datasource.DataSourceWithConfigValidators = (*PermissionGroupsDataSource)(nil) +var _ datasource.DataSourceWithConfigValidators = (*AccountPermissionGroupsDataSource)(nil) func ListDataSourceSchema(ctx context.Context) schema.Schema { return schema.Schema{ @@ -43,7 +43,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { "result": schema.ListNestedAttribute{ Description: "The items returned by the data source", Computed: true, - CustomType: customfield.NewNestedObjectListType[PermissionGroupsResultDataSourceModel](ctx), + CustomType: customfield.NewNestedObjectListType[AccountPermissionGroupsResultDataSourceModel](ctx), NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -53,7 +53,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { "meta": schema.SingleNestedAttribute{ Description: "Attributes associated to the permission group.", Computed: true, - CustomType: customfield.NewNestedObjectType[PermissionGroupsMetaDataSourceModel](ctx), + CustomType: customfield.NewNestedObjectType[AccountPermissionGroupsMetaDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ Computed: true, @@ -74,10 +74,10 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { } } -func (d *PermissionGroupsDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { +func (d *AccountPermissionGroupsDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = ListDataSourceSchema(ctx) } -func (d *PermissionGroupsDataSource) ConfigValidators(_ context.Context) []datasource.ConfigValidator { +func (d *AccountPermissionGroupsDataSource) ConfigValidators(_ context.Context) []datasource.ConfigValidator { return []datasource.ConfigValidator{} } diff --git a/internal/services/api_token_permissions_groups/data_source_schema_test.go b/internal/services/account_permission_group/list_data_source_schema_test.go similarity index 55% rename from internal/services/api_token_permissions_groups/data_source_schema_test.go rename to internal/services/account_permission_group/list_data_source_schema_test.go index 6c7133ba32..b0d02ea83a 100644 --- a/internal/services/api_token_permissions_groups/data_source_schema_test.go +++ b/internal/services/account_permission_group/list_data_source_schema_test.go @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -package api_token_permissions_groups_test +package account_permission_group_test import ( "context" "testing" - "github.com/cloudflare/terraform-provider-cloudflare/internal/services/api_token_permissions_groups" + "github.com/cloudflare/terraform-provider-cloudflare/internal/services/account_permission_group" "github.com/cloudflare/terraform-provider-cloudflare/internal/test_helpers" ) -func TestAPITokenPermissionsGroupsDataSourceModelSchemaParity(t *testing.T) { +func TestAccountPermissionGroupsDataSourceModelSchemaParity(t *testing.T) { t.Parallel() - model := (*api_token_permissions_groups.APITokenPermissionsGroupsDataSourceModel)(nil) - schema := api_token_permissions_groups.DataSourceSchema(context.TODO()) + model := (*account_permission_group.AccountPermissionGroupsDataSourceModel)(nil) + schema := account_permission_group.ListDataSourceSchema(context.TODO()) errs := test_helpers.ValidateDataSourceModelSchemaIntegrity(model, schema) errs.Report(t) } diff --git a/internal/services/account_subscription/data_source_schema.go b/internal/services/account_subscription/data_source_schema.go index 6092039773..9f5d9625a9 100644 --- a/internal/services/account_subscription/data_source_schema.go +++ b/internal/services/account_subscription/data_source_schema.go @@ -38,7 +38,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "frequency": schema.StringAttribute{ - Description: "How often the subscription is renewed automatically.", + Description: "How often the subscription is renewed automatically.\nAvailable values: \"weekly\", \"monthly\", \"quarterly\", \"yearly\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -58,7 +58,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "state": schema.StringAttribute{ - Description: "The state that the subscription is in.", + Description: "The state that the subscription is in.\nAvailable values: \"Trial\", \"Provisioned\", \"Paid\", \"AwaitingPayment\", \"Cancelled\", \"Failed\", \"Expired\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -78,7 +78,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[AccountSubscriptionRatePlanDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ - Description: "The ID of the rate plan.", + Description: "The ID of the rate plan.\nAvailable values: \"free\", \"lite\", \"pro\", \"pro_plus\", \"business\", \"enterprise\", \"partners_free\", \"partners_pro\", \"partners_business\", \"partners_enterprise\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/account_subscription/schema.go b/internal/services/account_subscription/schema.go index 6df34539f9..be0049c36c 100644 --- a/internal/services/account_subscription/schema.go +++ b/internal/services/account_subscription/schema.go @@ -32,7 +32,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "frequency": schema.StringAttribute{ - Description: "How often the subscription is renewed automatically.", + Description: "How often the subscription is renewed automatically.\nAvailable values: \"weekly\", \"monthly\", \"quarterly\", \"yearly\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -50,7 +50,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[AccountSubscriptionRatePlanModel](ctx), Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ - Description: "The ID of the rate plan.", + Description: "The ID of the rate plan.\nAvailable values: \"free\", \"lite\", \"pro\", \"pro_plus\", \"business\", \"enterprise\", \"partners_free\", \"partners_pro\", \"partners_business\", \"partners_enterprise\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -117,7 +117,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "state": schema.StringAttribute{ - Description: "The state that the subscription is in.", + Description: "The state that the subscription is in.\nAvailable values: \"Trial\", \"Provisioned\", \"Paid\", \"AwaitingPayment\", \"Cancelled\", \"Failed\", \"Expired\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/account_token/data_source_schema.go b/internal/services/account_token/data_source_schema.go index 3d6cd83e07..b87c13ee6a 100644 --- a/internal/services/account_token/data_source_schema.go +++ b/internal/services/account_token/data_source_schema.go @@ -63,7 +63,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "status": schema.StringAttribute{ - Description: "Status of the token.", + Description: "Status of the token.\nAvailable values: \"active\", \"disabled\", \"expired\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -109,7 +109,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "effect": schema.StringAttribute{ - Description: "Allow or deny operations against the resources.", + Description: "Allow or deny operations against the resources.\nAvailable values: \"allow\", \"deny\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("allow", "deny"), @@ -158,7 +158,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "Direction to order results.", + Description: "Direction to order results.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), diff --git a/internal/services/account_token/list_data_source_schema.go b/internal/services/account_token/list_data_source_schema.go index 627dd09944..6450013234 100644 --- a/internal/services/account_token/list_data_source_schema.go +++ b/internal/services/account_token/list_data_source_schema.go @@ -25,7 +25,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "direction": schema.StringAttribute{ - Description: "Direction to order results.", + Description: "Direction to order results.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), @@ -113,7 +113,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "effect": schema.StringAttribute{ - Description: "Allow or deny operations against the resources.", + Description: "Allow or deny operations against the resources.\nAvailable values: \"allow\", \"deny\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("allow", "deny"), @@ -159,7 +159,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "status": schema.StringAttribute{ - Description: "Status of the token.", + Description: "Status of the token.\nAvailable values: \"active\", \"disabled\", \"expired\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/account_token/schema.go b/internal/services/account_token/schema.go index f3069622a3..5a597cd48d 100644 --- a/internal/services/account_token/schema.go +++ b/internal/services/account_token/schema.go @@ -45,7 +45,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "effect": schema.StringAttribute{ - Description: "Allow or deny operations against the resources.", + Description: "Allow or deny operations against the resources.\nAvailable values: \"allow\", \"deny\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("allow", "deny"), @@ -98,7 +98,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "status": schema.StringAttribute{ - Description: "Status of the token.", + Description: "Status of the token.\nAvailable values: \"active\", \"disabled\", \"expired\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -151,6 +151,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { "value": schema.StringAttribute{ Description: "The token value.", Computed: true, + Sensitive: true, }, }, } diff --git a/internal/services/address_map/data_source_schema.go b/internal/services/address_map/data_source_schema.go index 47e05636c4..068e6d2d10 100644 --- a/internal/services/address_map/data_source_schema.go +++ b/internal/services/address_map/data_source_schema.go @@ -94,7 +94,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "kind": schema.StringAttribute{ - Description: "The type of the membership.", + Description: "The type of the membership.\nAvailable values: \"zone\", \"account\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("zone", "account"), diff --git a/internal/services/address_map/schema.go b/internal/services/address_map/schema.go index 43e5a032c3..edcad47646 100644 --- a/internal/services/address_map/schema.go +++ b/internal/services/address_map/schema.go @@ -58,7 +58,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "kind": schema.StringAttribute{ - Description: "The type of the membership.", + Description: "The type of the membership.\nAvailable values: \"zone\", \"account\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("zone", "account"), diff --git a/internal/services/api_shield/data_source_model.go b/internal/services/api_shield/data_source_model.go index 3a7819a480..603e0508aa 100644 --- a/internal/services/api_shield/data_source_model.go +++ b/internal/services/api_shield/data_source_model.go @@ -23,8 +23,14 @@ type APIShieldDataSourceModel struct { } func (m *APIShieldDataSourceModel) toReadParams(_ context.Context) (params api_gateway.ConfigurationGetParams, diags diag.Diagnostics) { + mProperties := []api_gateway.ConfigurationGetParamsProperty{} + for _, item := range *m.Properties { + mProperties = append(mProperties, api_gateway.ConfigurationGetParamsProperty(item.ValueString())) + } + params = api_gateway.ConfigurationGetParams{ - ZoneID: cloudflare.F(m.ZoneID.ValueString()), + ZoneID: cloudflare.F(m.ZoneID.ValueString()), + Properties: cloudflare.F(mProperties), } return diff --git a/internal/services/api_shield/data_source_schema.go b/internal/services/api_shield/data_source_schema.go index a8c57746a7..e8bee77af2 100644 --- a/internal/services/api_shield/data_source_schema.go +++ b/internal/services/api_shield/data_source_schema.go @@ -43,7 +43,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The type of characteristic.", + Description: "The type of characteristic.\nAvailable values: \"header\", \"cookie\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/api_shield/schema.go b/internal/services/api_shield/schema.go index 9b87c38fb9..a5ab98d7bf 100644 --- a/internal/services/api_shield/schema.go +++ b/internal/services/api_shield/schema.go @@ -39,7 +39,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "type": schema.StringAttribute{ - Description: "The type of characteristic.", + Description: "The type of characteristic.\nAvailable values: \"header\", \"cookie\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/api_shield_discovery_operation/list_data_source_schema.go b/internal/services/api_shield_discovery_operation/list_data_source_schema.go index 6720516e84..ad96eb3a20 100644 --- a/internal/services/api_shield_discovery_operation/list_data_source_schema.go +++ b/internal/services/api_shield_discovery_operation/list_data_source_schema.go @@ -30,7 +30,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "direction": schema.StringAttribute{ - Description: "Direction to order results.", + Description: "Direction to order results.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), @@ -41,7 +41,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "order": schema.StringAttribute{ - Description: "Field to order by", + Description: "Field to order by\nAvailable values: \"host\", \"method\", \"endpoint\", \"traffic_stats.requests\", \"traffic_stats.last_updated\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -54,14 +54,14 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "origin": schema.StringAttribute{ - Description: "Filter results to only include discovery results sourced from a particular discovery engine\n * `ML` - Discovered operations that were sourced using ML API Discovery\n * `SessionIdentifier` - Discovered operations that were sourced using Session Identifier API Discovery\n", + Description: "Filter results to only include discovery results sourced from a particular discovery engine\n * `ML` - Discovered operations that were sourced using ML API Discovery\n * `SessionIdentifier` - Discovered operations that were sourced using Session Identifier API Discovery\nAvailable values: \"ML\", \"SessionIdentifier\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("ML", "SessionIdentifier"), }, }, "state": schema.StringAttribute{ - Description: "Filter results to only include discovery results in a particular state. States are as follows\n * `review` - Discovered operations that are not saved into API Shield Endpoint Management\n * `saved` - Discovered operations that are already saved into API Shield Endpoint Management\n * `ignored` - Discovered operations that have been marked as ignored\n", + Description: "Filter results to only include discovery results in a particular state. States are as follows\n * `review` - Discovered operations that are not saved into API Shield Endpoint Management\n * `saved` - Discovered operations that are already saved into API Shield Endpoint Management\n * `ignored` - Discovered operations that have been marked as ignored\nAvailable values: \"review\", \"saved\", \"ignored\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -111,7 +111,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "method": schema.StringAttribute{ - Description: "The HTTP method used to access the endpoint.", + Description: "The HTTP method used to access the endpoint.\nAvailable values: \"GET\", \"POST\", \"HEAD\", \"OPTIONS\", \"PUT\", \"DELETE\", \"CONNECT\", \"PATCH\", \"TRACE\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -139,7 +139,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "state": schema.StringAttribute{ - Description: "State of operation in API Discovery\n * `review` - Operation is not saved into API Shield Endpoint Management\n * `saved` - Operation is saved into API Shield Endpoint Management\n * `ignored` - Operation is marked as ignored\n", + Description: "State of operation in API Discovery\n * `review` - Operation is not saved into API Shield Endpoint Management\n * `saved` - Operation is saved into API Shield Endpoint Management\n * `ignored` - Operation is marked as ignored\nAvailable values: \"review\", \"saved\", \"ignored\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/api_shield_discovery_operation/schema.go b/internal/services/api_shield_discovery_operation/schema.go index ff8badae02..9a6fe0c019 100644 --- a/internal/services/api_shield_discovery_operation/schema.go +++ b/internal/services/api_shield_discovery_operation/schema.go @@ -34,7 +34,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "state": schema.StringAttribute{ - Description: "Mark state of operation in API Discovery\n * `review` - Mark operation as for review\n * `ignored` - Mark operation as ignored\n", + Description: "Mark state of operation in API Discovery\n * `review` - Mark operation as for review\n * `ignored` - Mark operation as ignored\nAvailable values: \"review\", \"ignored\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("review", "ignored"), diff --git a/internal/services/api_shield_operation/data_source_model.go b/internal/services/api_shield_operation/data_source_model.go index da6a9a63b6..33fa30d9d2 100644 --- a/internal/services/api_shield_operation/data_source_model.go +++ b/internal/services/api_shield_operation/data_source_model.go @@ -32,8 +32,14 @@ type APIShieldOperationDataSourceModel struct { } func (m *APIShieldOperationDataSourceModel) toReadParams(_ context.Context) (params api_gateway.OperationGetParams, diags diag.Diagnostics) { + mFeature := []api_gateway.OperationGetParamsFeature{} + for _, item := range *m.Feature { + mFeature = append(mFeature, api_gateway.OperationGetParamsFeature(item.ValueString())) + } + params = api_gateway.OperationGetParams{ - ZoneID: cloudflare.F(m.ZoneID.ValueString()), + ZoneID: cloudflare.F(m.ZoneID.ValueString()), + Feature: cloudflare.F(mFeature), } return diff --git a/internal/services/api_shield_operation/data_source_schema.go b/internal/services/api_shield_operation/data_source_schema.go index ea311dd9e0..2dd1c237d5 100644 --- a/internal/services/api_shield_operation/data_source_schema.go +++ b/internal/services/api_shield_operation/data_source_schema.go @@ -63,7 +63,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "method": schema.StringAttribute{ - Description: "The HTTP method used to access the endpoint.", + Description: "The HTTP method used to access the endpoint.\nAvailable values: \"GET\", \"POST\", \"HEAD\", \"OPTIONS\", \"PUT\", \"DELETE\", \"CONNECT\", \"PATCH\", \"TRACE\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -271,7 +271,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "mitigation_action": schema.StringAttribute{ - Description: "Action taken on requests failing validation.", + Description: "Action taken on requests failing validation.\nAvailable values: \"none\", \"log\", \"block\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -289,7 +289,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "Direction to order results.", + Description: "Direction to order results.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), @@ -324,7 +324,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "order": schema.StringAttribute{ - Description: "Field to order by. When requesting a feature, the feature keys are available for ordering as well, e.g., `thresholds.suggested_threshold`.", + Description: "Field to order by. When requesting a feature, the feature keys are available for ordering as well, e.g., `thresholds.suggested_threshold`.\nAvailable values: \"method\", \"host\", \"endpoint\", \"thresholds.$key\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/api_shield_operation/list_data_source_schema.go b/internal/services/api_shield_operation/list_data_source_schema.go index 7275a14511..2a3bff5039 100644 --- a/internal/services/api_shield_operation/list_data_source_schema.go +++ b/internal/services/api_shield_operation/list_data_source_schema.go @@ -27,7 +27,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "direction": schema.StringAttribute{ - Description: "Direction to order results.", + Description: "Direction to order results.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), @@ -38,7 +38,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "order": schema.StringAttribute{ - Description: "Field to order by. When requesting a feature, the feature keys are available for ordering as well, e.g., `thresholds.suggested_threshold`.", + Description: "Field to order by. When requesting a feature, the feature keys are available for ordering as well, e.g., `thresholds.suggested_threshold`.\nAvailable values: \"method\", \"host\", \"endpoint\", \"thresholds.$key\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -99,7 +99,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "method": schema.StringAttribute{ - Description: "The HTTP method used to access the endpoint.", + Description: "The HTTP method used to access the endpoint.\nAvailable values: \"GET\", \"POST\", \"HEAD\", \"OPTIONS\", \"PUT\", \"DELETE\", \"CONNECT\", \"PATCH\", \"TRACE\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -311,7 +311,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "mitigation_action": schema.StringAttribute{ - Description: "Action taken on requests failing validation.", + Description: "Action taken on requests failing validation.\nAvailable values: \"none\", \"log\", \"block\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/api_shield_operation/schema.go b/internal/services/api_shield_operation/schema.go index 874e39442f..8299503314 100644 --- a/internal/services/api_shield_operation/schema.go +++ b/internal/services/api_shield_operation/schema.go @@ -47,7 +47,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "method": schema.StringAttribute{ - Description: "The HTTP method used to access the endpoint.", + Description: "The HTTP method used to access the endpoint.\nAvailable values: \"GET\", \"POST\", \"HEAD\", \"OPTIONS\", \"PUT\", \"DELETE\", \"CONNECT\", \"PATCH\", \"TRACE\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -260,7 +260,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "mitigation_action": schema.StringAttribute{ - Description: "Action taken on requests failing validation.", + Description: "Action taken on requests failing validation.\nAvailable values: \"none\", \"log\", \"block\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/api_shield_operation_schema_validation_settings/data_source_schema.go b/internal/services/api_shield_operation_schema_validation_settings/data_source_schema.go index 2c9e1ff00c..7e2277c274 100644 --- a/internal/services/api_shield_operation_schema_validation_settings/data_source_schema.go +++ b/internal/services/api_shield_operation_schema_validation_settings/data_source_schema.go @@ -25,7 +25,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "mitigation_action": schema.StringAttribute{ - Description: "When set, this applies a mitigation action to this operation\n\n - `log` log request when request does not conform to schema for this operation\n - `block` deny access to the site when request does not conform to schema for this operation\n - `none` will skip mitigation for this operation\n - `null` indicates that no operation level mitigation is in place, see Zone Level Schema Validation Settings for mitigation action that will be applied\n", + Description: "When set, this applies a mitigation action to this operation\n\n - `log` log request when request does not conform to schema for this operation\n - `block` deny access to the site when request does not conform to schema for this operation\n - `none` will skip mitigation for this operation\n - `null` indicates that no operation level mitigation is in place, see Zone Level Schema Validation Settings for mitigation action that will be applied\nAvailable values: \"log\", \"block\", \"none\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/api_shield_operation_schema_validation_settings/schema.go b/internal/services/api_shield_operation_schema_validation_settings/schema.go index 791a440282..fe3b79665d 100644 --- a/internal/services/api_shield_operation_schema_validation_settings/schema.go +++ b/internal/services/api_shield_operation_schema_validation_settings/schema.go @@ -34,7 +34,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "mitigation_action": schema.StringAttribute{ - Description: "When set, this applies a mitigation action to this operation\n\n - `log` log request when request does not conform to schema for this operation\n - `block` deny access to the site when request does not conform to schema for this operation\n - `none` will skip mitigation for this operation\n - `null` indicates that no operation level mitigation is in place, see Zone Level Schema Validation Settings for mitigation action that will be applied\n", + Description: "When set, this applies a mitigation action to this operation\n\n - `log` log request when request does not conform to schema for this operation\n - `block` deny access to the site when request does not conform to schema for this operation\n - `none` will skip mitigation for this operation\n - `null` indicates that no operation level mitigation is in place, see Zone Level Schema Validation Settings for mitigation action that will be applied\nAvailable values: \"log\", \"block\", \"none\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/api_shield_schema/data_source_model.go b/internal/services/api_shield_schema/data_source_model.go index 1dfedb9aff..744b623177 100644 --- a/internal/services/api_shield_schema/data_source_model.go +++ b/internal/services/api_shield_schema/data_source_model.go @@ -17,8 +17,8 @@ type APIShieldSchemaResultDataSourceEnvelope struct { } type APIShieldSchemaDataSourceModel struct { + SchemaID types.String `tfsdk:"schema_id" path:"schema_id,required"` ZoneID types.String `tfsdk:"zone_id" path:"zone_id,required"` - SchemaID types.String `tfsdk:"schema_id" path:"schema_id,computed"` OmitSource types.Bool `tfsdk:"omit_source" query:"omit_source,computed_optional"` CreatedAt timetypes.RFC3339 `tfsdk:"created_at" json:"created_at,computed" format:"date-time"` Kind types.String `tfsdk:"kind" json:"kind,computed"` @@ -32,5 +32,9 @@ func (m *APIShieldSchemaDataSourceModel) toReadParams(_ context.Context) (params ZoneID: cloudflare.F(m.ZoneID.ValueString()), } + if !m.OmitSource.IsNull() { + params.OmitSource = cloudflare.F(m.OmitSource.ValueBool()) + } + return } diff --git a/internal/services/api_shield_schema/data_source_schema.go b/internal/services/api_shield_schema/data_source_schema.go index fa287a16ae..befd261df8 100644 --- a/internal/services/api_shield_schema/data_source_schema.go +++ b/internal/services/api_shield_schema/data_source_schema.go @@ -17,13 +17,13 @@ var _ datasource.DataSourceWithConfigValidators = (*APIShieldSchemaDataSource)(n func DataSourceSchema(ctx context.Context) schema.Schema { return schema.Schema{ Attributes: map[string]schema.Attribute{ + "schema_id": schema.StringAttribute{ + Required: true, + }, "zone_id": schema.StringAttribute{ Description: "Identifier", Required: true, }, - "schema_id": schema.StringAttribute{ - Computed: true, - }, "omit_source": schema.BoolAttribute{ Description: "Omit the source-files of schemas and only retrieve their meta-data.", Computed: true, @@ -34,7 +34,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "kind": schema.StringAttribute{ - Description: "Kind of schema", + Description: "Kind of schema\nAvailable values: \"openapi_v3\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("openapi_v3"), diff --git a/internal/services/api_shield_schema/list_data_source_schema.go b/internal/services/api_shield_schema/list_data_source_schema.go index 1a557f3b27..e877858745 100644 --- a/internal/services/api_shield_schema/list_data_source_schema.go +++ b/internal/services/api_shield_schema/list_data_source_schema.go @@ -50,7 +50,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "kind": schema.StringAttribute{ - Description: "Kind of schema", + Description: "Kind of schema\nAvailable values: \"openapi_v3\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("openapi_v3"), diff --git a/internal/services/api_shield_schema/schema.go b/internal/services/api_shield_schema/schema.go index be7f504b1e..72ce6da317 100644 --- a/internal/services/api_shield_schema/schema.go +++ b/internal/services/api_shield_schema/schema.go @@ -36,7 +36,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "kind": schema.StringAttribute{ - Description: "Kind of schema", + Description: "Kind of schema\nAvailable values: \"openapi_v3\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("openapi_v3"), @@ -49,7 +49,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "validation_enabled": schema.StringAttribute{ - Description: "Flag whether schema is enabled for validation.", + Description: "Flag whether schema is enabled for validation.\nAvailable values: \"true\", \"false\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("true", "false"), @@ -72,7 +72,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "kind": schema.StringAttribute{ - Description: "Kind of schema", + Description: "Kind of schema\nAvailable values: \"openapi_v3\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("openapi_v3"), diff --git a/internal/services/api_shield_schema_validation_settings/data_source_schema.go b/internal/services/api_shield_schema_validation_settings/data_source_schema.go index 4c5190bb6b..89db340a91 100644 --- a/internal/services/api_shield_schema_validation_settings/data_source_schema.go +++ b/internal/services/api_shield_schema_validation_settings/data_source_schema.go @@ -21,7 +21,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "validation_default_mitigation_action": schema.StringAttribute{ - Description: "The default mitigation action used when there is no mitigation action defined on the operation\n\nMitigation actions are as follows:\n\n * `log` - log request when request does not conform to schema\n * `block` - deny access to the site when request does not conform to schema\n\nA special value of of `none` will skip running schema validation entirely for the request when there is no mitigation action defined on the operation\n", + Description: "The default mitigation action used when there is no mitigation action defined on the operation\n\nMitigation actions are as follows:\n\n * `log` - log request when request does not conform to schema\n * `block` - deny access to the site when request does not conform to schema\n\nA special value of of `none` will skip running schema validation entirely for the request when there is no mitigation action defined on the operation\nAvailable values: \"none\", \"log\", \"block\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -32,7 +32,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "validation_override_mitigation_action": schema.StringAttribute{ - Description: "When set, this overrides both zone level and operation level mitigation actions.\n\n - `none` will skip running schema validation entirely for the request\n - `null` indicates that no override is in place\n", + Description: "When set, this overrides both zone level and operation level mitigation actions.\n\n - `none` will skip running schema validation entirely for the request\n - `null` indicates that no override is in place\nAvailable values: \"none\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("none"), diff --git a/internal/services/api_shield_schema_validation_settings/schema.go b/internal/services/api_shield_schema_validation_settings/schema.go index f0fb064c7d..68d66a6f95 100644 --- a/internal/services/api_shield_schema_validation_settings/schema.go +++ b/internal/services/api_shield_schema_validation_settings/schema.go @@ -29,7 +29,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown(), stringplanmodifier.RequiresReplace()}, }, "validation_default_mitigation_action": schema.StringAttribute{ - Description: "The default mitigation action used when there is no mitigation action defined on the operation\n\nMitigation actions are as follows:\n\n * `log` - log request when request does not conform to schema\n * `block` - deny access to the site when request does not conform to schema\n\nA special value of of `none` will skip running schema validation entirely for the request when there is no mitigation action defined on the operation\n", + Description: "The default mitigation action used when there is no mitigation action defined on the operation\n\nMitigation actions are as follows:\n\n * `log` - log request when request does not conform to schema\n * `block` - deny access to the site when request does not conform to schema\n\nA special value of of `none` will skip running schema validation entirely for the request when there is no mitigation action defined on the operation\nAvailable values: \"none\", \"log\", \"block\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -40,7 +40,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "validation_override_mitigation_action": schema.StringAttribute{ - Description: "When set, this overrides both zone level and operation level mitigation actions.\n\n - `none` will skip running schema validation entirely for the request\n - `null` indicates that no override is in place\n\nTo clear any override, use the special value `disable_override` or `null`\n", + Description: "When set, this overrides both zone level and operation level mitigation actions.\n\n - `none` will skip running schema validation entirely for the request\n - `null` indicates that no override is in place\n\nTo clear any override, use the special value `disable_override` or `null`\nAvailable values: \"none\", \"disable_override\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("none", "disable_override"), diff --git a/internal/services/api_token/data_source_schema.go b/internal/services/api_token/data_source_schema.go index 8f513507d2..393dc8be38 100644 --- a/internal/services/api_token/data_source_schema.go +++ b/internal/services/api_token/data_source_schema.go @@ -59,7 +59,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "status": schema.StringAttribute{ - Description: "Status of the token.", + Description: "Status of the token.\nAvailable values: \"active\", \"disabled\", \"expired\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -105,7 +105,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "effect": schema.StringAttribute{ - Description: "Allow or deny operations against the resources.", + Description: "Allow or deny operations against the resources.\nAvailable values: \"allow\", \"deny\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("allow", "deny"), @@ -154,7 +154,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "Direction to order results.", + Description: "Direction to order results.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), diff --git a/internal/services/api_token/list_data_source_schema.go b/internal/services/api_token/list_data_source_schema.go index 388baa89de..663f91d735 100644 --- a/internal/services/api_token/list_data_source_schema.go +++ b/internal/services/api_token/list_data_source_schema.go @@ -21,7 +21,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { return schema.Schema{ Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "Direction to order results.", + Description: "Direction to order results.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), @@ -109,7 +109,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "effect": schema.StringAttribute{ - Description: "Allow or deny operations against the resources.", + Description: "Allow or deny operations against the resources.\nAvailable values: \"allow\", \"deny\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("allow", "deny"), @@ -155,7 +155,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "status": schema.StringAttribute{ - Description: "Status of the token.", + Description: "Status of the token.\nAvailable values: \"active\", \"disabled\", \"expired\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/api_token/resource.go b/internal/services/api_token/resource.go index a3f9bcc96d..a81d799a07 100644 --- a/internal/services/api_token/resource.go +++ b/internal/services/api_token/resource.go @@ -149,6 +149,8 @@ func (r *APITokenResource) Read(ctx context.Context, req resource.ReadRequest, r return } + token := data.Value + res := new(http.Response) env := APITokenResultEnvelope{*data} _, err := r.client.User.Tokens.Get( @@ -173,6 +175,7 @@ func (r *APITokenResource) Read(ctx context.Context, req resource.ReadRequest, r return } data = &env.Result + data.Value = token resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } diff --git a/internal/services/api_token/schema.go b/internal/services/api_token/schema.go index e667c4ed85..afa2b1cf3c 100644 --- a/internal/services/api_token/schema.go +++ b/internal/services/api_token/schema.go @@ -40,7 +40,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "effect": schema.StringAttribute{ - Description: "Allow or deny operations against the resources.", + Description: "Allow or deny operations against the resources.\nAvailable values: \"allow\", \"deny\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("allow", "deny"), @@ -93,7 +93,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "status": schema.StringAttribute{ - Description: "Status of the token.", + Description: "Status of the token.\nAvailable values: \"active\", \"disabled\", \"expired\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -146,6 +146,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { "value": schema.StringAttribute{ Description: "The token value.", Computed: true, + Sensitive: true, }, }, } diff --git a/internal/services/api_token_permission_groups/list_data_source.go b/internal/services/api_token_permission_groups/list_data_source.go new file mode 100644 index 0000000000..102023035f --- /dev/null +++ b/internal/services/api_token_permission_groups/list_data_source.go @@ -0,0 +1,94 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package api_token_permission_groups + +import ( + "context" + "fmt" + + "github.com/cloudflare/cloudflare-go/v4" + "github.com/cloudflare/terraform-provider-cloudflare/internal/apijson" + "github.com/cloudflare/terraform-provider-cloudflare/internal/customfield" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/datasource" +) + +type APITokenPermissionGroupsListDataSource struct { + client *cloudflare.Client +} + +var _ datasource.DataSourceWithConfigure = (*APITokenPermissionGroupsListDataSource)(nil) + +func NewAPITokenPermissionGroupsListDataSource() datasource.DataSource { + return &APITokenPermissionGroupsListDataSource{} +} + +func (d *APITokenPermissionGroupsListDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_api_token_permission_groups_list" +} + +func (d *APITokenPermissionGroupsListDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(*cloudflare.Client) + + if !ok { + resp.Diagnostics.AddError( + "unexpected resource configure type", + fmt.Sprintf("Expected *cloudflare.Client, got: %T. Please report this issue to the provider developers.", req.ProviderData), + ) + + return + } + + d.client = client +} + +func (d *APITokenPermissionGroupsListDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var data *APITokenPermissionGroupsListDataSourceModel + + resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + env := APITokenPermissionGroupsListResultListDataSourceEnvelope{} + maxItems := int(data.MaxItems.ValueInt64()) + acc := []attr.Value{} + if maxItems <= 0 { + maxItems = 1000 + } + page, err := d.client.User.Tokens.PermissionGroups.List(ctx) + if err != nil { + resp.Diagnostics.AddError("failed to make http request", err.Error()) + return + } + + for page != nil && len(page.Result) > 0 { + bytes := []byte(page.JSON.RawJSON()) + err = apijson.UnmarshalComputed(bytes, &env) + if err != nil { + resp.Diagnostics.AddError("failed to unmarshal http request", err.Error()) + return + } + acc = append(acc, env.Result.Elements()...) + if len(acc) >= maxItems { + break + } + page, err = page.GetNextPage() + if err != nil { + resp.Diagnostics.AddError("failed to fetch next page", err.Error()) + return + } + } + + acc = acc[:min(len(acc), maxItems)] + result, diags := customfield.NewObjectListFromAttributes[APITokenPermissionGroupsListResultDataSourceModel](ctx, acc) + resp.Diagnostics.Append(diags...) + data.Result = result + + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) +} diff --git a/internal/services/api_token_permission_groups/list_data_source_model.go b/internal/services/api_token_permission_groups/list_data_source_model.go new file mode 100644 index 0000000000..946b47b90e --- /dev/null +++ b/internal/services/api_token_permission_groups/list_data_source_model.go @@ -0,0 +1,23 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package api_token_permission_groups + +import ( + "github.com/cloudflare/terraform-provider-cloudflare/internal/customfield" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +type APITokenPermissionGroupsListResultListDataSourceEnvelope struct { + Result customfield.NestedObjectList[APITokenPermissionGroupsListResultDataSourceModel] `json:"result,computed"` +} + +type APITokenPermissionGroupsListDataSourceModel struct { + MaxItems types.Int64 `tfsdk:"max_items"` + Result customfield.NestedObjectList[APITokenPermissionGroupsListResultDataSourceModel] `tfsdk:"result"` +} + +type APITokenPermissionGroupsListResultDataSourceModel struct { + ID types.String `tfsdk:"id" json:"id,computed"` + Name types.String `tfsdk:"name" json:"name,computed"` + Scopes customfield.List[types.String] `tfsdk:"scopes" json:"scopes,computed"` +} diff --git a/internal/services/api_token_permissions_groups/list_data_source_schema.go b/internal/services/api_token_permission_groups/list_data_source_schema.go similarity index 82% rename from internal/services/api_token_permissions_groups/list_data_source_schema.go rename to internal/services/api_token_permission_groups/list_data_source_schema.go index 95088e92fb..57da38bf89 100644 --- a/internal/services/api_token_permissions_groups/list_data_source_schema.go +++ b/internal/services/api_token_permission_groups/list_data_source_schema.go @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -package api_token_permissions_groups +package api_token_permission_groups import ( "context" @@ -15,15 +15,11 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) -var _ datasource.DataSourceWithConfigValidators = (*APITokenPermissionsGroupsListDataSource)(nil) +var _ datasource.DataSourceWithConfigValidators = (*APITokenPermissionGroupsListDataSource)(nil) func ListDataSourceSchema(ctx context.Context) schema.Schema { return schema.Schema{ Attributes: map[string]schema.Attribute{ - "account_id": schema.StringAttribute{ - Description: "Account identifier tag.", - Required: true, - }, "max_items": schema.Int64Attribute{ Description: "Max items to fetch, default: 1000", Optional: true, @@ -34,7 +30,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { "result": schema.ListNestedAttribute{ Description: "The items returned by the data source", Computed: true, - CustomType: customfield.NewNestedObjectListType[APITokenPermissionsGroupsListResultDataSourceModel](ctx), + CustomType: customfield.NewNestedObjectListType[APITokenPermissionGroupsListResultDataSourceModel](ctx), NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -68,10 +64,10 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { } } -func (d *APITokenPermissionsGroupsListDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { +func (d *APITokenPermissionGroupsListDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = ListDataSourceSchema(ctx) } -func (d *APITokenPermissionsGroupsListDataSource) ConfigValidators(_ context.Context) []datasource.ConfigValidator { +func (d *APITokenPermissionGroupsListDataSource) ConfigValidators(_ context.Context) []datasource.ConfigValidator { return []datasource.ConfigValidator{} } diff --git a/internal/services/permission_group/list_data_source_schema_test.go b/internal/services/api_token_permission_groups/list_data_source_schema_test.go similarity index 53% rename from internal/services/permission_group/list_data_source_schema_test.go rename to internal/services/api_token_permission_groups/list_data_source_schema_test.go index 46296cf3ca..58d8dba744 100644 --- a/internal/services/permission_group/list_data_source_schema_test.go +++ b/internal/services/api_token_permission_groups/list_data_source_schema_test.go @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -package permission_group_test +package api_token_permission_groups_test import ( "context" "testing" - "github.com/cloudflare/terraform-provider-cloudflare/internal/services/permission_group" + "github.com/cloudflare/terraform-provider-cloudflare/internal/services/api_token_permission_groups" "github.com/cloudflare/terraform-provider-cloudflare/internal/test_helpers" ) -func TestPermissionGroupsDataSourceModelSchemaParity(t *testing.T) { +func TestAPITokenPermissionGroupsListDataSourceModelSchemaParity(t *testing.T) { t.Parallel() - model := (*permission_group.PermissionGroupsDataSourceModel)(nil) - schema := permission_group.ListDataSourceSchema(context.TODO()) + model := (*api_token_permission_groups.APITokenPermissionGroupsListDataSourceModel)(nil) + schema := api_token_permission_groups.ListDataSourceSchema(context.TODO()) errs := test_helpers.ValidateDataSourceModelSchemaIntegrity(model, schema) errs.Report(t) } diff --git a/internal/services/argo_smart_routing/schema.go b/internal/services/argo_smart_routing/schema.go index 574759efb0..43d7deb0d2 100644 --- a/internal/services/argo_smart_routing/schema.go +++ b/internal/services/argo_smart_routing/schema.go @@ -29,7 +29,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown(), stringplanmodifier.RequiresReplace()}, }, "value": schema.StringAttribute{ - Description: "Enables Argo Smart Routing.", + Description: "Enables Argo Smart Routing.\nAvailable values: \"on\", \"off\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("on", "off"), diff --git a/internal/services/argo_tiered_caching/data_source_schema.go b/internal/services/argo_tiered_caching/data_source_schema.go index 41d7382544..501d0af2f3 100644 --- a/internal/services/argo_tiered_caching/data_source_schema.go +++ b/internal/services/argo_tiered_caching/data_source_schema.go @@ -26,7 +26,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "id": schema.StringAttribute{ - Description: "ID of the zone setting.", + Description: "ID of the zone setting.\nAvailable values: \"tiered_caching\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("tiered_caching"), @@ -38,7 +38,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "value": schema.StringAttribute{ - Description: "The value of the feature", + Description: "The value of the feature\nAvailable values: \"on\", \"off\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("on", "off"), diff --git a/internal/services/argo_tiered_caching/schema.go b/internal/services/argo_tiered_caching/schema.go index 7fe91943ca..b94d235cff 100644 --- a/internal/services/argo_tiered_caching/schema.go +++ b/internal/services/argo_tiered_caching/schema.go @@ -30,7 +30,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown(), stringplanmodifier.RequiresReplace()}, }, "value": schema.StringAttribute{ - Description: "Enables Tiered Caching.", + Description: "Enables Tiered Caching.\nAvailable values: \"on\", \"off\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("on", "off"), diff --git a/internal/services/authenticated_origin_pulls/data_source_model.go b/internal/services/authenticated_origin_pulls/data_source_model.go index 67f7e773c0..b4b8c3d2d6 100644 --- a/internal/services/authenticated_origin_pulls/data_source_model.go +++ b/internal/services/authenticated_origin_pulls/data_source_model.go @@ -17,8 +17,8 @@ type AuthenticatedOriginPullsResultDataSourceEnvelope struct { } type AuthenticatedOriginPullsDataSourceModel struct { + Hostname types.String `tfsdk:"hostname" path:"hostname,required"` ZoneID types.String `tfsdk:"zone_id" path:"zone_id,required"` - Hostname types.String `tfsdk:"hostname" path:"hostname,computed"` CERTID types.String `tfsdk:"cert_id" json:"cert_id,computed"` CERTStatus types.String `tfsdk:"cert_status" json:"cert_status,computed"` CERTUpdatedAt timetypes.RFC3339 `tfsdk:"cert_updated_at" json:"cert_updated_at,computed" format:"date-time"` diff --git a/internal/services/authenticated_origin_pulls/data_source_schema.go b/internal/services/authenticated_origin_pulls/data_source_schema.go index d654603cee..e5ae01491b 100644 --- a/internal/services/authenticated_origin_pulls/data_source_schema.go +++ b/internal/services/authenticated_origin_pulls/data_source_schema.go @@ -17,20 +17,20 @@ var _ datasource.DataSourceWithConfigValidators = (*AuthenticatedOriginPullsData func DataSourceSchema(ctx context.Context) schema.Schema { return schema.Schema{ Attributes: map[string]schema.Attribute{ + "hostname": schema.StringAttribute{ + Description: "The hostname on the origin for which the client certificate uploaded will be used.", + Required: true, + }, "zone_id": schema.StringAttribute{ Description: "Identifier", Required: true, }, - "hostname": schema.StringAttribute{ - Description: "The hostname on the origin for which the client certificate uploaded will be used.", - Computed: true, - }, "cert_id": schema.StringAttribute{ Description: "Identifier", Computed: true, }, "cert_status": schema.StringAttribute{ - Description: "Status of the certificate or the association.", + Description: "Status of the certificate or the association.\nAvailable values: \"initializing\", \"pending_deployment\", \"pending_deletion\", \"active\", \"deleted\", \"deployment_timed_out\", \"deletion_timed_out\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -85,7 +85,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Status of the certificate or the association.", + Description: "Status of the certificate or the association.\nAvailable values: \"initializing\", \"pending_deployment\", \"pending_deletion\", \"active\", \"deleted\", \"deployment_timed_out\", \"deletion_timed_out\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/authenticated_origin_pulls/schema.go b/internal/services/authenticated_origin_pulls/schema.go index 624de3beaf..3128d066d8 100644 --- a/internal/services/authenticated_origin_pulls/schema.go +++ b/internal/services/authenticated_origin_pulls/schema.go @@ -55,7 +55,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "cert_status": schema.StringAttribute{ - Description: "Status of the certificate or the association.", + Description: "Status of the certificate or the association.\nAvailable values: \"initializing\", \"pending_deployment\", \"pending_deletion\", \"active\", \"deleted\", \"deployment_timed_out\", \"deletion_timed_out\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -118,7 +118,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Status of the certificate or the association.", + Description: "Status of the certificate or the association.\nAvailable values: \"initializing\", \"pending_deployment\", \"pending_deletion\", \"active\", \"deleted\", \"deployment_timed_out\", \"deletion_timed_out\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/authenticated_origin_pulls_certificate/data_source_schema.go b/internal/services/authenticated_origin_pulls_certificate/data_source_schema.go index 63d4f4c788..eabbab1d28 100644 --- a/internal/services/authenticated_origin_pulls_certificate/data_source_schema.go +++ b/internal/services/authenticated_origin_pulls_certificate/data_source_schema.go @@ -55,7 +55,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Status of the certificate activation.", + Description: "Status of the certificate activation.\nAvailable values: \"initializing\", \"pending_deployment\", \"pending_deletion\", \"active\", \"deleted\", \"deployment_timed_out\", \"deletion_timed_out\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/authenticated_origin_pulls_certificate/list_data_source_schema.go b/internal/services/authenticated_origin_pulls_certificate/list_data_source_schema.go index 888d6f3ae5..0587af0afa 100644 --- a/internal/services/authenticated_origin_pulls_certificate/list_data_source_schema.go +++ b/internal/services/authenticated_origin_pulls_certificate/list_data_source_schema.go @@ -58,7 +58,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Status of the certificate activation.", + Description: "Status of the certificate activation.\nAvailable values: \"initializing\", \"pending_deployment\", \"pending_deletion\", \"active\", \"deleted\", \"deployment_timed_out\", \"deletion_timed_out\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/authenticated_origin_pulls_certificate/schema.go b/internal/services/authenticated_origin_pulls_certificate/schema.go index bbeedca7b9..88b3965531 100644 --- a/internal/services/authenticated_origin_pulls_certificate/schema.go +++ b/internal/services/authenticated_origin_pulls_certificate/schema.go @@ -61,7 +61,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Status of the certificate activation.", + Description: "Status of the certificate activation.\nAvailable values: \"initializing\", \"pending_deployment\", \"pending_deletion\", \"active\", \"deleted\", \"deployment_timed_out\", \"deletion_timed_out\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/authenticated_origin_pulls_settings/data_source.go b/internal/services/authenticated_origin_pulls_settings/data_source.go new file mode 100644 index 0000000000..5ed63ffa5a --- /dev/null +++ b/internal/services/authenticated_origin_pulls_settings/data_source.go @@ -0,0 +1,87 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package authenticated_origin_pulls_settings + +import ( + "context" + "fmt" + "io" + "net/http" + + "github.com/cloudflare/cloudflare-go/v4" + "github.com/cloudflare/cloudflare-go/v4/option" + "github.com/cloudflare/terraform-provider-cloudflare/internal/apijson" + "github.com/cloudflare/terraform-provider-cloudflare/internal/logging" + "github.com/hashicorp/terraform-plugin-framework/datasource" +) + +type AuthenticatedOriginPullsSettingsDataSource struct { + client *cloudflare.Client +} + +var _ datasource.DataSourceWithConfigure = (*AuthenticatedOriginPullsSettingsDataSource)(nil) + +func NewAuthenticatedOriginPullsSettingsDataSource() datasource.DataSource { + return &AuthenticatedOriginPullsSettingsDataSource{} +} + +func (d *AuthenticatedOriginPullsSettingsDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_authenticated_origin_pulls_settings" +} + +func (d *AuthenticatedOriginPullsSettingsDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(*cloudflare.Client) + + if !ok { + resp.Diagnostics.AddError( + "unexpected resource configure type", + fmt.Sprintf("Expected *cloudflare.Client, got: %T. Please report this issue to the provider developers.", req.ProviderData), + ) + + return + } + + d.client = client +} + +func (d *AuthenticatedOriginPullsSettingsDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var data *AuthenticatedOriginPullsSettingsDataSourceModel + + resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + params, diags := data.toReadParams(ctx) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + res := new(http.Response) + env := AuthenticatedOriginPullsSettingsResultDataSourceEnvelope{*data} + _, err := d.client.OriginTLSClientAuth.Settings.Get( + ctx, + params, + option.WithResponseBodyInto(&res), + option.WithMiddleware(logging.Middleware(ctx)), + ) + if err != nil { + resp.Diagnostics.AddError("failed to make http request", err.Error()) + return + } + bytes, _ := io.ReadAll(res.Body) + err = apijson.UnmarshalComputed(bytes, &env) + if err != nil { + resp.Diagnostics.AddError("failed to deserialize http request", err.Error()) + return + } + data = &env.Result + + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) +} diff --git a/internal/services/authenticated_origin_pulls_settings/data_source_model.go b/internal/services/authenticated_origin_pulls_settings/data_source_model.go new file mode 100644 index 0000000000..f2d98a0e4d --- /dev/null +++ b/internal/services/authenticated_origin_pulls_settings/data_source_model.go @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package authenticated_origin_pulls_settings + +import ( + "context" + + "github.com/cloudflare/cloudflare-go/v4" + "github.com/cloudflare/cloudflare-go/v4/origin_tls_client_auth" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +type AuthenticatedOriginPullsSettingsResultDataSourceEnvelope struct { + Result AuthenticatedOriginPullsSettingsDataSourceModel `json:"result,computed"` +} + +type AuthenticatedOriginPullsSettingsDataSourceModel struct { + ZoneID types.String `tfsdk:"zone_id" path:"zone_id,required"` + Enabled types.Bool `tfsdk:"enabled" json:"enabled,computed"` +} + +func (m *AuthenticatedOriginPullsSettingsDataSourceModel) toReadParams(_ context.Context) (params origin_tls_client_auth.SettingGetParams, diags diag.Diagnostics) { + params = origin_tls_client_auth.SettingGetParams{ + ZoneID: cloudflare.F(m.ZoneID.ValueString()), + } + + return +} diff --git a/internal/services/authenticated_origin_pulls_settings/data_source_schema.go b/internal/services/authenticated_origin_pulls_settings/data_source_schema.go new file mode 100644 index 0000000000..9eb9a65784 --- /dev/null +++ b/internal/services/authenticated_origin_pulls_settings/data_source_schema.go @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package authenticated_origin_pulls_settings + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" +) + +var _ datasource.DataSourceWithConfigValidators = (*AuthenticatedOriginPullsSettingsDataSource)(nil) + +func DataSourceSchema(ctx context.Context) schema.Schema { + return schema.Schema{ + Attributes: map[string]schema.Attribute{ + "zone_id": schema.StringAttribute{ + Description: "Identifier", + Required: true, + }, + "enabled": schema.BoolAttribute{ + Description: "Indicates whether zone-level authenticated origin pulls is enabled.", + Computed: true, + }, + }, + } +} + +func (d *AuthenticatedOriginPullsSettingsDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { + resp.Schema = DataSourceSchema(ctx) +} + +func (d *AuthenticatedOriginPullsSettingsDataSource) ConfigValidators(_ context.Context) []datasource.ConfigValidator { + return []datasource.ConfigValidator{} +} diff --git a/internal/services/authenticated_origin_pulls_settings/data_source_schema_test.go b/internal/services/authenticated_origin_pulls_settings/data_source_schema_test.go new file mode 100644 index 0000000000..2bbb0ac421 --- /dev/null +++ b/internal/services/authenticated_origin_pulls_settings/data_source_schema_test.go @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package authenticated_origin_pulls_settings_test + +import ( + "context" + "testing" + + "github.com/cloudflare/terraform-provider-cloudflare/internal/services/authenticated_origin_pulls_settings" + "github.com/cloudflare/terraform-provider-cloudflare/internal/test_helpers" +) + +func TestAuthenticatedOriginPullsSettingsDataSourceModelSchemaParity(t *testing.T) { + t.Parallel() + model := (*authenticated_origin_pulls_settings.AuthenticatedOriginPullsSettingsDataSourceModel)(nil) + schema := authenticated_origin_pulls_settings.DataSourceSchema(context.TODO()) + errs := test_helpers.ValidateDataSourceModelSchemaIntegrity(model, schema) + errs.Report(t) +} diff --git a/internal/services/authenticated_origin_pulls_settings/migrations.go b/internal/services/authenticated_origin_pulls_settings/migrations.go new file mode 100644 index 0000000000..3ae39e125f --- /dev/null +++ b/internal/services/authenticated_origin_pulls_settings/migrations.go @@ -0,0 +1,15 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package authenticated_origin_pulls_settings + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/resource" +) + +var _ resource.ResourceWithUpgradeState = (*AuthenticatedOriginPullsSettingsResource)(nil) + +func (r *AuthenticatedOriginPullsSettingsResource) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader { + return map[int64]resource.StateUpgrader{} +} diff --git a/internal/services/authenticated_origin_pulls_settings/model.go b/internal/services/authenticated_origin_pulls_settings/model.go new file mode 100644 index 0000000000..d36d95ea14 --- /dev/null +++ b/internal/services/authenticated_origin_pulls_settings/model.go @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package authenticated_origin_pulls_settings + +import ( + "github.com/cloudflare/terraform-provider-cloudflare/internal/apijson" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +type AuthenticatedOriginPullsSettingsResultEnvelope struct { + Result AuthenticatedOriginPullsSettingsModel `json:"result"` +} + +type AuthenticatedOriginPullsSettingsModel struct { + ZoneID types.String `tfsdk:"zone_id" path:"zone_id,required"` + Enabled types.Bool `tfsdk:"enabled" json:"enabled,required"` +} + +func (m AuthenticatedOriginPullsSettingsModel) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(m) +} + +func (m AuthenticatedOriginPullsSettingsModel) MarshalJSONForUpdate(state AuthenticatedOriginPullsSettingsModel) (data []byte, err error) { + return apijson.MarshalForUpdate(m, state) +} diff --git a/internal/services/authenticated_origin_pulls_settings/resource.go b/internal/services/authenticated_origin_pulls_settings/resource.go new file mode 100644 index 0000000000..4212280273 --- /dev/null +++ b/internal/services/authenticated_origin_pulls_settings/resource.go @@ -0,0 +1,202 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package authenticated_origin_pulls_settings + +import ( + "context" + "fmt" + "io" + "net/http" + + "github.com/cloudflare/cloudflare-go/v4" + "github.com/cloudflare/cloudflare-go/v4/option" + "github.com/cloudflare/cloudflare-go/v4/origin_tls_client_auth" + "github.com/cloudflare/terraform-provider-cloudflare/internal/apijson" + "github.com/cloudflare/terraform-provider-cloudflare/internal/logging" + "github.com/hashicorp/terraform-plugin-framework/resource" +) + +// Ensure provider defined types fully satisfy framework interfaces. +var _ resource.ResourceWithConfigure = (*AuthenticatedOriginPullsSettingsResource)(nil) +var _ resource.ResourceWithModifyPlan = (*AuthenticatedOriginPullsSettingsResource)(nil) + +func NewResource() resource.Resource { + return &AuthenticatedOriginPullsSettingsResource{} +} + +// AuthenticatedOriginPullsSettingsResource defines the resource implementation. +type AuthenticatedOriginPullsSettingsResource struct { + client *cloudflare.Client +} + +func (r *AuthenticatedOriginPullsSettingsResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_authenticated_origin_pulls_settings" +} + +func (r *AuthenticatedOriginPullsSettingsResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(*cloudflare.Client) + + if !ok { + resp.Diagnostics.AddError( + "unexpected resource configure type", + fmt.Sprintf("Expected *cloudflare.Client, got: %T. Please report this issue to the provider developers.", req.ProviderData), + ) + + return + } + + r.client = client +} + +func (r *AuthenticatedOriginPullsSettingsResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var data *AuthenticatedOriginPullsSettingsModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + dataBytes, err := data.MarshalJSON() + if err != nil { + resp.Diagnostics.AddError("failed to serialize http request", err.Error()) + return + } + res := new(http.Response) + env := AuthenticatedOriginPullsSettingsResultEnvelope{*data} + _, err = r.client.OriginTLSClientAuth.Settings.Update( + ctx, + origin_tls_client_auth.SettingUpdateParams{ + ZoneID: cloudflare.F(data.ZoneID.ValueString()), + }, + option.WithRequestBody("application/json", dataBytes), + option.WithResponseBodyInto(&res), + option.WithMiddleware(logging.Middleware(ctx)), + ) + if err != nil { + resp.Diagnostics.AddError("failed to make http request", err.Error()) + return + } + bytes, _ := io.ReadAll(res.Body) + err = apijson.UnmarshalComputed(bytes, &env) + if err != nil { + resp.Diagnostics.AddError("failed to deserialize http request", err.Error()) + return + } + data = &env.Result + + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) +} + +func (r *AuthenticatedOriginPullsSettingsResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var data *AuthenticatedOriginPullsSettingsModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + var state *AuthenticatedOriginPullsSettingsModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + + if resp.Diagnostics.HasError() { + return + } + + dataBytes, err := data.MarshalJSONForUpdate(*state) + if err != nil { + resp.Diagnostics.AddError("failed to serialize http request", err.Error()) + return + } + res := new(http.Response) + env := AuthenticatedOriginPullsSettingsResultEnvelope{*data} + _, err = r.client.OriginTLSClientAuth.Settings.Update( + ctx, + origin_tls_client_auth.SettingUpdateParams{ + ZoneID: cloudflare.F(data.ZoneID.ValueString()), + }, + option.WithRequestBody("application/json", dataBytes), + option.WithResponseBodyInto(&res), + option.WithMiddleware(logging.Middleware(ctx)), + ) + if err != nil { + resp.Diagnostics.AddError("failed to make http request", err.Error()) + return + } + bytes, _ := io.ReadAll(res.Body) + err = apijson.UnmarshalComputed(bytes, &env) + if err != nil { + resp.Diagnostics.AddError("failed to deserialize http request", err.Error()) + return + } + data = &env.Result + + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) +} + +func (r *AuthenticatedOriginPullsSettingsResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var data *AuthenticatedOriginPullsSettingsModel + + resp.Diagnostics.Append(req.State.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + res := new(http.Response) + env := AuthenticatedOriginPullsSettingsResultEnvelope{*data} + _, err := r.client.OriginTLSClientAuth.Settings.Get( + ctx, + origin_tls_client_auth.SettingGetParams{ + ZoneID: cloudflare.F(data.ZoneID.ValueString()), + }, + option.WithResponseBodyInto(&res), + option.WithMiddleware(logging.Middleware(ctx)), + ) + if res != nil && res.StatusCode == 404 { + resp.Diagnostics.AddWarning("Resource not found", "The resource was not found on the server and will be removed from state.") + resp.State.RemoveResource(ctx) + return + } + if err != nil { + resp.Diagnostics.AddError("failed to make http request", err.Error()) + return + } + bytes, _ := io.ReadAll(res.Body) + err = apijson.UnmarshalComputed(bytes, &env) + if err != nil { + resp.Diagnostics.AddError("failed to deserialize http request", err.Error()) + return + } + data = &env.Result + + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) +} + +func (r *AuthenticatedOriginPullsSettingsResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + +} + +func (r *AuthenticatedOriginPullsSettingsResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { + if req.State.Raw.IsNull() { + resp.Diagnostics.AddWarning( + "Resource Destruction Considerations", + "This resource cannot be destroyed from Terraform. If you create this resource, it will be "+ + "present in the API until manually deleted.", + ) + } + if req.Plan.Raw.IsNull() { + resp.Diagnostics.AddWarning( + "Resource Destruction Considerations", + "Applying this resource destruction will remove the resource from the Terraform state "+ + "but will not change it in the API. If you would like to destroy or reset this resource "+ + "in the API, refer to the documentation for how to do it manually.", + ) + } +} diff --git a/internal/services/authenticated_origin_pulls_settings/resource_schema_test.go b/internal/services/authenticated_origin_pulls_settings/resource_schema_test.go new file mode 100644 index 0000000000..c23adf0ed6 --- /dev/null +++ b/internal/services/authenticated_origin_pulls_settings/resource_schema_test.go @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package authenticated_origin_pulls_settings_test + +import ( + "context" + "testing" + + "github.com/cloudflare/terraform-provider-cloudflare/internal/services/authenticated_origin_pulls_settings" + "github.com/cloudflare/terraform-provider-cloudflare/internal/test_helpers" +) + +func TestAuthenticatedOriginPullsSettingsModelSchemaParity(t *testing.T) { + t.Parallel() + model := (*authenticated_origin_pulls_settings.AuthenticatedOriginPullsSettingsModel)(nil) + schema := authenticated_origin_pulls_settings.ResourceSchema(context.TODO()) + errs := test_helpers.ValidateResourceModelSchemaIntegrity(model, schema) + errs.Report(t) +} diff --git a/internal/services/authenticated_origin_pulls_settings/schema.go b/internal/services/authenticated_origin_pulls_settings/schema.go new file mode 100644 index 0000000000..14ba904d99 --- /dev/null +++ b/internal/services/authenticated_origin_pulls_settings/schema.go @@ -0,0 +1,40 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package authenticated_origin_pulls_settings + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" +) + +var _ resource.ResourceWithConfigValidators = (*AuthenticatedOriginPullsSettingsResource)(nil) + +func ResourceSchema(ctx context.Context) schema.Schema { + return schema.Schema{ + Attributes: map[string]schema.Attribute{ + "zone_id": schema.StringAttribute{ + Description: "Identifier", + Required: true, + PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, + }, + "enabled": schema.BoolAttribute{ + Description: "Indicates whether zone-level authenticated origin pulls is enabled.", + Required: true, + PlanModifiers: []planmodifier.Bool{boolplanmodifier.RequiresReplace()}, + }, + }, + } +} + +func (r *AuthenticatedOriginPullsSettingsResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = ResourceSchema(ctx) +} + +func (r *AuthenticatedOriginPullsSettingsResource) ConfigValidators(_ context.Context) []resource.ConfigValidator { + return []resource.ConfigValidator{} +} diff --git a/internal/services/bot_management/data_source_schema.go b/internal/services/bot_management/data_source_schema.go index fdb785aa95..cae099f694 100644 --- a/internal/services/bot_management/data_source_schema.go +++ b/internal/services/bot_management/data_source_schema.go @@ -22,7 +22,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "ai_bots_protection": schema.StringAttribute{ - Description: "Enable rule to block AI Scrapers and Crawlers.", + Description: "Enable rule to block AI Scrapers and Crawlers.\nAvailable values: \"block\", \"disabled\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("block", "disabled"), @@ -45,7 +45,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "sbfm_definitely_automated": schema.StringAttribute{ - Description: "Super Bot Fight Mode (SBFM) action to take on definitely automated requests.", + Description: "Super Bot Fight Mode (SBFM) action to take on definitely automated requests.\nAvailable values: \"allow\", \"block\", \"managed_challenge\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -56,7 +56,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "sbfm_likely_automated": schema.StringAttribute{ - Description: "Super Bot Fight Mode (SBFM) action to take on likely automated requests.", + Description: "Super Bot Fight Mode (SBFM) action to take on likely automated requests.\nAvailable values: \"allow\", \"block\", \"managed_challenge\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -67,11 +67,11 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "sbfm_static_resource_protection": schema.BoolAttribute{ - Description: "Super Bot Fight Mode (SBFM) to enable static resource protection.\nEnable if static resources on your application need bot protection.\nNote: Static resource protection can also result in legitimate traffic being blocked.\n", + Description: "Super Bot Fight Mode (SBFM) to enable static resource protection.\nEnable if static resources on your application need bot protection.\nNote: Static resource protection can also result in legitimate traffic being blocked.", Computed: true, }, "sbfm_verified_bots": schema.StringAttribute{ - Description: "Super Bot Fight Mode (SBFM) action to take on verified bots requests.", + Description: "Super Bot Fight Mode (SBFM) action to take on verified bots requests.\nAvailable values: \"allow\", \"block\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("allow", "block"), @@ -82,7 +82,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "using_latest_model": schema.BoolAttribute{ - Description: "A read-only field that indicates whether the zone currently is running the latest ML model.\n", + Description: "A read-only field that indicates whether the zone currently is running the latest ML model.", Computed: true, }, "stale_zone_configuration": schema.SingleNestedAttribute{ diff --git a/internal/services/bot_management/schema.go b/internal/services/bot_management/schema.go index b3224493d8..1a3df75644 100644 --- a/internal/services/bot_management/schema.go +++ b/internal/services/bot_management/schema.go @@ -31,7 +31,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown(), stringplanmodifier.RequiresReplace()}, }, "ai_bots_protection": schema.StringAttribute{ - Description: "Enable rule to block AI Scrapers and Crawlers.", + Description: "Enable rule to block AI Scrapers and Crawlers.\nAvailable values: \"block\", \"disabled\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("block", "disabled"), @@ -54,7 +54,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "sbfm_definitely_automated": schema.StringAttribute{ - Description: "Super Bot Fight Mode (SBFM) action to take on definitely automated requests.", + Description: "Super Bot Fight Mode (SBFM) action to take on definitely automated requests.\nAvailable values: \"allow\", \"block\", \"managed_challenge\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -65,7 +65,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "sbfm_likely_automated": schema.StringAttribute{ - Description: "Super Bot Fight Mode (SBFM) action to take on likely automated requests.", + Description: "Super Bot Fight Mode (SBFM) action to take on likely automated requests.\nAvailable values: \"allow\", \"block\", \"managed_challenge\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -76,11 +76,11 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "sbfm_static_resource_protection": schema.BoolAttribute{ - Description: "Super Bot Fight Mode (SBFM) to enable static resource protection.\nEnable if static resources on your application need bot protection.\nNote: Static resource protection can also result in legitimate traffic being blocked.\n", + Description: "Super Bot Fight Mode (SBFM) to enable static resource protection.\nEnable if static resources on your application need bot protection.\nNote: Static resource protection can also result in legitimate traffic being blocked.", Optional: true, }, "sbfm_verified_bots": schema.StringAttribute{ - Description: "Super Bot Fight Mode (SBFM) action to take on verified bots requests.", + Description: "Super Bot Fight Mode (SBFM) action to take on verified bots requests.\nAvailable values: \"allow\", \"block\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("allow", "block"), @@ -93,7 +93,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: booldefault.StaticBool(false), }, "using_latest_model": schema.BoolAttribute{ - Description: "A read-only field that indicates whether the zone currently is running the latest ML model.\n", + Description: "A read-only field that indicates whether the zone currently is running the latest ML model.", Computed: true, }, "stale_zone_configuration": schema.SingleNestedAttribute{ diff --git a/internal/services/byo_ip_prefix/data_source_model.go b/internal/services/byo_ip_prefix/data_source_model.go index 57a840fc2f..c5b735480b 100644 --- a/internal/services/byo_ip_prefix/data_source_model.go +++ b/internal/services/byo_ip_prefix/data_source_model.go @@ -19,7 +19,7 @@ type ByoIPPrefixResultDataSourceEnvelope struct { type ByoIPPrefixDataSourceModel struct { ID types.String `tfsdk:"id" json:"-,computed"` PrefixID types.String `tfsdk:"prefix_id" path:"prefix_id,optional"` - AccountID types.String `tfsdk:"account_id" path:"account_id,computed"` + AccountID types.String `tfsdk:"account_id" path:"account_id,required"` Advertised types.Bool `tfsdk:"advertised" json:"advertised,computed"` AdvertisedModifiedAt timetypes.RFC3339 `tfsdk:"advertised_modified_at" json:"advertised_modified_at,computed" format:"date-time"` Approved types.String `tfsdk:"approved" json:"approved,computed"` diff --git a/internal/services/byo_ip_prefix/data_source_schema.go b/internal/services/byo_ip_prefix/data_source_schema.go index 41ddc46ba4..a701de100f 100644 --- a/internal/services/byo_ip_prefix/data_source_schema.go +++ b/internal/services/byo_ip_prefix/data_source_schema.go @@ -25,7 +25,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, "account_id": schema.StringAttribute{ Description: "Identifier of a Cloudflare account.", - Computed: true, + Required: true, }, "advertised": schema.BoolAttribute{ Description: "Prefix advertisement status to the Internet. This field is only not 'null' if on demand is enabled.", diff --git a/internal/services/certificate_pack/list_data_source_schema.go b/internal/services/certificate_pack/list_data_source_schema.go index da46e12ba7..188a19284d 100644 --- a/internal/services/certificate_pack/list_data_source_schema.go +++ b/internal/services/certificate_pack/list_data_source_schema.go @@ -23,7 +23,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "status": schema.StringAttribute{ - Description: "Include Certificate Packs of all statuses, not just active ones.", + Description: "Include Certificate Packs of all statuses, not just active ones.\nAvailable values: \"all\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("all"), diff --git a/internal/services/certificate_pack/schema.go b/internal/services/certificate_pack/schema.go index 6395ee2f68..de72872f94 100644 --- a/internal/services/certificate_pack/schema.go +++ b/internal/services/certificate_pack/schema.go @@ -33,7 +33,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "certificate_authority": schema.StringAttribute{ - Description: "Certificate Authority selected for the order. For information on any certificate authority specific details or restrictions [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities)", + Description: "Certificate Authority selected for the order. For information on any certificate authority specific details or restrictions [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities)\nAvailable values: \"google\", \"lets_encrypt\", \"ssl_com\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -45,7 +45,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "type": schema.StringAttribute{ - Description: "Type of certificate pack.", + Description: "Type of certificate pack.\nAvailable values: \"advanced\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("advanced"), @@ -53,7 +53,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "validation_method": schema.StringAttribute{ - Description: "Validation Method selected for the order.", + Description: "Validation Method selected for the order.\nAvailable values: \"txt\", \"http\", \"email\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -65,7 +65,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "validity_days": schema.Int64Attribute{ - Description: "Validity Days selected for the order.", + Description: "Validity Days selected for the order.\nAvailable values: 14, 30, 90, 365.", Required: true, Validators: []validator.Int64{ int64validator.OneOf( @@ -88,7 +88,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "status": schema.StringAttribute{ - Description: "Status of certificate pack.", + Description: "Status of certificate pack.\nAvailable values: \"initializing\", \"pending_validation\", \"deleted\", \"pending_issuance\", \"pending_deployment\", \"pending_deletion\", \"pending_expiration\", \"expired\", \"active\", \"initializing_timed_out\", \"validation_timed_out\", \"issuance_timed_out\", \"deployment_timed_out\", \"deletion_timed_out\", \"pending_cleanup\", \"staging_deployment\", \"staging_active\", \"deactivating\", \"inactive\", \"backup_issued\", \"holding_deployment\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/cloud_connector_rules/list_data_source_schema.go b/internal/services/cloud_connector_rules/list_data_source_schema.go index a1b23692fb..c8ea88271a 100644 --- a/internal/services/cloud_connector_rules/list_data_source_schema.go +++ b/internal/services/cloud_connector_rules/list_data_source_schema.go @@ -59,7 +59,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "cloud_provider": schema.StringAttribute{ - Description: "Cloud Provider type", + Description: "Cloud Provider type\nAvailable values: \"aws_s3\", \"r2\", \"gcp_storage\", \"azure_storage\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/cloud_connector_rules/model.go b/internal/services/cloud_connector_rules/model.go index 8d5cece856..fcee9aa79a 100644 --- a/internal/services/cloud_connector_rules/model.go +++ b/internal/services/cloud_connector_rules/model.go @@ -9,13 +9,13 @@ import ( ) type CloudConnectorRulesResultEnvelope struct { - Result *[]*CloudConnectorRulesRulesModel `json:"result"` + Result customfield.NestedObjectList[CloudConnectorRulesRulesModel] `json:"result"` } type CloudConnectorRulesModel struct { ID types.String `tfsdk:"id" json:"id,computed"` ZoneID types.String `tfsdk:"zone_id" path:"zone_id,required"` - Rules *[]*CloudConnectorRulesRulesModel `tfsdk:"rules" json:"rules,required"` + Rules customfield.NestedObjectList[CloudConnectorRulesRulesModel] `tfsdk:"rules" json:"rules,computed_optional"` CloudProvider types.String `tfsdk:"cloud_provider" json:"provider,computed"` Description types.String `tfsdk:"description" json:"description,computed"` Enabled types.Bool `tfsdk:"enabled" json:"enabled,computed"` @@ -32,12 +32,12 @@ func (m CloudConnectorRulesModel) MarshalJSONForUpdate(state CloudConnectorRules } type CloudConnectorRulesRulesModel struct { - ID types.String `tfsdk:"id" json:"id,optional"` - Description types.String `tfsdk:"description" json:"description,optional"` - Enabled types.Bool `tfsdk:"enabled" json:"enabled,optional"` - Expression types.String `tfsdk:"expression" json:"expression,optional"` - Parameters *CloudConnectorRulesRulesParametersModel `tfsdk:"parameters" json:"parameters,optional"` - CloudProvider types.String `tfsdk:"cloud_provider" json:"provider,optional"` + ID types.String `tfsdk:"id" json:"id,optional"` + Description types.String `tfsdk:"description" json:"description,optional"` + Enabled types.Bool `tfsdk:"enabled" json:"enabled,optional"` + Expression types.String `tfsdk:"expression" json:"expression,optional"` + Parameters customfield.NestedObject[CloudConnectorRulesRulesParametersModel] `tfsdk:"parameters" json:"parameters,computed_optional"` + CloudProvider types.String `tfsdk:"cloud_provider" json:"provider,optional"` } type CloudConnectorRulesRulesParametersModel struct { diff --git a/internal/services/cloud_connector_rules/schema.go b/internal/services/cloud_connector_rules/schema.go index ddf53604b6..c2e2e7f8c5 100644 --- a/internal/services/cloud_connector_rules/schema.go +++ b/internal/services/cloud_connector_rules/schema.go @@ -31,7 +31,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "rules": schema.ListNestedAttribute{ Description: "List of Cloud Connector rules", - Required: true, + Computed: true, + Optional: true, + CustomType: customfield.NewNestedObjectListType[CloudConnectorRulesRulesModel](ctx), NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -48,7 +50,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "parameters": schema.SingleNestedAttribute{ Description: "Parameters of Cloud Connector Rule", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[CloudConnectorRulesRulesParametersModel](ctx), Attributes: map[string]schema.Attribute{ "host": schema.StringAttribute{ Description: "Host to perform Cloud Connection to", @@ -57,7 +61,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "cloud_provider": schema.StringAttribute{ - Description: "Cloud Provider type", + Description: "Cloud Provider type\nAvailable values: \"aws_s3\", \"r2\", \"gcp_storage\", \"azure_storage\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -73,7 +77,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.List{listplanmodifier.RequiresReplace()}, }, "cloud_provider": schema.StringAttribute{ - Description: "Cloud Provider type", + Description: "Cloud Provider type\nAvailable values: \"aws_s3\", \"r2\", \"gcp_storage\", \"azure_storage\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/cloudforce_one_request/data_source_schema.go b/internal/services/cloudforce_one_request/data_source_schema.go index 30c66c6747..5fa3059fcf 100644 --- a/internal/services/cloudforce_one_request/data_source_schema.go +++ b/internal/services/cloudforce_one_request/data_source_schema.go @@ -58,7 +58,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Request Status", + Description: "Request Status\nAvailable values: \"open\", \"accepted\", \"reported\", \"approved\", \"completed\", \"declined\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -76,7 +76,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "tlp": schema.StringAttribute{ - Description: "The CISA defined Traffic Light Protocol (TLP)", + Description: "The CISA defined Traffic Light Protocol (TLP)\nAvailable values: \"clear\", \"amber\", \"amber-strict\", \"green\", \"red\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/cloudforce_one_request/list_data_source_schema.go b/internal/services/cloudforce_one_request/list_data_source_schema.go index 01fdb0f157..a7e8f18183 100644 --- a/internal/services/cloudforce_one_request/list_data_source_schema.go +++ b/internal/services/cloudforce_one_request/list_data_source_schema.go @@ -46,7 +46,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "priority": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"routine\", \"high\", \"urgent\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "routine", @@ -64,7 +65,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "tlp": schema.StringAttribute{ - Description: "The CISA defined Traffic Light Protocol (TLP)", + Description: "The CISA defined Traffic Light Protocol (TLP)\nAvailable values: \"clear\", \"amber\", \"amber-strict\", \"green\", \"red\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -95,7 +96,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Request Status", + Description: "Request Status\nAvailable values: \"open\", \"accepted\", \"reported\", \"approved\", \"completed\", \"declined\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/cloudforce_one_request/schema.go b/internal/services/cloudforce_one_request/schema.go index 8289d242a3..e893b6a6c7 100644 --- a/internal/services/cloudforce_one_request/schema.go +++ b/internal/services/cloudforce_one_request/schema.go @@ -46,7 +46,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "tlp": schema.StringAttribute{ - Description: "The CISA defined Traffic Light Protocol (TLP)", + Description: "The CISA defined Traffic Light Protocol (TLP)\nAvailable values: \"clear\", \"amber\", \"amber-strict\", \"green\", \"red\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -79,7 +79,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Request Status", + Description: "Request Status\nAvailable values: \"open\", \"accepted\", \"reported\", \"approved\", \"completed\", \"declined\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/cloudforce_one_request_priority/data_source_schema.go b/internal/services/cloudforce_one_request_priority/data_source_schema.go index 0b5f462c44..215835abf7 100644 --- a/internal/services/cloudforce_one_request_priority/data_source_schema.go +++ b/internal/services/cloudforce_one_request_priority/data_source_schema.go @@ -58,7 +58,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Request Status", + Description: "Request Status\nAvailable values: \"open\", \"accepted\", \"reported\", \"approved\", \"completed\", \"declined\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -76,7 +76,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "tlp": schema.StringAttribute{ - Description: "The CISA defined Traffic Light Protocol (TLP)", + Description: "The CISA defined Traffic Light Protocol (TLP)\nAvailable values: \"clear\", \"amber\", \"amber-strict\", \"green\", \"red\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/cloudforce_one_request_priority/schema.go b/internal/services/cloudforce_one_request_priority/schema.go index e904cb8ddf..eef28c8927 100644 --- a/internal/services/cloudforce_one_request_priority/schema.go +++ b/internal/services/cloudforce_one_request_priority/schema.go @@ -39,7 +39,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "tlp": schema.StringAttribute{ - Description: "The CISA defined Traffic Light Protocol (TLP)", + Description: "The CISA defined Traffic Light Protocol (TLP)\nAvailable values: \"clear\", \"amber\", \"amber-strict\", \"green\", \"red\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -81,7 +81,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Request Status", + Description: "Request Status\nAvailable values: \"open\", \"accepted\", \"reported\", \"approved\", \"completed\", \"declined\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/custom_hostname/data_source_schema.go b/internal/services/custom_hostname/data_source_schema.go index 5f922f9aa0..4127f1d2c4 100644 --- a/internal/services/custom_hostname/data_source_schema.go +++ b/internal/services/custom_hostname/data_source_schema.go @@ -52,7 +52,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Status of the hostname's activation.", + Description: "Status of the hostname's activation.\nAvailable values: \"active\", \"pending\", \"active_redeploying\", \"moved\", \"pending_deletion\", \"deleted\", \"pending_blocked\", \"pending_migration\", \"pending_provisioned\", \"test_pending\", \"test_active\", \"test_active_apex\", \"test_blocked\", \"test_failed\", \"provisioned\", \"blocked\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -97,7 +97,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "DNS Record type.", + Description: "DNS Record type.\nAvailable values: \"txt\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("txt"), @@ -133,7 +133,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "bundle_method": schema.StringAttribute{ - Description: "A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.", + Description: "A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.\nAvailable values: \"ubiquitous\", \"optimal\", \"force\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -144,7 +144,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "certificate_authority": schema.StringAttribute{ - Description: "The Certificate Authority that will issue the certificate", + Description: "The Certificate Authority that will issue the certificate\nAvailable values: \"digicert\", \"google\", \"lets_encrypt\", \"ssl_com\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -183,7 +183,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "method": schema.StringAttribute{ - Description: "Domain control validation (DCV) method used for this hostname.", + Description: "Domain control validation (DCV) method used for this hostname.\nAvailable values: \"http\", \"txt\", \"email\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -208,21 +208,21 @@ func DataSourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "early_hints": schema.StringAttribute{ - Description: "Whether or not Early Hints is enabled.", + Description: "Whether or not Early Hints is enabled.\nAvailable values: \"on\", \"off\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("on", "off"), }, }, "http2": schema.StringAttribute{ - Description: "Whether or not HTTP2 is enabled.", + Description: "Whether or not HTTP2 is enabled.\nAvailable values: \"on\", \"off\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("on", "off"), }, }, "min_tls_version": schema.StringAttribute{ - Description: "The minimum TLS version supported.", + Description: "The minimum TLS version supported.\nAvailable values: \"1.0\", \"1.1\", \"1.2\", \"1.3\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -234,7 +234,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "tls_1_3": schema.StringAttribute{ - Description: "Whether or not TLS 1.3 is enabled.", + Description: "Whether or not TLS 1.3 is enabled.\nAvailable values: \"on\", \"off\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("on", "off"), @@ -247,7 +247,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Status of the hostname's SSL certificates.", + Description: "Status of the hostname's SSL certificates.\nAvailable values: \"initializing\", \"pending_validation\", \"deleted\", \"pending_issuance\", \"pending_deployment\", \"pending_deletion\", \"pending_expiration\", \"expired\", \"active\", \"initializing_timed_out\", \"validation_timed_out\", \"issuance_timed_out\", \"deployment_timed_out\", \"deletion_timed_out\", \"pending_cleanup\", \"staging_deployment\", \"staging_active\", \"deactivating\", \"inactive\", \"backup_issued\", \"holding_deployment\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -276,7 +276,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "Level of validation to be used for this hostname. Domain validation (dv) must be used.", + Description: "Level of validation to be used for this hostname. Domain validation (dv) must be used.\nAvailable values: \"dv\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("dv"), @@ -344,7 +344,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "direction": schema.StringAttribute{ - Description: "Direction to order hostnames.", + Description: "Direction to order hostnames.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), @@ -355,7 +355,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "order": schema.StringAttribute{ - Description: "Field to order hostnames by.", + Description: "Field to order hostnames by.\nAvailable values: \"ssl\", \"ssl_status\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -363,7 +363,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "ssl": schema.Float64Attribute{ - Description: "Whether to filter hostnames based on if they have SSL enabled.", + Description: "Whether to filter hostnames based on if they have SSL enabled.\nAvailable values: 0, 1.", Optional: true, Validators: []validator.Float64{ float64validator.OneOf(0, 1), diff --git a/internal/services/custom_hostname/list_data_source_schema.go b/internal/services/custom_hostname/list_data_source_schema.go index c6341e4c0f..e479630334 100644 --- a/internal/services/custom_hostname/list_data_source_schema.go +++ b/internal/services/custom_hostname/list_data_source_schema.go @@ -26,7 +26,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "direction": schema.StringAttribute{ - Description: "Direction to order hostnames.", + Description: "Direction to order hostnames.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), @@ -41,14 +41,14 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "ssl": schema.Float64Attribute{ - Description: "Whether to filter hostnames based on if they have SSL enabled.", + Description: "Whether to filter hostnames based on if they have SSL enabled.\nAvailable values: 0, 1.", Optional: true, Validators: []validator.Float64{ float64validator.OneOf(0, 1), }, }, "order": schema.StringAttribute{ - Description: "Field to order hostnames by.", + Description: "Field to order hostnames by.\nAvailable values: \"ssl\", \"ssl_status\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -85,7 +85,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "bundle_method": schema.StringAttribute{ - Description: "A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.", + Description: "A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.\nAvailable values: \"ubiquitous\", \"optimal\", \"force\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -96,7 +96,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "certificate_authority": schema.StringAttribute{ - Description: "The Certificate Authority that will issue the certificate", + Description: "The Certificate Authority that will issue the certificate\nAvailable values: \"digicert\", \"google\", \"lets_encrypt\", \"ssl_com\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -135,7 +135,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "method": schema.StringAttribute{ - Description: "Domain control validation (DCV) method used for this hostname.", + Description: "Domain control validation (DCV) method used for this hostname.\nAvailable values: \"http\", \"txt\", \"email\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -160,21 +160,21 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "early_hints": schema.StringAttribute{ - Description: "Whether or not Early Hints is enabled.", + Description: "Whether or not Early Hints is enabled.\nAvailable values: \"on\", \"off\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("on", "off"), }, }, "http2": schema.StringAttribute{ - Description: "Whether or not HTTP2 is enabled.", + Description: "Whether or not HTTP2 is enabled.\nAvailable values: \"on\", \"off\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("on", "off"), }, }, "min_tls_version": schema.StringAttribute{ - Description: "The minimum TLS version supported.", + Description: "The minimum TLS version supported.\nAvailable values: \"1.0\", \"1.1\", \"1.2\", \"1.3\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -186,7 +186,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "tls_1_3": schema.StringAttribute{ - Description: "Whether or not TLS 1.3 is enabled.", + Description: "Whether or not TLS 1.3 is enabled.\nAvailable values: \"on\", \"off\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("on", "off"), @@ -199,7 +199,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Status of the hostname's SSL certificates.", + Description: "Status of the hostname's SSL certificates.\nAvailable values: \"initializing\", \"pending_validation\", \"deleted\", \"pending_issuance\", \"pending_deployment\", \"pending_deletion\", \"pending_expiration\", \"expired\", \"active\", \"initializing_timed_out\", \"validation_timed_out\", \"issuance_timed_out\", \"deployment_timed_out\", \"deletion_timed_out\", \"pending_cleanup\", \"staging_deployment\", \"staging_active\", \"deactivating\", \"inactive\", \"backup_issued\", \"holding_deployment\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -228,7 +228,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "Level of validation to be used for this hostname. Domain validation (dv) must be used.", + Description: "Level of validation to be used for this hostname. Domain validation (dv) must be used.\nAvailable values: \"dv\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("dv"), @@ -317,7 +317,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "DNS Record type.", + Description: "DNS Record type.\nAvailable values: \"txt\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("txt"), @@ -345,7 +345,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "status": schema.StringAttribute{ - Description: "Status of the hostname's activation.", + Description: "Status of the hostname's activation.\nAvailable values: \"active\", \"pending\", \"active_redeploying\", \"moved\", \"pending_deletion\", \"deleted\", \"pending_blocked\", \"pending_migration\", \"pending_provisioned\", \"test_pending\", \"test_active\", \"test_active_apex\", \"test_blocked\", \"test_failed\", \"provisioned\", \"blocked\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/custom_hostname/schema.go b/internal/services/custom_hostname/schema.go index e71372d94c..92ca785dd1 100644 --- a/internal/services/custom_hostname/schema.go +++ b/internal/services/custom_hostname/schema.go @@ -42,7 +42,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, Attributes: map[string]schema.Attribute{ "bundle_method": schema.StringAttribute{ - Description: "A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.", + Description: "A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.\nAvailable values: \"ubiquitous\", \"optimal\", \"force\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -55,7 +55,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: stringdefault.StaticString("ubiquitous"), }, "certificate_authority": schema.StringAttribute{ - Description: "The Certificate Authority that will issue the certificate", + Description: "The Certificate Authority that will issue the certificate\nAvailable values: \"digicert\", \"google\", \"lets_encrypt\", \"ssl_com\".", Optional: true, Computed: true, Validators: []validator.String{ @@ -96,7 +96,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "method": schema.StringAttribute{ - Description: "Domain control validation (DCV) method used for this hostname.", + Description: "Domain control validation (DCV) method used for this hostname.\nAvailable values: \"http\", \"txt\", \"email\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -116,21 +116,21 @@ func ResourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "early_hints": schema.StringAttribute{ - Description: "Whether or not Early Hints is enabled.", + Description: "Whether or not Early Hints is enabled.\nAvailable values: \"on\", \"off\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("on", "off"), }, }, "http2": schema.StringAttribute{ - Description: "Whether or not HTTP2 is enabled.", + Description: "Whether or not HTTP2 is enabled.\nAvailable values: \"on\", \"off\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("on", "off"), }, }, "min_tls_version": schema.StringAttribute{ - Description: "The minimum TLS version supported.", + Description: "The minimum TLS version supported.\nAvailable values: \"1.0\", \"1.1\", \"1.2\", \"1.3\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -142,7 +142,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "tls_1_3": schema.StringAttribute{ - Description: "Whether or not TLS 1.3 is enabled.", + Description: "Whether or not TLS 1.3 is enabled.\nAvailable values: \"on\", \"off\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("on", "off"), @@ -151,7 +151,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "Level of validation to be used for this hostname. Domain validation (dv) must be used.", + Description: "Level of validation to be used for this hostname. Domain validation (dv) must be used.\nAvailable values: \"dv\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("dv"), @@ -182,7 +182,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "status": schema.StringAttribute{ - Description: "Status of the hostname's activation.", + Description: "Status of the hostname's activation.\nAvailable values: \"active\", \"pending\", \"active_redeploying\", \"moved\", \"pending_deletion\", \"deleted\", \"pending_blocked\", \"pending_migration\", \"pending_provisioned\", \"test_pending\", \"test_active\", \"test_active_apex\", \"test_blocked\", \"test_failed\", \"provisioned\", \"blocked\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -221,7 +221,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "DNS Record type.", + Description: "DNS Record type.\nAvailable values: \"txt\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("txt"), diff --git a/internal/services/custom_hostname_fallback_origin/data_source_schema.go b/internal/services/custom_hostname_fallback_origin/data_source_schema.go index 3bba584499..b87673f72d 100644 --- a/internal/services/custom_hostname_fallback_origin/data_source_schema.go +++ b/internal/services/custom_hostname_fallback_origin/data_source_schema.go @@ -33,7 +33,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Status of the fallback origin's activation.", + Description: "Status of the fallback origin's activation.\nAvailable values: \"initializing\", \"pending_deployment\", \"pending_deletion\", \"active\", \"deployment_timed_out\", \"deletion_timed_out\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/custom_hostname_fallback_origin/schema.go b/internal/services/custom_hostname_fallback_origin/schema.go index ed184d1faa..9109a4e7ac 100644 --- a/internal/services/custom_hostname_fallback_origin/schema.go +++ b/internal/services/custom_hostname_fallback_origin/schema.go @@ -41,7 +41,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "status": schema.StringAttribute{ - Description: "Status of the fallback origin's activation.", + Description: "Status of the fallback origin's activation.\nAvailable values: \"initializing\", \"pending_deployment\", \"pending_deletion\", \"active\", \"deployment_timed_out\", \"deletion_timed_out\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/custom_ssl/data_source_model.go b/internal/services/custom_ssl/data_source_model.go index b495bbdf02..0efb6052ef 100644 --- a/internal/services/custom_ssl/data_source_model.go +++ b/internal/services/custom_ssl/data_source_model.go @@ -20,7 +20,7 @@ type CustomSSLResultDataSourceEnvelope struct { type CustomSSLDataSourceModel struct { ID types.String `tfsdk:"id" json:"-,computed"` CustomCertificateID types.String `tfsdk:"custom_certificate_id" path:"custom_certificate_id,optional"` - ZoneID types.String `tfsdk:"zone_id" path:"zone_id,computed"` + ZoneID types.String `tfsdk:"zone_id" path:"zone_id,required"` BundleMethod types.String `tfsdk:"bundle_method" json:"bundle_method,computed"` ExpiresOn timetypes.RFC3339 `tfsdk:"expires_on" json:"expires_on,computed" format:"date-time"` Issuer types.String `tfsdk:"issuer" json:"issuer,computed"` diff --git a/internal/services/custom_ssl/data_source_schema.go b/internal/services/custom_ssl/data_source_schema.go index 1dfd089af4..63bdcfdbc0 100644 --- a/internal/services/custom_ssl/data_source_schema.go +++ b/internal/services/custom_ssl/data_source_schema.go @@ -31,10 +31,10 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, "zone_id": schema.StringAttribute{ Description: "Identifier", - Computed: true, + Required: true, }, "bundle_method": schema.StringAttribute{ - Description: "A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.", + Description: "A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.\nAvailable values: \"ubiquitous\", \"optimal\", \"force\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -71,7 +71,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Status of the zone's custom SSL.", + Description: "Status of the zone's custom SSL.\nAvailable values: \"active\", \"expired\", \"deleted\", \"pending\", \"initializing\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -99,7 +99,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[CustomSSLGeoRestrictionsDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "label": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"us\", \"eu\", \"highest_security\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "us", @@ -151,7 +152,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Status of the Keyless SSL.", + Description: "Status of the Keyless SSL.\nAvailable values: \"active\", \"deleted\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("active", "deleted"), @@ -178,7 +179,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "match": schema.StringAttribute{ - Description: "Whether to match all search requirements or at least one (any).", + Description: "Whether to match all search requirements or at least one (any).\nAvailable values: \"any\", \"all\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -186,7 +187,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "status": schema.StringAttribute{ - Description: "Status of the zone's custom SSL.", + Description: "Status of the zone's custom SSL.\nAvailable values: \"active\", \"expired\", \"deleted\", \"pending\", \"initializing\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/custom_ssl/list_data_source_schema.go b/internal/services/custom_ssl/list_data_source_schema.go index d6e1d2c362..72a875de85 100644 --- a/internal/services/custom_ssl/list_data_source_schema.go +++ b/internal/services/custom_ssl/list_data_source_schema.go @@ -25,7 +25,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "status": schema.StringAttribute{ - Description: "Status of the zone's custom SSL.", + Description: "Status of the zone's custom SSL.\nAvailable values: \"active\", \"expired\", \"deleted\", \"pending\", \"initializing\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -38,7 +38,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "match": schema.StringAttribute{ - Description: "Whether to match all search requirements or at least one (any).", + Description: "Whether to match all search requirements or at least one (any).\nAvailable values: \"any\", \"all\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -63,7 +63,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "bundle_method": schema.StringAttribute{ - Description: "A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.", + Description: "A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.\nAvailable values: \"ubiquitous\", \"optimal\", \"force\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -101,7 +101,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Status of the zone's custom SSL.", + Description: "Status of the zone's custom SSL.\nAvailable values: \"active\", \"expired\", \"deleted\", \"pending\", \"initializing\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -128,7 +128,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[CustomSSLsGeoRestrictionsDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "label": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"us\", \"eu\", \"highest_security\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "us", @@ -180,7 +181,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Status of the Keyless SSL.", + Description: "Status of the Keyless SSL.\nAvailable values: \"active\", \"deleted\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("active", "deleted"), diff --git a/internal/services/custom_ssl/schema.go b/internal/services/custom_ssl/schema.go index 43914da7ff..d779161128 100644 --- a/internal/services/custom_ssl/schema.go +++ b/internal/services/custom_ssl/schema.go @@ -34,7 +34,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "type": schema.StringAttribute{ - Description: "The type 'legacy_custom' enables support for legacy clients which do not include SNI in the TLS handshake.", + Description: "The type 'legacy_custom' enables support for legacy clients which do not include SNI in the TLS handshake.\nAvailable values: \"legacy_custom\", \"sni_custom\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -56,7 +56,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "bundle_method": schema.StringAttribute{ - Description: "A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.", + Description: "A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.\nAvailable values: \"ubiquitous\", \"optimal\", \"force\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -75,7 +75,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[CustomSSLGeoRestrictionsModel](ctx), Attributes: map[string]schema.Attribute{ "label": schema.StringAttribute{ - Optional: true, + Description: "Available values: \"us\", \"eu\", \"highest_security\".", + Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "us", @@ -110,7 +111,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Status of the zone's custom SSL.", + Description: "Status of the zone's custom SSL.\nAvailable values: \"active\", \"expired\", \"deleted\", \"pending\", \"initializing\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -174,7 +175,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: float64default.StaticFloat64(24008), }, "status": schema.StringAttribute{ - Description: "Status of the Keyless SSL.", + Description: "Status of the Keyless SSL.\nAvailable values: \"active\", \"deleted\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("active", "deleted"), diff --git a/internal/services/d1_database/schema.go b/internal/services/d1_database/schema.go index 6969d2cfba..55b2b69e6c 100644 --- a/internal/services/d1_database/schema.go +++ b/internal/services/d1_database/schema.go @@ -40,7 +40,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "primary_location_hint": schema.StringAttribute{ - Description: "Specify the region to create the D1 primary, if available. If this option is omitted, the D1 will be created as close as possible to the current user.", + Description: "Specify the region to create the D1 primary, if available. If this option is omitted, the D1 will be created as close as possible to the current user.\nAvailable values: \"wnam\", \"enam\", \"weur\", \"eeur\", \"apac\", \"oc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/dns_record/data_source_schema.go b/internal/services/dns_record/data_source_schema.go index 08ed58125e..1b9d458f4d 100755 --- a/internal/services/dns_record/data_source_schema.go +++ b/internal/services/dns_record/data_source_schema.go @@ -92,7 +92,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "Record type.", + Description: "Record type.\nAvailable values: \"A\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -219,7 +219,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "lat_direction": schema.StringAttribute{ - Description: "Latitude direction.", + Description: "Latitude direction.\nAvailable values: \"N\", \"S\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("N", "S"), @@ -247,7 +247,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "long_direction": schema.StringAttribute{ - Description: "Longitude direction.", + Description: "Longitude direction.\nAvailable values: \"E\", \"W\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("E", "W"), @@ -386,27 +386,27 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "absent": schema.StringAttribute{ - Description: "If this parameter is present, only records *without* a comment are returned.\n", + Description: "If this parameter is present, only records *without* a comment are returned.", Optional: true, }, "contains": schema.StringAttribute{ - Description: "Substring of the DNS record comment. Comment filters are case-insensitive.\n", + Description: "Substring of the DNS record comment. Comment filters are case-insensitive.", Optional: true, }, "endswith": schema.StringAttribute{ - Description: "Suffix of the DNS record comment. Comment filters are case-insensitive.\n", + Description: "Suffix of the DNS record comment. Comment filters are case-insensitive.", Optional: true, }, "exact": schema.StringAttribute{ - Description: "Exact value of the DNS record comment. Comment filters are case-insensitive.\n", + Description: "Exact value of the DNS record comment. Comment filters are case-insensitive.", Optional: true, }, "present": schema.StringAttribute{ - Description: "If this parameter is present, only records *with* a comment are returned.\n", + Description: "If this parameter is present, only records *with* a comment are returned.", Optional: true, }, "startswith": schema.StringAttribute{ - Description: "Prefix of the DNS record comment. Comment filters are case-insensitive.\n", + Description: "Prefix of the DNS record comment. Comment filters are case-insensitive.", Optional: true, }, }, @@ -415,25 +415,25 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "contains": schema.StringAttribute{ - Description: "Substring of the DNS record content. Content filters are case-insensitive.\n", + Description: "Substring of the DNS record content. Content filters are case-insensitive.", Optional: true, }, "endswith": schema.StringAttribute{ - Description: "Suffix of the DNS record content. Content filters are case-insensitive.\n", + Description: "Suffix of the DNS record content. Content filters are case-insensitive.", Optional: true, }, "exact": schema.StringAttribute{ - Description: "Exact value of the DNS record content. Content filters are case-insensitive.\n", + Description: "Exact value of the DNS record content. Content filters are case-insensitive.", Optional: true, }, "startswith": schema.StringAttribute{ - Description: "Prefix of the DNS record content. Content filters are case-insensitive.\n", + Description: "Prefix of the DNS record content. Content filters are case-insensitive.", Optional: true, }, }, }, "direction": schema.StringAttribute{ - Description: "Direction to order DNS records in.", + Description: "Direction to order DNS records in.\nAvailable values: \"asc\", \"desc\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -441,7 +441,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "match": schema.StringAttribute{ - Description: "Whether to match all search requirements or at least one (any). If set to `all`, acts like a logical AND between filters. If set to `any`, acts like a logical OR instead. Note that the interaction between tag filters is controlled by the `tag-match` parameter instead.\n", + Description: "Whether to match all search requirements or at least one (any). If set to `all`, acts like a logical AND between filters. If set to `any`, acts like a logical OR instead. Note that the interaction between tag filters is controlled by the `tag-match` parameter instead.\nAvailable values: \"any\", \"all\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -452,25 +452,25 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "contains": schema.StringAttribute{ - Description: "Substring of the DNS record name. Name filters are case-insensitive.\n", + Description: "Substring of the DNS record name. Name filters are case-insensitive.", Optional: true, }, "endswith": schema.StringAttribute{ - Description: "Suffix of the DNS record name. Name filters are case-insensitive.\n", + Description: "Suffix of the DNS record name. Name filters are case-insensitive.", Optional: true, }, "exact": schema.StringAttribute{ - Description: "Exact value of the DNS record name. Name filters are case-insensitive.\n", + Description: "Exact value of the DNS record name. Name filters are case-insensitive.", Optional: true, }, "startswith": schema.StringAttribute{ - Description: "Prefix of the DNS record name. Name filters are case-insensitive.\n", + Description: "Prefix of the DNS record name. Name filters are case-insensitive.", Optional: true, }, }, }, "order": schema.StringAttribute{ - Description: "Field to order DNS records by.", + Description: "Field to order DNS records by.\nAvailable values: \"type\", \"name\", \"content\", \"ttl\", \"proxied\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -489,40 +489,40 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "search": schema.StringAttribute{ - Description: "Allows searching in multiple properties of a DNS record simultaneously. This parameter is intended for human users, not automation. Its exact behavior is intentionally left unspecified and is subject to change in the future. This parameter works independently of the `match` setting. For automated searches, please use the other available parameters.\n", + Description: "Allows searching in multiple properties of a DNS record simultaneously. This parameter is intended for human users, not automation. Its exact behavior is intentionally left unspecified and is subject to change in the future. This parameter works independently of the `match` setting. For automated searches, please use the other available parameters.", Optional: true, }, "tag": schema.SingleNestedAttribute{ Optional: true, Attributes: map[string]schema.Attribute{ "absent": schema.StringAttribute{ - Description: "Name of a tag which must *not* be present on the DNS record. Tag filters are case-insensitive.\n", + Description: "Name of a tag which must *not* be present on the DNS record. Tag filters are case-insensitive.", Optional: true, }, "contains": schema.StringAttribute{ - Description: "A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value contains ``. Tag filters are case-insensitive.\n", + Description: "A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value contains ``. Tag filters are case-insensitive.", Optional: true, }, "endswith": schema.StringAttribute{ - Description: "A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value ends with ``. Tag filters are case-insensitive.\n", + Description: "A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value ends with ``. Tag filters are case-insensitive.", Optional: true, }, "exact": schema.StringAttribute{ - Description: "A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value is ``. Tag filters are case-insensitive.\n", + Description: "A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value is ``. Tag filters are case-insensitive.", Optional: true, }, "present": schema.StringAttribute{ - Description: "Name of a tag which must be present on the DNS record. Tag filters are case-insensitive.\n", + Description: "Name of a tag which must be present on the DNS record. Tag filters are case-insensitive.", Optional: true, }, "startswith": schema.StringAttribute{ - Description: "A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value starts with ``. Tag filters are case-insensitive.\n", + Description: "A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value starts with ``. Tag filters are case-insensitive.", Optional: true, }, }, }, "tag_match": schema.StringAttribute{ - Description: "Whether to match all tag search requirements or at least one (any). If set to `all`, acts like a logical AND between tag filters. If set to `any`, acts like a logical OR instead. Note that the regular `match` parameter is still used to combine the resulting condition with other filters that aren't related to tags.\n", + Description: "Whether to match all tag search requirements or at least one (any). If set to `all`, acts like a logical AND between tag filters. If set to `any`, acts like a logical OR instead. Note that the regular `match` parameter is still used to combine the resulting condition with other filters that aren't related to tags.\nAvailable values: \"any\", \"all\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -530,7 +530,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "Record type.", + Description: "Record type.\nAvailable values: \"A\", \"AAAA\", \"CAA\", \"CERT\", \"CNAME\", \"DNSKEY\", \"DS\", \"HTTPS\", \"LOC\", \"MX\", \"NAPTR\", \"NS\", \"OPENPGPKEY\", \"PTR\", \"SMIMEA\", \"SRV\", \"SSHFP\", \"SVCB\", \"TLSA\", \"TXT\", \"URI\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/dns_record/list_data_source_schema.go b/internal/services/dns_record/list_data_source_schema.go index fec7598188..979c9d42f9 100755 --- a/internal/services/dns_record/list_data_source_schema.go +++ b/internal/services/dns_record/list_data_source_schema.go @@ -29,11 +29,11 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "search": schema.StringAttribute{ - Description: "Allows searching in multiple properties of a DNS record simultaneously. This parameter is intended for human users, not automation. Its exact behavior is intentionally left unspecified and is subject to change in the future. This parameter works independently of the `match` setting. For automated searches, please use the other available parameters.\n", + Description: "Allows searching in multiple properties of a DNS record simultaneously. This parameter is intended for human users, not automation. Its exact behavior is intentionally left unspecified and is subject to change in the future. This parameter works independently of the `match` setting. For automated searches, please use the other available parameters.", Optional: true, }, "type": schema.StringAttribute{ - Description: "Record type.", + Description: "Record type.\nAvailable values: \"A\", \"AAAA\", \"CAA\", \"CERT\", \"CNAME\", \"DNSKEY\", \"DS\", \"HTTPS\", \"LOC\", \"MX\", \"NAPTR\", \"NS\", \"OPENPGPKEY\", \"PTR\", \"SMIMEA\", \"SRV\", \"SSHFP\", \"SVCB\", \"TLSA\", \"TXT\", \"URI\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -65,27 +65,27 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "absent": schema.StringAttribute{ - Description: "If this parameter is present, only records *without* a comment are returned.\n", + Description: "If this parameter is present, only records *without* a comment are returned.", Optional: true, }, "contains": schema.StringAttribute{ - Description: "Substring of the DNS record comment. Comment filters are case-insensitive.\n", + Description: "Substring of the DNS record comment. Comment filters are case-insensitive.", Optional: true, }, "endswith": schema.StringAttribute{ - Description: "Suffix of the DNS record comment. Comment filters are case-insensitive.\n", + Description: "Suffix of the DNS record comment. Comment filters are case-insensitive.", Optional: true, }, "exact": schema.StringAttribute{ - Description: "Exact value of the DNS record comment. Comment filters are case-insensitive.\n", + Description: "Exact value of the DNS record comment. Comment filters are case-insensitive.", Optional: true, }, "present": schema.StringAttribute{ - Description: "If this parameter is present, only records *with* a comment are returned.\n", + Description: "If this parameter is present, only records *with* a comment are returned.", Optional: true, }, "startswith": schema.StringAttribute{ - Description: "Prefix of the DNS record comment. Comment filters are case-insensitive.\n", + Description: "Prefix of the DNS record comment. Comment filters are case-insensitive.", Optional: true, }, }, @@ -94,19 +94,19 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "contains": schema.StringAttribute{ - Description: "Substring of the DNS record content. Content filters are case-insensitive.\n", + Description: "Substring of the DNS record content. Content filters are case-insensitive.", Optional: true, }, "endswith": schema.StringAttribute{ - Description: "Suffix of the DNS record content. Content filters are case-insensitive.\n", + Description: "Suffix of the DNS record content. Content filters are case-insensitive.", Optional: true, }, "exact": schema.StringAttribute{ - Description: "Exact value of the DNS record content. Content filters are case-insensitive.\n", + Description: "Exact value of the DNS record content. Content filters are case-insensitive.", Optional: true, }, "startswith": schema.StringAttribute{ - Description: "Prefix of the DNS record content. Content filters are case-insensitive.\n", + Description: "Prefix of the DNS record content. Content filters are case-insensitive.", Optional: true, }, }, @@ -115,19 +115,19 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "contains": schema.StringAttribute{ - Description: "Substring of the DNS record name. Name filters are case-insensitive.\n", + Description: "Substring of the DNS record name. Name filters are case-insensitive.", Optional: true, }, "endswith": schema.StringAttribute{ - Description: "Suffix of the DNS record name. Name filters are case-insensitive.\n", + Description: "Suffix of the DNS record name. Name filters are case-insensitive.", Optional: true, }, "exact": schema.StringAttribute{ - Description: "Exact value of the DNS record name. Name filters are case-insensitive.\n", + Description: "Exact value of the DNS record name. Name filters are case-insensitive.", Optional: true, }, "startswith": schema.StringAttribute{ - Description: "Prefix of the DNS record name. Name filters are case-insensitive.\n", + Description: "Prefix of the DNS record name. Name filters are case-insensitive.", Optional: true, }, }, @@ -136,33 +136,33 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "absent": schema.StringAttribute{ - Description: "Name of a tag which must *not* be present on the DNS record. Tag filters are case-insensitive.\n", + Description: "Name of a tag which must *not* be present on the DNS record. Tag filters are case-insensitive.", Optional: true, }, "contains": schema.StringAttribute{ - Description: "A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value contains ``. Tag filters are case-insensitive.\n", + Description: "A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value contains ``. Tag filters are case-insensitive.", Optional: true, }, "endswith": schema.StringAttribute{ - Description: "A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value ends with ``. Tag filters are case-insensitive.\n", + Description: "A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value ends with ``. Tag filters are case-insensitive.", Optional: true, }, "exact": schema.StringAttribute{ - Description: "A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value is ``. Tag filters are case-insensitive.\n", + Description: "A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value is ``. Tag filters are case-insensitive.", Optional: true, }, "present": schema.StringAttribute{ - Description: "Name of a tag which must be present on the DNS record. Tag filters are case-insensitive.\n", + Description: "Name of a tag which must be present on the DNS record. Tag filters are case-insensitive.", Optional: true, }, "startswith": schema.StringAttribute{ - Description: "A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value starts with ``. Tag filters are case-insensitive.\n", + Description: "A tag and value, of the form `:`. The API will only return DNS records that have a tag named `` whose value starts with ``. Tag filters are case-insensitive.", Optional: true, }, }, }, "direction": schema.StringAttribute{ - Description: "Direction to order DNS records in.", + Description: "Direction to order DNS records in.\nAvailable values: \"asc\", \"desc\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -170,7 +170,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "match": schema.StringAttribute{ - Description: "Whether to match all search requirements or at least one (any). If set to `all`, acts like a logical AND between filters. If set to `any`, acts like a logical OR instead. Note that the interaction between tag filters is controlled by the `tag-match` parameter instead.\n", + Description: "Whether to match all search requirements or at least one (any). If set to `all`, acts like a logical AND between filters. If set to `any`, acts like a logical OR instead. Note that the interaction between tag filters is controlled by the `tag-match` parameter instead.\nAvailable values: \"any\", \"all\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -178,7 +178,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "order": schema.StringAttribute{ - Description: "Field to order DNS records by.", + Description: "Field to order DNS records by.\nAvailable values: \"type\", \"name\", \"content\", \"ttl\", \"proxied\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -197,7 +197,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "tag_match": schema.StringAttribute{ - Description: "Whether to match all tag search requirements or at least one (any). If set to `all`, acts like a logical AND between tag filters. If set to `any`, acts like a logical OR instead. Note that the regular `match` parameter is still used to combine the resulting condition with other filters that aren't related to tags.\n", + Description: "Whether to match all tag search requirements or at least one (any). If set to `all`, acts like a logical AND between tag filters. If set to `any`, acts like a logical OR instead. Note that the regular `match` parameter is still used to combine the resulting condition with other filters that aren't related to tags.\nAvailable values: \"any\", \"all\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -266,7 +266,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "Record type.", + Description: "Record type.\nAvailable values: \"A\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -420,7 +420,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "lat_direction": schema.StringAttribute{ - Description: "Latitude direction.", + Description: "Latitude direction.\nAvailable values: \"N\", \"S\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("N", "S"), @@ -448,7 +448,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "long_direction": schema.StringAttribute{ - Description: "Longitude direction.", + Description: "Longitude direction.\nAvailable values: \"E\", \"W\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("E", "W"), diff --git a/internal/services/dns_record/resource.go b/internal/services/dns_record/resource.go index eb34f5c3ed..2ff5dae2e1 100755 --- a/internal/services/dns_record/resource.go +++ b/internal/services/dns_record/resource.go @@ -182,7 +182,7 @@ func (r *DNSRecordResource) Read(ctx context.Context, req resource.ReadRequest, return } bytes, _ := io.ReadAll(res.Body) - err = apijson.UnmarshalComputed(bytes, &env) + err = apijson.Unmarshal(bytes, &env) if err != nil { resp.Diagnostics.AddError("failed to deserialize http request", err.Error()) return diff --git a/internal/services/dns_record/schema.go b/internal/services/dns_record/schema.go index f488667cf1..4dd145f9c6 100755 --- a/internal/services/dns_record/schema.go +++ b/internal/services/dns_record/schema.go @@ -57,8 +57,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "Record type.", Required: true, + Description: "Record type.\nAvailable values: \"A\".", Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "A", @@ -209,7 +209,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "lat_direction": schema.StringAttribute{ - Description: "Latitude direction.", + Description: "Latitude direction.\nAvailable values: \"N\", \"S\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("N", "S"), @@ -241,7 +241,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "long_direction": schema.StringAttribute{ - Description: "Longitude direction.", + Description: "Longitude direction.\nAvailable values: \"E\", \"W\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("E", "W"), diff --git a/internal/services/dns_settings/data_source_schema.go b/internal/services/dns_settings/data_source_schema.go index 43924d1c2f..d84ba773db 100644 --- a/internal/services/dns_settings/data_source_schema.go +++ b/internal/services/dns_settings/data_source_schema.go @@ -61,7 +61,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[DNSSettingsZoneDefaultsNameserversDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "type": schema.StringAttribute{ - Description: "Nameserver type", + Description: "Nameserver type\nAvailable values: \"cloudflare.standard\", \"cloudflare.standard.random\", \"custom.account\", \"custom.tenant\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -136,7 +136,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "zone_mode": schema.StringAttribute{ - Description: "Whether the zone mode is a regular or CDN/DNS only zone.", + Description: "Whether the zone mode is a regular or CDN/DNS only zone.\nAvailable values: \"standard\", \"cdn_only\", \"dns_only\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/dns_settings/schema.go b/internal/services/dns_settings/schema.go index 8d2bc5df02..b4c6490f26 100644 --- a/internal/services/dns_settings/schema.go +++ b/internal/services/dns_settings/schema.go @@ -67,7 +67,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[DNSSettingsZoneDefaultsNameserversModel](ctx), Attributes: map[string]schema.Attribute{ "type": schema.StringAttribute{ - Description: "Nameserver type", + Description: "Nameserver type\nAvailable values: \"cloudflare.standard\", \"cloudflare.standard.random\", \"custom.account\", \"custom.tenant\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -143,7 +143,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "zone_mode": schema.StringAttribute{ - Description: "Whether the zone mode is a regular or CDN/DNS only zone.", + Description: "Whether the zone mode is a regular or CDN/DNS only zone.\nAvailable values: \"standard\", \"cdn_only\", \"dns_only\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/dns_settings_internal_view/data_source_schema.go b/internal/services/dns_settings_internal_view/data_source_schema.go index 57b760841d..e4a3daaac2 100644 --- a/internal/services/dns_settings_internal_view/data_source_schema.go +++ b/internal/services/dns_settings_internal_view/data_source_schema.go @@ -57,7 +57,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "Direction to order DNS views in.", + Description: "Direction to order DNS views in.\nAvailable values: \"asc\", \"desc\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -65,7 +65,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "match": schema.StringAttribute{ - Description: "Whether to match all search requirements or at least one (any). If set to `all`, acts like a logical AND between filters. If set to `any`, acts like a logical OR instead.\n", + Description: "Whether to match all search requirements or at least one (any). If set to `all`, acts like a logical AND between filters. If set to `any`, acts like a logical OR instead.\nAvailable values: \"any\", \"all\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -76,25 +76,25 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "contains": schema.StringAttribute{ - Description: "Substring of the DNS view name.\n", + Description: "Substring of the DNS view name.", Optional: true, }, "endswith": schema.StringAttribute{ - Description: "Suffix of the DNS view name.\n", + Description: "Suffix of the DNS view name.", Optional: true, }, "exact": schema.StringAttribute{ - Description: "Exact value of the DNS view name.\n", + Description: "Exact value of the DNS view name.", Optional: true, }, "startswith": schema.StringAttribute{ - Description: "Prefix of the DNS view name.\n", + Description: "Prefix of the DNS view name.", Optional: true, }, }, }, "order": schema.StringAttribute{ - Description: "Field to order DNS views by.", + Description: "Field to order DNS views by.\nAvailable values: \"name\", \"created_on\", \"modified_on\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -105,11 +105,11 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "zone_id": schema.StringAttribute{ - Description: "A zone ID that exists in the zones list for the view.\n", + Description: "A zone ID that exists in the zones list for the view.", Optional: true, }, "zone_name": schema.StringAttribute{ - Description: "A zone name that exists in the zones list for the view.\n", + Description: "A zone name that exists in the zones list for the view.", Optional: true, }, }, diff --git a/internal/services/dns_settings_internal_view/list_data_source_schema.go b/internal/services/dns_settings_internal_view/list_data_source_schema.go index 2a53ada4eb..86d1127979 100644 --- a/internal/services/dns_settings_internal_view/list_data_source_schema.go +++ b/internal/services/dns_settings_internal_view/list_data_source_schema.go @@ -25,7 +25,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "order": schema.StringAttribute{ - Description: "Field to order DNS views by.", + Description: "Field to order DNS views by.\nAvailable values: \"name\", \"created_on\", \"modified_on\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -36,36 +36,36 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "zone_id": schema.StringAttribute{ - Description: "A zone ID that exists in the zones list for the view.\n", + Description: "A zone ID that exists in the zones list for the view.", Optional: true, }, "zone_name": schema.StringAttribute{ - Description: "A zone name that exists in the zones list for the view.\n", + Description: "A zone name that exists in the zones list for the view.", Optional: true, }, "name": schema.SingleNestedAttribute{ Optional: true, Attributes: map[string]schema.Attribute{ "contains": schema.StringAttribute{ - Description: "Substring of the DNS view name.\n", + Description: "Substring of the DNS view name.", Optional: true, }, "endswith": schema.StringAttribute{ - Description: "Suffix of the DNS view name.\n", + Description: "Suffix of the DNS view name.", Optional: true, }, "exact": schema.StringAttribute{ - Description: "Exact value of the DNS view name.\n", + Description: "Exact value of the DNS view name.", Optional: true, }, "startswith": schema.StringAttribute{ - Description: "Prefix of the DNS view name.\n", + Description: "Prefix of the DNS view name.", Optional: true, }, }, }, "direction": schema.StringAttribute{ - Description: "Direction to order DNS views in.", + Description: "Direction to order DNS views in.\nAvailable values: \"asc\", \"desc\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -73,7 +73,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "match": schema.StringAttribute{ - Description: "Whether to match all search requirements or at least one (any). If set to `all`, acts like a logical AND between filters. If set to `any`, acts like a logical OR instead.\n", + Description: "Whether to match all search requirements or at least one (any). If set to `all`, acts like a logical AND between filters. If set to `any`, acts like a logical OR instead.\nAvailable values: \"any\", \"all\".", Computed: true, Optional: true, Validators: []validator.String{ diff --git a/internal/services/email_routing_address/data_source_schema.go b/internal/services/email_routing_address/data_source_schema.go index 4f2ca40717..9e6e03783c 100644 --- a/internal/services/email_routing_address/data_source_schema.go +++ b/internal/services/email_routing_address/data_source_schema.go @@ -58,7 +58,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "Sorts results in an ascending or descending order.", + Description: "Sorts results in an ascending or descending order.\nAvailable values: \"asc\", \"desc\".", Computed: true, Optional: true, Validators: []validator.String{ diff --git a/internal/services/email_routing_address/list_data_source_schema.go b/internal/services/email_routing_address/list_data_source_schema.go index 0bee2d0113..d5f83c9bf7 100644 --- a/internal/services/email_routing_address/list_data_source_schema.go +++ b/internal/services/email_routing_address/list_data_source_schema.go @@ -24,7 +24,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "direction": schema.StringAttribute{ - Description: "Sorts results in an ascending or descending order.", + Description: "Sorts results in an ascending or descending order.\nAvailable values: \"asc\", \"desc\".", Computed: true, Optional: true, Validators: []validator.String{ diff --git a/internal/services/email_routing_catch_all/data_source_schema.go b/internal/services/email_routing_catch_all/data_source_schema.go index 1781763e5e..f3691acf5e 100644 --- a/internal/services/email_routing_catch_all/data_source_schema.go +++ b/internal/services/email_routing_catch_all/data_source_schema.go @@ -45,7 +45,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "type": schema.StringAttribute{ - Description: "Type of action for catch-all rule.", + Description: "Type of action for catch-all rule.\nAvailable values: \"drop\", \"forward\", \"worker\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -70,7 +70,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "type": schema.StringAttribute{ - Description: "Type of matcher. Default is 'all'.", + Description: "Type of matcher. Default is 'all'.\nAvailable values: \"all\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("all"), diff --git a/internal/services/email_routing_catch_all/schema.go b/internal/services/email_routing_catch_all/schema.go index e05f4eab5e..6d74b929ab 100644 --- a/internal/services/email_routing_catch_all/schema.go +++ b/internal/services/email_routing_catch_all/schema.go @@ -36,7 +36,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "type": schema.StringAttribute{ - Description: "Type of action for catch-all rule.", + Description: "Type of action for catch-all rule.\nAvailable values: \"drop\", \"forward\", \"worker\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -59,7 +59,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "type": schema.StringAttribute{ - Description: "Type of matcher. Default is 'all'.", + Description: "Type of matcher. Default is 'all'.\nAvailable values: \"all\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("all"), diff --git a/internal/services/email_routing_dns/data_source_model.go b/internal/services/email_routing_dns/data_source_model.go index 10cfe56370..0da0ae0aff 100644 --- a/internal/services/email_routing_dns/data_source_model.go +++ b/internal/services/email_routing_dns/data_source_model.go @@ -27,6 +27,10 @@ func (m *EmailRoutingDNSDataSourceModel) toReadParams(_ context.Context) (params ZoneID: cloudflare.F(m.ZoneID.ValueString()), } + if !m.Subdomain.IsNull() { + params.Subdomain = cloudflare.F(m.Subdomain.ValueString()) + } + return } diff --git a/internal/services/email_routing_dns/data_source_schema.go b/internal/services/email_routing_dns/data_source_schema.go index 3d41888032..0b1cbc4b20 100644 --- a/internal/services/email_routing_dns/data_source_schema.go +++ b/internal/services/email_routing_dns/data_source_schema.go @@ -105,7 +105,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "DNS record type.", + Description: "DNS record type.\nAvailable values: \"A\", \"AAAA\", \"CNAME\", \"HTTPS\", \"TXT\", \"SRV\", \"LOC\", \"MX\", \"NS\", \"CERT\", \"DNSKEY\", \"DS\", \"NAPTR\", \"SMIMEA\", \"SSHFP\", \"SVCB\", \"TLSA\", \"URI\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -163,7 +163,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "DNS record type.", + Description: "DNS record type.\nAvailable values: \"A\", \"AAAA\", \"CNAME\", \"HTTPS\", \"TXT\", \"SRV\", \"LOC\", \"MX\", \"NS\", \"CERT\", \"DNSKEY\", \"DS\", \"NAPTR\", \"SMIMEA\", \"SSHFP\", \"SVCB\", \"TLSA\", \"URI\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -214,7 +214,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "DNS record type.", + Description: "DNS record type.\nAvailable values: \"A\", \"AAAA\", \"CNAME\", \"HTTPS\", \"TXT\", \"SRV\", \"LOC\", \"MX\", \"NS\", \"CERT\", \"DNSKEY\", \"DS\", \"NAPTR\", \"SMIMEA\", \"SSHFP\", \"SVCB\", \"TLSA\", \"URI\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/email_routing_dns/schema.go b/internal/services/email_routing_dns/schema.go index a03096adc8..45ebbf5efc 100644 --- a/internal/services/email_routing_dns/schema.go +++ b/internal/services/email_routing_dns/schema.go @@ -55,7 +55,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Show the state of your account, and the type or configuration error.", + Description: "Show the state of your account, and the type or configuration error.\nAvailable values: \"ready\", \"unconfigured\", \"misconfigured\", \"misconfigured/locked\", \"unlocked\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -149,7 +149,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "DNS record type.", + Description: "DNS record type.\nAvailable values: \"A\", \"AAAA\", \"CNAME\", \"HTTPS\", \"TXT\", \"SRV\", \"LOC\", \"MX\", \"NS\", \"CERT\", \"DNSKEY\", \"DS\", \"NAPTR\", \"SMIMEA\", \"SSHFP\", \"SVCB\", \"TLSA\", \"URI\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -207,7 +207,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "DNS record type.", + Description: "DNS record type.\nAvailable values: \"A\", \"AAAA\", \"CNAME\", \"HTTPS\", \"TXT\", \"SRV\", \"LOC\", \"MX\", \"NS\", \"CERT\", \"DNSKEY\", \"DS\", \"NAPTR\", \"SMIMEA\", \"SSHFP\", \"SVCB\", \"TLSA\", \"URI\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -258,7 +258,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "DNS record type.", + Description: "DNS record type.\nAvailable values: \"A\", \"AAAA\", \"CNAME\", \"HTTPS\", \"TXT\", \"SRV\", \"LOC\", \"MX\", \"NS\", \"CERT\", \"DNSKEY\", \"DS\", \"NAPTR\", \"SMIMEA\", \"SSHFP\", \"SVCB\", \"TLSA\", \"URI\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/email_routing_rule/data_source_schema.go b/internal/services/email_routing_rule/data_source_schema.go index 67b1321ce8..5f9b11e934 100644 --- a/internal/services/email_routing_rule/data_source_schema.go +++ b/internal/services/email_routing_rule/data_source_schema.go @@ -59,7 +59,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "type": schema.StringAttribute{ - Description: "Type of supported action.", + Description: "Type of supported action.\nAvailable values: \"drop\", \"forward\", \"worker\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -84,14 +84,14 @@ func DataSourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "field": schema.StringAttribute{ - Description: "Field for type matcher.", + Description: "Field for type matcher.\nAvailable values: \"to\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("to"), }, }, "type": schema.StringAttribute{ - Description: "Type of matcher.", + Description: "Type of matcher.\nAvailable values: \"literal\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("literal"), diff --git a/internal/services/email_routing_rule/list_data_source_schema.go b/internal/services/email_routing_rule/list_data_source_schema.go index 6d9511a167..d01bad82f9 100644 --- a/internal/services/email_routing_rule/list_data_source_schema.go +++ b/internal/services/email_routing_rule/list_data_source_schema.go @@ -52,7 +52,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "type": schema.StringAttribute{ - Description: "Type of supported action.", + Description: "Type of supported action.\nAvailable values: \"drop\", \"forward\", \"worker\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -81,14 +81,14 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "field": schema.StringAttribute{ - Description: "Field for type matcher.", + Description: "Field for type matcher.\nAvailable values: \"to\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("to"), }, }, "type": schema.StringAttribute{ - Description: "Type of matcher.", + Description: "Type of matcher.\nAvailable values: \"literal\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("literal"), diff --git a/internal/services/email_routing_rule/schema.go b/internal/services/email_routing_rule/schema.go index 8ca13babab..45b35195ca 100644 --- a/internal/services/email_routing_rule/schema.go +++ b/internal/services/email_routing_rule/schema.go @@ -38,7 +38,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "type": schema.StringAttribute{ - Description: "Type of supported action.", + Description: "Type of supported action.\nAvailable values: \"drop\", \"forward\", \"worker\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -61,14 +61,14 @@ func ResourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "field": schema.StringAttribute{ - Description: "Field for type matcher.", + Description: "Field for type matcher.\nAvailable values: \"to\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("to"), }, }, "type": schema.StringAttribute{ - Description: "Type of matcher.", + Description: "Type of matcher.\nAvailable values: \"literal\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("literal"), diff --git a/internal/services/email_routing_settings/data_source_schema.go b/internal/services/email_routing_settings/data_source_schema.go index 91d74f4cf5..74caf989e8 100644 --- a/internal/services/email_routing_settings/data_source_schema.go +++ b/internal/services/email_routing_settings/data_source_schema.go @@ -48,7 +48,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Show the state of your account, and the type or configuration error.", + Description: "Show the state of your account, and the type or configuration error.\nAvailable values: \"ready\", \"unconfigured\", \"misconfigured\", \"misconfigured/locked\", \"unlocked\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/email_routing_settings/schema.go b/internal/services/email_routing_settings/schema.go index bc98760425..c26c310b04 100644 --- a/internal/services/email_routing_settings/schema.go +++ b/internal/services/email_routing_settings/schema.go @@ -52,7 +52,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Show the state of your account, and the type or configuration error.", + Description: "Show the state of your account, and the type or configuration error.\nAvailable values: \"ready\", \"unconfigured\", \"misconfigured\", \"misconfigured/locked\", \"unlocked\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/email_security_block_sender/data_source_schema.go b/internal/services/email_security_block_sender/data_source_schema.go index 3820ec3816..556fe8dbc4 100644 --- a/internal/services/email_security_block_sender/data_source_schema.go +++ b/internal/services/email_security_block_sender/data_source_schema.go @@ -49,7 +49,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "pattern_type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"EMAIL\", \"DOMAIN\", \"IP\", \"UNKNOWN\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "EMAIL", @@ -63,21 +64,22 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "The sorting direction.", + Description: "The sorting direction.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), }, }, "order": schema.StringAttribute{ - Description: "The field to sort by.", + Description: "The field to sort by.\nAvailable values: \"pattern\", \"created_at\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("pattern", "created_at"), }, }, "pattern_type": schema.StringAttribute{ - Optional: true, + Description: "Available values: \"EMAIL\", \"DOMAIN\", \"IP\", \"UNKNOWN\".", + Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "EMAIL", diff --git a/internal/services/email_security_block_sender/list_data_source_schema.go b/internal/services/email_security_block_sender/list_data_source_schema.go index 796bad41bd..dc610b6ca4 100644 --- a/internal/services/email_security_block_sender/list_data_source_schema.go +++ b/internal/services/email_security_block_sender/list_data_source_schema.go @@ -24,21 +24,22 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "direction": schema.StringAttribute{ - Description: "The sorting direction.", + Description: "The sorting direction.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), }, }, "order": schema.StringAttribute{ - Description: "The field to sort by.", + Description: "The field to sort by.\nAvailable values: \"pattern\", \"created_at\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("pattern", "created_at"), }, }, "pattern_type": schema.StringAttribute{ - Optional: true, + Description: "Available values: \"EMAIL\", \"DOMAIN\", \"IP\", \"UNKNOWN\".", + Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "EMAIL", @@ -84,7 +85,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "pattern_type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"EMAIL\", \"DOMAIN\", \"IP\", \"UNKNOWN\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "EMAIL", diff --git a/internal/services/email_security_block_sender/schema.go b/internal/services/email_security_block_sender/schema.go index d443bb0113..d5f3fc4b57 100644 --- a/internal/services/email_security_block_sender/schema.go +++ b/internal/services/email_security_block_sender/schema.go @@ -37,7 +37,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "pattern_type": schema.StringAttribute{ - Required: true, + Description: "Available values: \"EMAIL\", \"DOMAIN\", \"IP\", \"UNKNOWN\".", + Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "EMAIL", diff --git a/internal/services/email_security_impersonation_registry/data_source_schema.go b/internal/services/email_security_impersonation_registry/data_source_schema.go index e9da13d76c..c1d417077a 100644 --- a/internal/services/email_security_impersonation_registry/data_source_schema.go +++ b/internal/services/email_security_impersonation_registry/data_source_schema.go @@ -65,14 +65,14 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "The sorting direction.", + Description: "The sorting direction.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), }, }, "order": schema.StringAttribute{ - Description: "The field to sort by.", + Description: "The field to sort by.\nAvailable values: \"name\", \"email\", \"created_at\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -83,7 +83,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "provenance": schema.StringAttribute{ - Optional: true, + Description: "Available values: \"A1S_INTERNAL\", \"SNOOPY-CASB_OFFICE_365\", \"SNOOPY-OFFICE_365\", \"SNOOPY-GOOGLE_DIRECTORY\".", + Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "A1S_INTERNAL", diff --git a/internal/services/email_security_impersonation_registry/list_data_source_schema.go b/internal/services/email_security_impersonation_registry/list_data_source_schema.go index 56c566707d..1cba1090ce 100644 --- a/internal/services/email_security_impersonation_registry/list_data_source_schema.go +++ b/internal/services/email_security_impersonation_registry/list_data_source_schema.go @@ -24,14 +24,14 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "direction": schema.StringAttribute{ - Description: "The sorting direction.", + Description: "The sorting direction.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), }, }, "order": schema.StringAttribute{ - Description: "The field to sort by.", + Description: "The field to sort by.\nAvailable values: \"name\", \"email\", \"created_at\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -42,7 +42,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "provenance": schema.StringAttribute{ - Optional: true, + Description: "Available values: \"A1S_INTERNAL\", \"SNOOPY-CASB_OFFICE_365\", \"SNOOPY-OFFICE_365\", \"SNOOPY-GOOGLE_DIRECTORY\".", + Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "A1S_INTERNAL", diff --git a/internal/services/email_security_trusted_domains/data_source_schema.go b/internal/services/email_security_trusted_domains/data_source_schema.go index aa0d2e5a19..3867567725 100644 --- a/internal/services/email_security_trusted_domains/data_source_schema.go +++ b/internal/services/email_security_trusted_domains/data_source_schema.go @@ -60,7 +60,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "The sorting direction.", + Description: "The sorting direction.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), @@ -73,7 +73,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "order": schema.StringAttribute{ - Description: "The field to sort by.", + Description: "The field to sort by.\nAvailable values: \"pattern\", \"created_at\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("pattern", "created_at"), diff --git a/internal/services/email_security_trusted_domains/list_data_source_schema.go b/internal/services/email_security_trusted_domains/list_data_source_schema.go index 6aa26b12d7..b23e4ef03b 100644 --- a/internal/services/email_security_trusted_domains/list_data_source_schema.go +++ b/internal/services/email_security_trusted_domains/list_data_source_schema.go @@ -24,7 +24,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "direction": schema.StringAttribute{ - Description: "The sorting direction.", + Description: "The sorting direction.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), @@ -37,7 +37,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "order": schema.StringAttribute{ - Description: "The field to sort by.", + Description: "The field to sort by.\nAvailable values: \"pattern\", \"created_at\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("pattern", "created_at"), diff --git a/internal/services/firewall_rule/data_source_schema.go b/internal/services/firewall_rule/data_source_schema.go index 777901aeb4..7f16419ff1 100644 --- a/internal/services/firewall_rule/data_source_schema.go +++ b/internal/services/firewall_rule/data_source_schema.go @@ -35,7 +35,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "action": schema.StringAttribute{ - Description: "The action to apply to a matched request. The `log` action is only available on an Enterprise plan.", + Description: "The action to apply to a matched request. The `log` action is only available on an Enterprise plan.\nAvailable values: \"block\", \"challenge\", \"js_challenge\", \"managed_challenge\", \"allow\", \"log\", \"bypass\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/firewall_rule/list_data_source_schema.go b/internal/services/firewall_rule/list_data_source_schema.go index bd93a1a0ae..19c666747c 100644 --- a/internal/services/firewall_rule/list_data_source_schema.go +++ b/internal/services/firewall_rule/list_data_source_schema.go @@ -59,7 +59,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "action": schema.StringAttribute{ - Description: "The action to apply to a matched request. The `log` action is only available on an Enterprise plan.", + Description: "The action to apply to a matched request. The `log` action is only available on an Enterprise plan.\nAvailable values: \"block\", \"challenge\", \"js_challenge\", \"managed_challenge\", \"allow\", \"log\", \"bypass\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/firewall_rule/schema.go b/internal/services/firewall_rule/schema.go index da9f6855a4..8ad9a0a3cb 100644 --- a/internal/services/firewall_rule/schema.go +++ b/internal/services/firewall_rule/schema.go @@ -37,7 +37,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, Attributes: map[string]schema.Attribute{ "mode": schema.StringAttribute{ - Description: "The action to perform.", + Description: "The action to perform.\nAvailable values: \"simulate\", \"ban\", \"challenge\", \"js_challenge\", \"managed_challenge\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/healthcheck/data_source_schema.go b/internal/services/healthcheck/data_source_schema.go index 4d5d633e39..3529501cf9 100644 --- a/internal/services/healthcheck/data_source_schema.go +++ b/internal/services/healthcheck/data_source_schema.go @@ -73,7 +73,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "The current status of the origin server according to the health check.", + Description: "The current status of the origin server according to the health check.\nAvailable values: \"unknown\", \"healthy\", \"unhealthy\", \"suspended\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -154,7 +154,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "method": schema.StringAttribute{ - Description: "The HTTP method to use for the health check.", + Description: "The HTTP method to use for the health check.\nAvailable values: \"GET\", \"HEAD\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("GET", "HEAD"), @@ -176,7 +176,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[HealthcheckTCPConfigDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "method": schema.StringAttribute{ - Description: "The TCP connection method to use for the health check.", + Description: "The TCP connection method to use for the health check.\nAvailable values: \"connection_established\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("connection_established"), diff --git a/internal/services/healthcheck/list_data_source_schema.go b/internal/services/healthcheck/list_data_source_schema.go index c2aefe25c3..fa5a167400 100644 --- a/internal/services/healthcheck/list_data_source_schema.go +++ b/internal/services/healthcheck/list_data_source_schema.go @@ -124,7 +124,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "method": schema.StringAttribute{ - Description: "The HTTP method to use for the health check.", + Description: "The HTTP method to use for the health check.\nAvailable values: \"GET\", \"HEAD\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("GET", "HEAD"), @@ -157,7 +157,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "The current status of the origin server according to the health check.", + Description: "The current status of the origin server according to the health check.\nAvailable values: \"unknown\", \"healthy\", \"unhealthy\", \"suspended\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -178,7 +178,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[HealthchecksTCPConfigDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "method": schema.StringAttribute{ - Description: "The TCP connection method to use for the health check.", + Description: "The TCP connection method to use for the health check.\nAvailable values: \"connection_established\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("connection_established"), diff --git a/internal/services/healthcheck/schema.go b/internal/services/healthcheck/schema.go index daab584353..2b08f3adff 100644 --- a/internal/services/healthcheck/schema.go +++ b/internal/services/healthcheck/schema.go @@ -149,7 +149,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "method": schema.StringAttribute{ - Description: "The HTTP method to use for the health check.", + Description: "The HTTP method to use for the health check.\nAvailable values: \"GET\", \"HEAD\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -178,7 +178,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[HealthcheckTCPConfigModel](ctx), Attributes: map[string]schema.Attribute{ "method": schema.StringAttribute{ - Description: "The TCP connection method to use for the health check.", + Description: "The TCP connection method to use for the health check.\nAvailable values: \"connection_established\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -207,7 +207,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "status": schema.StringAttribute{ - Description: "The current status of the origin server according to the health check.", + Description: "The current status of the origin server according to the health check.\nAvailable values: \"unknown\", \"healthy\", \"unhealthy\", \"suspended\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/hostname_tls_setting/data_source_schema.go b/internal/services/hostname_tls_setting/data_source_schema.go index 8a8151c227..ef9b373731 100644 --- a/internal/services/hostname_tls_setting/data_source_schema.go +++ b/internal/services/hostname_tls_setting/data_source_schema.go @@ -18,7 +18,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { return schema.Schema{ Attributes: map[string]schema.Attribute{ "setting_id": schema.StringAttribute{ - Description: "The TLS Setting name.", + Description: "The TLS Setting name.\nAvailable values: \"ciphers\", \"min_tls_version\", \"http2\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/hostname_tls_setting/schema.go b/internal/services/hostname_tls_setting/schema.go index 6db1d2da50..abee1cfdea 100644 --- a/internal/services/hostname_tls_setting/schema.go +++ b/internal/services/hostname_tls_setting/schema.go @@ -20,7 +20,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { return schema.Schema{ Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ - Description: "The TLS Setting name.", + Description: "The TLS Setting name.\nAvailable values: \"ciphers\", \"min_tls_version\", \"http2\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -32,7 +32,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "setting_id": schema.StringAttribute{ - Description: "The TLS Setting name.", + Description: "The TLS Setting name.\nAvailable values: \"ciphers\", \"min_tls_version\", \"http2\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/hyperdrive_config/data_source_schema.go b/internal/services/hyperdrive_config/data_source_schema.go index 918025ac18..7bab15991e 100644 --- a/internal/services/hyperdrive_config/data_source_schema.go +++ b/internal/services/hyperdrive_config/data_source_schema.go @@ -82,7 +82,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "scheme": schema.StringAttribute{ - Description: "Specifies the URL scheme used to connect to your origin database.", + Description: "Specifies the URL scheme used to connect to your origin database.\nAvailable values: \"postgres\", \"postgresql\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("postgres", "postgresql"), diff --git a/internal/services/hyperdrive_config/list_data_source_schema.go b/internal/services/hyperdrive_config/list_data_source_schema.go index ba1fc2ce66..c05b146908 100644 --- a/internal/services/hyperdrive_config/list_data_source_schema.go +++ b/internal/services/hyperdrive_config/list_data_source_schema.go @@ -64,7 +64,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "scheme": schema.StringAttribute{ - Description: "Specifies the URL scheme used to connect to your origin database.", + Description: "Specifies the URL scheme used to connect to your origin database.\nAvailable values: \"postgres\", \"postgresql\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("postgres", "postgresql"), diff --git a/internal/services/hyperdrive_config/schema.go b/internal/services/hyperdrive_config/schema.go index aa7a61b6cd..935933ee8d 100644 --- a/internal/services/hyperdrive_config/schema.go +++ b/internal/services/hyperdrive_config/schema.go @@ -54,7 +54,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "scheme": schema.StringAttribute{ - Description: "Specifies the URL scheme used to connect to your origin database.", + Description: "Specifies the URL scheme used to connect to your origin database.\nAvailable values: \"postgres\", \"postgresql\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("postgres", "postgresql"), diff --git a/internal/services/image_variant/data_source_schema.go b/internal/services/image_variant/data_source_schema.go index 6adabcffc9..0a5d769cb4 100644 --- a/internal/services/image_variant/data_source_schema.go +++ b/internal/services/image_variant/data_source_schema.go @@ -38,7 +38,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ImageVariantVariantOptionsDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "fit": schema.StringAttribute{ - Description: "The fit property describes how the width and height dimensions should be interpreted.", + Description: "The fit property describes how the width and height dimensions should be interpreted.\nAvailable values: \"scale-down\", \"contain\", \"cover\", \"crop\", \"pad\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -58,7 +58,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "metadata": schema.StringAttribute{ - Description: "What EXIF data should be preserved in the output image.", + Description: "What EXIF data should be preserved in the output image.\nAvailable values: \"keep\", \"copyright\", \"none\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/image_variant/schema.go b/internal/services/image_variant/schema.go index cf611353ba..ab260d5672 100644 --- a/internal/services/image_variant/schema.go +++ b/internal/services/image_variant/schema.go @@ -35,7 +35,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, Attributes: map[string]schema.Attribute{ "fit": schema.StringAttribute{ - Description: "The fit property describes how the width and height dimensions should be interpreted.", + Description: "The fit property describes how the width and height dimensions should be interpreted.\nAvailable values: \"scale-down\", \"contain\", \"cover\", \"crop\", \"pad\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -55,7 +55,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "metadata": schema.StringAttribute{ - Description: "What EXIF data should be preserved in the output image.", + Description: "What EXIF data should be preserved in the output image.\nAvailable values: \"keep\", \"copyright\", \"none\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -93,7 +93,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ImageVariantVariantOptionsModel](ctx), Attributes: map[string]schema.Attribute{ "fit": schema.StringAttribute{ - Description: "The fit property describes how the width and height dimensions should be interpreted.", + Description: "The fit property describes how the width and height dimensions should be interpreted.\nAvailable values: \"scale-down\", \"contain\", \"cover\", \"crop\", \"pad\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -113,7 +113,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "metadata": schema.StringAttribute{ - Description: "What EXIF data should be preserved in the output image.", + Description: "What EXIF data should be preserved in the output image.\nAvailable values: \"keep\", \"copyright\", \"none\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/ip_ranges/data_source_model.go b/internal/services/ip_ranges/data_source_model.go index b92190bf4c..4a2b7e7ad2 100644 --- a/internal/services/ip_ranges/data_source_model.go +++ b/internal/services/ip_ranges/data_source_model.go @@ -5,6 +5,7 @@ package ip_ranges import ( "context" + "github.com/cloudflare/cloudflare-go/v4" "github.com/cloudflare/cloudflare-go/v4/ips" "github.com/cloudflare/terraform-provider-cloudflare/internal/customfield" "github.com/hashicorp/terraform-plugin-framework/diag" @@ -26,5 +27,9 @@ type IPRangesDataSourceModel struct { func (m *IPRangesDataSourceModel) toReadParams(_ context.Context) (params ips.IPListParams, diags diag.Diagnostics) { params = ips.IPListParams{} + if !m.Networks.IsNull() { + params.Networks = cloudflare.F(m.Networks.ValueString()) + } + return } diff --git a/internal/services/ip_ranges/data_source_test.go b/internal/services/ip_ranges/data_source_test.go new file mode 100644 index 0000000000..749a242ab3 --- /dev/null +++ b/internal/services/ip_ranges/data_source_test.go @@ -0,0 +1,71 @@ +package ip_ranges_test + +import ( + "fmt" + "os" + "strconv" + "testing" + + "github.com/cloudflare/terraform-provider-cloudflare/internal/acctest" + "github.com/cloudflare/terraform-provider-cloudflare/internal/utils" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" +) + +func TestAccCloudflareIPRange_Networks(t *testing.T) { + if os.Getenv("CLOUDFLARE_API_TOKEN") != "" { + t.Setenv("CLOUDFLARE_API_TOKEN", "") + } + + rnd := utils.GenerateRandomResourceName() + name := fmt.Sprintf("data.cloudflare_ip_ranges.%s", rnd) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + acctest.TestAccPreCheck(t) + }, + ProtoV6ProviderFactories: acctest.TestAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccCheckCloudflareIPRangesNetworks(rnd), + Check: resource.ComposeTestCheckFunc( + testAccCheckCloudflareIPRangeCount(name), + ), + }, + }, + }) +} + +func testAccCheckCloudflareIPRangesNetworks(rnd string) string { + return acctest.LoadTestCase("networks.tf", rnd) +} + +func testAccCheckCloudflareIPRangeCount(resourceName string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("not found: %s", resourceName) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("ID is not set") + } + + jdcloudCidrs, _ := strconv.Atoi(rs.Primary.Attributes["jdcloud_cidrs.#"]) + if jdcloudCidrs < 10 { + return fmt.Errorf("jdcloud_cidrs size is suspiciously low. should be > 10, got: %d", jdcloudCidrs) + } + + ipv4Cidrs, _ := strconv.Atoi(rs.Primary.Attributes["ipv4_cidrs.#"]) + if ipv4Cidrs < 10 { + return fmt.Errorf("ipv4_cidrs size is suspiciously low. should be > 10, got: %d", ipv4Cidrs) + } + + ipv6Cidrs, _ := strconv.Atoi(rs.Primary.Attributes["ipv6_cidrs.#"]) + if ipv6Cidrs < 5 { + return fmt.Errorf("ipv6_cidrs size is suspiciously low. should be > 5, got: %d", ipv6Cidrs) + } + + return nil + } +} diff --git a/internal/services/ip_ranges/testdata/networks.tf b/internal/services/ip_ranges/testdata/networks.tf new file mode 100644 index 0000000000..87c43b3128 --- /dev/null +++ b/internal/services/ip_ranges/testdata/networks.tf @@ -0,0 +1,3 @@ +data "cloudflare_ip_ranges" "%[1]s" { + networks = "jdcloud" +} diff --git a/internal/services/keyless_certificate/data_source_schema.go b/internal/services/keyless_certificate/data_source_schema.go index fafa6976f8..ee90161799 100644 --- a/internal/services/keyless_certificate/data_source_schema.go +++ b/internal/services/keyless_certificate/data_source_schema.go @@ -58,7 +58,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Status of the Keyless SSL.", + Description: "Status of the Keyless SSL.\nAvailable values: \"active\", \"deleted\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("active", "deleted"), diff --git a/internal/services/keyless_certificate/list_data_source_schema.go b/internal/services/keyless_certificate/list_data_source_schema.go index 10e9ae22fa..4cc842d7e2 100644 --- a/internal/services/keyless_certificate/list_data_source_schema.go +++ b/internal/services/keyless_certificate/list_data_source_schema.go @@ -74,7 +74,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Status of the Keyless SSL.", + Description: "Status of the Keyless SSL.\nAvailable values: \"active\", \"deleted\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("active", "deleted"), diff --git a/internal/services/keyless_certificate/schema.go b/internal/services/keyless_certificate/schema.go index eeca6c17ab..eee707abb4 100644 --- a/internal/services/keyless_certificate/schema.go +++ b/internal/services/keyless_certificate/schema.go @@ -39,7 +39,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "bundle_method": schema.StringAttribute{ - Description: "A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.", + Description: "A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.\nAvailable values: \"ubiquitous\", \"optimal\", \"force\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -97,7 +97,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "status": schema.StringAttribute{ - Description: "Status of the Keyless SSL.", + Description: "Status of the Keyless SSL.\nAvailable values: \"active\", \"deleted\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("active", "deleted"), diff --git a/internal/services/list/data_source_schema.go b/internal/services/list/data_source_schema.go index c27cfe260d..0b4f239ca2 100644 --- a/internal/services/list/data_source_schema.go +++ b/internal/services/list/data_source_schema.go @@ -37,7 +37,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "kind": schema.StringAttribute{ - Description: "The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).", + Description: "The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).\nAvailable values: \"ip\", \"redirect\", \"hostname\", \"asn\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/list/list_data_source_schema.go b/internal/services/list/list_data_source_schema.go index f83df72a3c..68dab302b9 100644 --- a/internal/services/list/list_data_source_schema.go +++ b/internal/services/list/list_data_source_schema.go @@ -48,7 +48,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "kind": schema.StringAttribute{ - Description: "The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).", + Description: "The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).\nAvailable values: \"ip\", \"redirect\", \"hostname\", \"asn\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/list/schema.go b/internal/services/list/schema.go index e41efe129a..9d7ca15dec 100644 --- a/internal/services/list/schema.go +++ b/internal/services/list/schema.go @@ -29,7 +29,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "kind": schema.StringAttribute{ - Description: "The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).", + Description: "The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).\nAvailable values: \"ip\", \"redirect\", \"hostname\", \"asn\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/list_item/data_source_schema.go b/internal/services/list_item/data_source_schema.go index 2553b9f405..e4ffdde00c 100644 --- a/internal/services/list_item/data_source_schema.go +++ b/internal/services/list_item/data_source_schema.go @@ -84,7 +84,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status_code": schema.Int64Attribute{ - Computed: true, + Description: "Available values: 301, 302, 307, 308.", + Computed: true, Validators: []validator.Int64{ int64validator.OneOf( 301, diff --git a/internal/services/list_item/list_data_source_schema.go b/internal/services/list_item/list_data_source_schema.go index 9ae15d088b..0511e50de6 100644 --- a/internal/services/list_item/list_data_source_schema.go +++ b/internal/services/list_item/list_data_source_schema.go @@ -97,7 +97,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status_code": schema.Int64Attribute{ - Computed: true, + Description: "Available values: 301, 302, 307, 308.", + Computed: true, Validators: []validator.Int64{ int64validator.OneOf( 301, diff --git a/internal/services/list_item/schema.go b/internal/services/list_item/schema.go index 312fe22c90..7e7842c47d 100644 --- a/internal/services/list_item/schema.go +++ b/internal/services/list_item/schema.go @@ -97,8 +97,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: booldefault.StaticBool(false), }, "status_code": schema.Int64Attribute{ - Computed: true, - Optional: true, + Description: "Available values: 301, 302, 307, 308.", + Computed: true, + Optional: true, Validators: []validator.Int64{ int64validator.OneOf( 301, diff --git a/internal/services/load_balancer/data_source_schema.go b/internal/services/load_balancer/data_source_schema.go index c5a1b6ff82..9261141c36 100644 --- a/internal/services/load_balancer/data_source_schema.go +++ b/internal/services/load_balancer/data_source_schema.go @@ -56,7 +56,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "session_affinity": schema.StringAttribute{ - Description: "Specifies the type of session affinity the load balancer should use unless specified as `\"none\"`. The supported types are:\n- `\"cookie\"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used.\n- `\"ip_cookie\"`: Behaves the same as `\"cookie\"` except the initial origin selection is stable and based on the client's ip address.\n- `\"header\"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.", + Description: "Specifies the type of session affinity the load balancer should use unless specified as `\"none\"`. The supported types are:\n- `\"cookie\"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used.\n- `\"ip_cookie\"`: Behaves the same as `\"cookie\"` except the initial origin selection is stable and based on the client's ip address.\n- `\"header\"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.\nAvailable values: \"none\", \"cookie\", \"ip_cookie\", \"header\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -73,8 +73,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "steering_policy": schema.StringAttribute{ - Description: "Steering Policy for this load balancer.\n- `\"off\"`: Use `default_pools`.\n- `\"geo\"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `\"random\"`: Select a pool randomly.\n- `\"dynamic_latency\"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `\"proximity\"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `\"least_outstanding_requests\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `\"least_connections\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `\"\"`: Will map to `\"geo\"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `\"off\"`.", Optional: true, + Description: "Steering Policy for this load balancer.\n- `\"off\"`: Use `default_pools`.\n- `\"geo\"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `\"random\"`: Select a pool randomly.\n- `\"dynamic_latency\"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `\"proximity\"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `\"least_outstanding_requests\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `\"least_connections\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `\"\"`: Will map to `\"geo\"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `\"off\"`.\nAvailable values: \"off\", \"geo\", \"random\", \"dynamic_latency\", \"proximity\", \"least_outstanding_requests\", \"least_connections\", \"\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -94,6 +94,9 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, Optional: true, }, + "zone_name": schema.StringAttribute{ + Computed: true, + }, "country_pools": schema.MapAttribute{ Description: "A mapping of country codes to a list of pool IDs (ordered by their failover priority) for the given country. Any country not explicitly defined will fall back to using the corresponding region_pool mapping if it exists else to default_pools.", Computed: true, @@ -150,14 +153,14 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[LoadBalancerLocationStrategyDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "mode": schema.StringAttribute{ - Description: "Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\n- `\"pop\"`: Use the Cloudflare PoP location.\n- `\"resolver_ip\"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.", + Description: "Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\n- `\"pop\"`: Use the Cloudflare PoP location.\n- `\"resolver_ip\"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.\nAvailable values: \"pop\", \"resolver_ip\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("pop", "resolver_ip"), }, }, "prefer_ecs": schema.StringAttribute{ - Description: "Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `\"always\"`: Always prefer ECS.\n- `\"never\"`: Never prefer ECS.\n- `\"proximity\"`: Prefer ECS only when `steering_policy=\"proximity\"`.\n- `\"geo\"`: Prefer ECS only when `steering_policy=\"geo\"`.", + Description: "Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `\"always\"`: Always prefer ECS.\n- `\"never\"`: Never prefer ECS.\n- `\"proximity\"`: Prefer ECS only when `steering_policy=\"proximity\"`.\n- `\"geo\"`: Prefer ECS only when `steering_policy=\"geo\"`.\nAvailable values: \"always\", \"never\", \"proximity\", \"geo\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -272,14 +275,14 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[LoadBalancerRulesOverridesLocationStrategyDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "mode": schema.StringAttribute{ - Description: "Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\n- `\"pop\"`: Use the Cloudflare PoP location.\n- `\"resolver_ip\"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.", + Description: "Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\n- `\"pop\"`: Use the Cloudflare PoP location.\n- `\"resolver_ip\"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.\nAvailable values: \"pop\", \"resolver_ip\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("pop", "resolver_ip"), }, }, "prefer_ecs": schema.StringAttribute{ - Description: "Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `\"always\"`: Always prefer ECS.\n- `\"never\"`: Never prefer ECS.\n- `\"proximity\"`: Prefer ECS only when `steering_policy=\"proximity\"`.\n- `\"geo\"`: Prefer ECS only when `steering_policy=\"geo\"`.", + Description: "Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `\"always\"`: Always prefer ECS.\n- `\"never\"`: Never prefer ECS.\n- `\"proximity\"`: Prefer ECS only when `steering_policy=\"proximity\"`.\n- `\"geo\"`: Prefer ECS only when `steering_policy=\"geo\"`.\nAvailable values: \"always\", \"never\", \"proximity\", \"geo\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -331,7 +334,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "session_affinity": schema.StringAttribute{ - Description: "Specifies the type of session affinity the load balancer should use unless specified as `\"none\"`. The supported types are:\n- `\"cookie\"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used.\n- `\"ip_cookie\"`: Behaves the same as `\"cookie\"` except the initial origin selection is stable and based on the client's ip address.\n- `\"header\"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.", + Description: "Specifies the type of session affinity the load balancer should use unless specified as `\"none\"`. The supported types are:\n- `\"cookie\"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used.\n- `\"ip_cookie\"`: Behaves the same as `\"cookie\"` except the initial origin selection is stable and based on the client's ip address.\n- `\"header\"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.\nAvailable values: \"none\", \"cookie\", \"ip_cookie\", \"header\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -363,7 +366,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "samesite": schema.StringAttribute{ - Description: "Configures the SameSite attribute on session affinity cookie. Value \"Auto\" will be translated to \"Lax\" or \"None\" depending if Always Use HTTPS is enabled. Note: when using value \"None\", the secure attribute can not be set to \"Never\".", + Description: "Configures the SameSite attribute on session affinity cookie. Value \"Auto\" will be translated to \"Lax\" or \"None\" depending if Always Use HTTPS is enabled. Note: when using value \"None\", the secure attribute can not be set to \"Never\".\nAvailable values: \"Auto\", \"Lax\", \"None\", \"Strict\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -375,7 +378,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "secure": schema.StringAttribute{ - Description: "Configures the Secure attribute on session affinity cookie. Value \"Always\" indicates the Secure attribute will be set in the Set-Cookie header, \"Never\" indicates the Secure attribute will not be set, and \"Auto\" will set the Secure attribute depending if Always Use HTTPS is enabled.", + Description: "Configures the Secure attribute on session affinity cookie. Value \"Always\" indicates the Secure attribute will be set in the Set-Cookie header, \"Never\" indicates the Secure attribute will not be set, and \"Auto\" will set the Secure attribute depending if Always Use HTTPS is enabled.\nAvailable values: \"Auto\", \"Always\", \"Never\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -386,7 +389,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "zero_downtime_failover": schema.StringAttribute{ - Description: "Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are:\n- `\"none\"`: No failover takes place for sessions pinned to the origin (default).\n- `\"temporary\"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping.\n- `\"sticky\"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.", + Description: "Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are:\n- `\"none\"`: No failover takes place for sessions pinned to the origin (default).\n- `\"temporary\"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping.\n- `\"sticky\"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.\nAvailable values: \"none\", \"temporary\", \"sticky\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -404,8 +407,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "steering_policy": schema.StringAttribute{ - Description: "Steering Policy for this load balancer.\n- `\"off\"`: Use `default_pools`.\n- `\"geo\"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `\"random\"`: Select a pool randomly.\n- `\"dynamic_latency\"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `\"proximity\"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `\"least_outstanding_requests\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `\"least_connections\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `\"\"`: Will map to `\"geo\"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `\"off\"`.", Optional: true, + Description: "Steering Policy for this load balancer.\n- `\"off\"`: Use `default_pools`.\n- `\"geo\"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `\"random\"`: Select a pool randomly.\n- `\"dynamic_latency\"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `\"proximity\"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `\"least_outstanding_requests\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `\"least_connections\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `\"\"`: Will map to `\"geo\"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `\"off\"`.\nAvailable values: \"off\", \"geo\", \"random\", \"dynamic_latency\", \"proximity\", \"least_outstanding_requests\", \"least_connections\", \"\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -462,7 +465,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "samesite": schema.StringAttribute{ - Description: "Configures the SameSite attribute on session affinity cookie. Value \"Auto\" will be translated to \"Lax\" or \"None\" depending if Always Use HTTPS is enabled. Note: when using value \"None\", the secure attribute can not be set to \"Never\".", + Description: "Configures the SameSite attribute on session affinity cookie. Value \"Auto\" will be translated to \"Lax\" or \"None\" depending if Always Use HTTPS is enabled. Note: when using value \"None\", the secure attribute can not be set to \"Never\".\nAvailable values: \"Auto\", \"Lax\", \"None\", \"Strict\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -474,7 +477,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "secure": schema.StringAttribute{ - Description: "Configures the Secure attribute on session affinity cookie. Value \"Always\" indicates the Secure attribute will be set in the Set-Cookie header, \"Never\" indicates the Secure attribute will not be set, and \"Auto\" will set the Secure attribute depending if Always Use HTTPS is enabled.", + Description: "Configures the Secure attribute on session affinity cookie. Value \"Always\" indicates the Secure attribute will be set in the Set-Cookie header, \"Never\" indicates the Secure attribute will not be set, and \"Auto\" will set the Secure attribute depending if Always Use HTTPS is enabled.\nAvailable values: \"Auto\", \"Always\", \"Never\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -485,7 +488,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "zero_downtime_failover": schema.StringAttribute{ - Description: "Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are:\n- `\"none\"`: No failover takes place for sessions pinned to the origin (default).\n- `\"temporary\"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping.\n- `\"sticky\"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.", + Description: "Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are:\n- `\"none\"`: No failover takes place for sessions pinned to the origin (default).\n- `\"temporary\"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping.\n- `\"sticky\"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.\nAvailable values: \"none\", \"temporary\", \"sticky\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/load_balancer/list_data_source_model.go b/internal/services/load_balancer/list_data_source_model.go index b5c4505916..c63a352b57 100644 --- a/internal/services/load_balancer/list_data_source_model.go +++ b/internal/services/load_balancer/list_data_source_model.go @@ -50,9 +50,10 @@ type LoadBalancersResultDataSourceModel struct { Rules customfield.NestedObjectList[LoadBalancersRulesDataSourceModel] `tfsdk:"rules" json:"rules,computed"` SessionAffinity types.String `tfsdk:"session_affinity" json:"session_affinity,computed"` SessionAffinityAttributes customfield.NestedObject[LoadBalancersSessionAffinityAttributesDataSourceModel] `tfsdk:"session_affinity_attributes" json:"session_affinity_attributes,computed"` - SessionAffinityTTL types.Float64 `tfsdk:"session_affinity_ttl" json:"session_affinity_ttl,computed_optional"` - SteeringPolicy types.String `tfsdk:"steering_policy" json:"steering_policy,computed_optional"` - TTL types.Float64 `tfsdk:"ttl" json:"ttl,computed_optional"` + SessionAffinityTTL types.Float64 `tfsdk:"session_affinity_ttl" json:"session_affinity_ttl,computed"` + SteeringPolicy types.String `tfsdk:"steering_policy" json:"steering_policy,computed"` + TTL types.Float64 `tfsdk:"ttl" json:"ttl,computed"` + ZoneName types.String `tfsdk:"zone_name" json:"zone_name,computed"` } type LoadBalancersAdaptiveRoutingDataSourceModel struct { diff --git a/internal/services/load_balancer/list_data_source_schema.go b/internal/services/load_balancer/list_data_source_schema.go index 8c37b8896c..e2374c3bd9 100644 --- a/internal/services/load_balancer/list_data_source_schema.go +++ b/internal/services/load_balancer/list_data_source_schema.go @@ -86,14 +86,14 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[LoadBalancersLocationStrategyDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "mode": schema.StringAttribute{ - Description: "Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\n- `\"pop\"`: Use the Cloudflare PoP location.\n- `\"resolver_ip\"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.", + Description: "Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\n- `\"pop\"`: Use the Cloudflare PoP location.\n- `\"resolver_ip\"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.\nAvailable values: \"pop\", \"resolver_ip\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("pop", "resolver_ip"), }, }, "prefer_ecs": schema.StringAttribute{ - Description: "Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `\"always\"`: Always prefer ECS.\n- `\"never\"`: Never prefer ECS.\n- `\"proximity\"`: Prefer ECS only when `steering_policy=\"proximity\"`.\n- `\"geo\"`: Prefer ECS only when `steering_policy=\"geo\"`.", + Description: "Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `\"always\"`: Always prefer ECS.\n- `\"never\"`: Never prefer ECS.\n- `\"proximity\"`: Prefer ECS only when `steering_policy=\"proximity\"`.\n- `\"geo\"`: Prefer ECS only when `steering_policy=\"geo\"`.\nAvailable values: \"always\", \"never\", \"proximity\", \"geo\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -243,14 +243,14 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[LoadBalancersRulesOverridesLocationStrategyDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "mode": schema.StringAttribute{ - Description: "Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\n- `\"pop\"`: Use the Cloudflare PoP location.\n- `\"resolver_ip\"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.", + Description: "Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\n- `\"pop\"`: Use the Cloudflare PoP location.\n- `\"resolver_ip\"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.\nAvailable values: \"pop\", \"resolver_ip\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("pop", "resolver_ip"), }, }, "prefer_ecs": schema.StringAttribute{ - Description: "Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `\"always\"`: Always prefer ECS.\n- `\"never\"`: Never prefer ECS.\n- `\"proximity\"`: Prefer ECS only when `steering_policy=\"proximity\"`.\n- `\"geo\"`: Prefer ECS only when `steering_policy=\"geo\"`.", + Description: "Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `\"always\"`: Always prefer ECS.\n- `\"never\"`: Never prefer ECS.\n- `\"proximity\"`: Prefer ECS only when `steering_policy=\"proximity\"`.\n- `\"geo\"`: Prefer ECS only when `steering_policy=\"geo\"`.\nAvailable values: \"always\", \"never\", \"proximity\", \"geo\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -302,7 +302,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "session_affinity": schema.StringAttribute{ - Description: "Specifies the type of session affinity the load balancer should use unless specified as `\"none\"`. The supported types are:\n- `\"cookie\"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used.\n- `\"ip_cookie\"`: Behaves the same as `\"cookie\"` except the initial origin selection is stable and based on the client's ip address.\n- `\"header\"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.", + Description: "Specifies the type of session affinity the load balancer should use unless specified as `\"none\"`. The supported types are:\n- `\"cookie\"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used.\n- `\"ip_cookie\"`: Behaves the same as `\"cookie\"` except the initial origin selection is stable and based on the client's ip address.\n- `\"header\"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.\nAvailable values: \"none\", \"cookie\", \"ip_cookie\", \"header\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -334,7 +334,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "samesite": schema.StringAttribute{ - Description: "Configures the SameSite attribute on session affinity cookie. Value \"Auto\" will be translated to \"Lax\" or \"None\" depending if Always Use HTTPS is enabled. Note: when using value \"None\", the secure attribute can not be set to \"Never\".", + Description: "Configures the SameSite attribute on session affinity cookie. Value \"Auto\" will be translated to \"Lax\" or \"None\" depending if Always Use HTTPS is enabled. Note: when using value \"None\", the secure attribute can not be set to \"Never\".\nAvailable values: \"Auto\", \"Lax\", \"None\", \"Strict\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -346,7 +346,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "secure": schema.StringAttribute{ - Description: "Configures the Secure attribute on session affinity cookie. Value \"Always\" indicates the Secure attribute will be set in the Set-Cookie header, \"Never\" indicates the Secure attribute will not be set, and \"Auto\" will set the Secure attribute depending if Always Use HTTPS is enabled.", + Description: "Configures the Secure attribute on session affinity cookie. Value \"Always\" indicates the Secure attribute will be set in the Set-Cookie header, \"Never\" indicates the Secure attribute will not be set, and \"Auto\" will set the Secure attribute depending if Always Use HTTPS is enabled.\nAvailable values: \"Auto\", \"Always\", \"Never\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -357,7 +357,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "zero_downtime_failover": schema.StringAttribute{ - Description: "Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are:\n- `\"none\"`: No failover takes place for sessions pinned to the origin (default).\n- `\"temporary\"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping.\n- `\"sticky\"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.", + Description: "Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are:\n- `\"none\"`: No failover takes place for sessions pinned to the origin (default).\n- `\"temporary\"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping.\n- `\"sticky\"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.\nAvailable values: \"none\", \"temporary\", \"sticky\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -375,8 +375,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "steering_policy": schema.StringAttribute{ - Description: "Steering Policy for this load balancer.\n- `\"off\"`: Use `default_pools`.\n- `\"geo\"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `\"random\"`: Select a pool randomly.\n- `\"dynamic_latency\"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `\"proximity\"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `\"least_outstanding_requests\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `\"least_connections\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `\"\"`: Will map to `\"geo\"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `\"off\"`.", Optional: true, + Description: "Steering Policy for this load balancer.\n- `\"off\"`: Use `default_pools`.\n- `\"geo\"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `\"random\"`: Select a pool randomly.\n- `\"dynamic_latency\"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `\"proximity\"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `\"least_outstanding_requests\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `\"least_connections\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `\"\"`: Will map to `\"geo\"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `\"off\"`.\nAvailable values: \"off\", \"geo\", \"random\", \"dynamic_latency\", \"proximity\", \"least_outstanding_requests\", \"least_connections\", \"\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -413,7 +413,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "session_affinity": schema.StringAttribute{ - Description: "Specifies the type of session affinity the load balancer should use unless specified as `\"none\"`. The supported types are:\n- `\"cookie\"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used.\n- `\"ip_cookie\"`: Behaves the same as `\"cookie\"` except the initial origin selection is stable and based on the client's ip address.\n- `\"header\"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.", + Description: "Specifies the type of session affinity the load balancer should use unless specified as `\"none\"`. The supported types are:\n- `\"cookie\"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used.\n- `\"ip_cookie\"`: Behaves the same as `\"cookie\"` except the initial origin selection is stable and based on the client's ip address.\n- `\"header\"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.\nAvailable values: \"none\", \"cookie\", \"ip_cookie\", \"header\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -445,7 +445,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "samesite": schema.StringAttribute{ - Description: "Configures the SameSite attribute on session affinity cookie. Value \"Auto\" will be translated to \"Lax\" or \"None\" depending if Always Use HTTPS is enabled. Note: when using value \"None\", the secure attribute can not be set to \"Never\".", + Description: "Configures the SameSite attribute on session affinity cookie. Value \"Auto\" will be translated to \"Lax\" or \"None\" depending if Always Use HTTPS is enabled. Note: when using value \"None\", the secure attribute can not be set to \"Never\".\nAvailable values: \"Auto\", \"Lax\", \"None\", \"Strict\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -457,7 +457,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "secure": schema.StringAttribute{ - Description: "Configures the Secure attribute on session affinity cookie. Value \"Always\" indicates the Secure attribute will be set in the Set-Cookie header, \"Never\" indicates the Secure attribute will not be set, and \"Auto\" will set the Secure attribute depending if Always Use HTTPS is enabled.", + Description: "Configures the Secure attribute on session affinity cookie. Value \"Always\" indicates the Secure attribute will be set in the Set-Cookie header, \"Never\" indicates the Secure attribute will not be set, and \"Auto\" will set the Secure attribute depending if Always Use HTTPS is enabled.\nAvailable values: \"Auto\", \"Always\", \"Never\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -468,7 +468,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "zero_downtime_failover": schema.StringAttribute{ - Description: "Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are:\n- `\"none\"`: No failover takes place for sessions pinned to the origin (default).\n- `\"temporary\"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping.\n- `\"sticky\"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.", + Description: "Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are:\n- `\"none\"`: No failover takes place for sessions pinned to the origin (default).\n- `\"temporary\"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping.\n- `\"sticky\"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.\nAvailable values: \"none\", \"temporary\", \"sticky\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -486,8 +486,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "steering_policy": schema.StringAttribute{ - Description: "Steering Policy for this load balancer.\n- `\"off\"`: Use `default_pools`.\n- `\"geo\"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `\"random\"`: Select a pool randomly.\n- `\"dynamic_latency\"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `\"proximity\"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `\"least_outstanding_requests\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `\"least_connections\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `\"\"`: Will map to `\"geo\"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `\"off\"`.", Optional: true, + Description: "Steering Policy for this load balancer.\n- `\"off\"`: Use `default_pools`.\n- `\"geo\"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `\"random\"`: Select a pool randomly.\n- `\"dynamic_latency\"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `\"proximity\"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `\"least_outstanding_requests\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `\"least_connections\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `\"\"`: Will map to `\"geo\"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `\"off\"`.\nAvailable values: \"off\", \"geo\", \"random\", \"dynamic_latency\", \"proximity\", \"least_outstanding_requests\", \"least_connections\", \"\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -507,6 +507,9 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, Optional: true, }, + "zone_name": schema.StringAttribute{ + Computed: true, + }, }, }, }, diff --git a/internal/services/load_balancer/model.go b/internal/services/load_balancer/model.go index 6d1f1ea2c2..cb22056ca3 100644 --- a/internal/services/load_balancer/model.go +++ b/internal/services/load_balancer/model.go @@ -36,6 +36,7 @@ type LoadBalancerModel struct { SessionAffinityAttributes customfield.NestedObject[LoadBalancerSessionAffinityAttributesModel] `tfsdk:"session_affinity_attributes" json:"session_affinity_attributes,computed_optional"` CreatedOn types.String `tfsdk:"created_on" json:"created_on,computed"` ModifiedOn types.String `tfsdk:"modified_on" json:"modified_on,computed"` + ZoneName types.String `tfsdk:"zone_name" json:"zone_name,computed"` } func (m LoadBalancerModel) MarshalJSON() (data []byte, err error) { diff --git a/internal/services/load_balancer/schema.go b/internal/services/load_balancer/schema.go index 0c384a11eb..2dc72069b6 100644 --- a/internal/services/load_balancer/schema.go +++ b/internal/services/load_balancer/schema.go @@ -109,7 +109,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: booldefault.StaticBool(false), }, "session_affinity": schema.StringAttribute{ - Description: "Specifies the type of session affinity the load balancer should use unless specified as `\"none\"`. The supported types are:\n- `\"cookie\"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used.\n- `\"ip_cookie\"`: Behaves the same as `\"cookie\"` except the initial origin selection is stable and based on the client's ip address.\n- `\"header\"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.", + Description: "Specifies the type of session affinity the load balancer should use unless specified as `\"none\"`. The supported types are:\n- `\"cookie\"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used.\n- `\"ip_cookie\"`: Behaves the same as `\"cookie\"` except the initial origin selection is stable and based on the client's ip address.\n- `\"header\"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.\nAvailable values: \"none\", \"cookie\", \"ip_cookie\", \"header\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -123,7 +123,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: stringdefault.StaticString("none"), }, "steering_policy": schema.StringAttribute{ - Description: "Steering Policy for this load balancer.\n- `\"off\"`: Use `default_pools`.\n- `\"geo\"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `\"random\"`: Select a pool randomly.\n- `\"dynamic_latency\"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `\"proximity\"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `\"least_outstanding_requests\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `\"least_connections\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `\"\"`: Will map to `\"geo\"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `\"off\"`.", + Description: "Steering Policy for this load balancer.\n- `\"off\"`: Use `default_pools`.\n- `\"geo\"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `\"random\"`: Select a pool randomly.\n- `\"dynamic_latency\"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `\"proximity\"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `\"least_outstanding_requests\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `\"least_connections\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `\"\"`: Will map to `\"geo\"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `\"off\"`.\nAvailable values: \"off\", \"geo\", \"random\", \"dynamic_latency\", \"proximity\", \"least_outstanding_requests\", \"least_connections\", \"\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -161,7 +161,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[LoadBalancerLocationStrategyModel](ctx), Attributes: map[string]schema.Attribute{ "mode": schema.StringAttribute{ - Description: "Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\n- `\"pop\"`: Use the Cloudflare PoP location.\n- `\"resolver_ip\"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.", + Description: "Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\n- `\"pop\"`: Use the Cloudflare PoP location.\n- `\"resolver_ip\"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.\nAvailable values: \"pop\", \"resolver_ip\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -170,7 +170,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: stringdefault.StaticString("pop"), }, "prefer_ecs": schema.StringAttribute{ - Description: "Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `\"always\"`: Always prefer ECS.\n- `\"never\"`: Never prefer ECS.\n- `\"proximity\"`: Prefer ECS only when `steering_policy=\"proximity\"`.\n- `\"geo\"`: Prefer ECS only when `steering_policy=\"geo\"`.", + Description: "Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `\"always\"`: Always prefer ECS.\n- `\"never\"`: Never prefer ECS.\n- `\"proximity\"`: Prefer ECS only when `steering_policy=\"proximity\"`.\n- `\"geo\"`: Prefer ECS only when `steering_policy=\"geo\"`.\nAvailable values: \"always\", \"never\", \"proximity\", \"geo\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -298,7 +298,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[LoadBalancerRulesOverridesLocationStrategyModel](ctx), Attributes: map[string]schema.Attribute{ "mode": schema.StringAttribute{ - Description: "Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\n- `\"pop\"`: Use the Cloudflare PoP location.\n- `\"resolver_ip\"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.", + Description: "Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\n- `\"pop\"`: Use the Cloudflare PoP location.\n- `\"resolver_ip\"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.\nAvailable values: \"pop\", \"resolver_ip\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -307,7 +307,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { // Default: stringdefault.StaticString("pop"), // TODO: clean up schemas to remove this...or fix the service response }, "prefer_ecs": schema.StringAttribute{ - Description: "Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `\"always\"`: Always prefer ECS.\n- `\"never\"`: Never prefer ECS.\n- `\"proximity\"`: Prefer ECS only when `steering_policy=\"proximity\"`.\n- `\"geo\"`: Prefer ECS only when `steering_policy=\"geo\"`.", + Description: "Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `\"always\"`: Always prefer ECS.\n- `\"never\"`: Never prefer ECS.\n- `\"proximity\"`: Prefer ECS only when `steering_policy=\"proximity\"`.\n- `\"geo\"`: Prefer ECS only when `steering_policy=\"geo\"`.\nAvailable values: \"always\", \"never\", \"proximity\", \"geo\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -363,7 +363,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "session_affinity": schema.StringAttribute{ - Description: "Specifies the type of session affinity the load balancer should use unless specified as `\"none\"`. The supported types are:\n- `\"cookie\"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used.\n- `\"ip_cookie\"`: Behaves the same as `\"cookie\"` except the initial origin selection is stable and based on the client's ip address.\n- `\"header\"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.", + Description: "Specifies the type of session affinity the load balancer should use unless specified as `\"none\"`. The supported types are:\n- `\"cookie\"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used.\n- `\"ip_cookie\"`: Behaves the same as `\"cookie\"` except the initial origin selection is stable and based on the client's ip address.\n- `\"header\"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.\nAvailable values: \"none\", \"cookie\", \"ip_cookie\", \"header\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -399,7 +399,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: booldefault.StaticBool(false), }, "samesite": schema.StringAttribute{ - Description: "Configures the SameSite attribute on session affinity cookie. Value \"Auto\" will be translated to \"Lax\" or \"None\" depending if Always Use HTTPS is enabled. Note: when using value \"None\", the secure attribute can not be set to \"Never\".", + Description: "Configures the SameSite attribute on session affinity cookie. Value \"Auto\" will be translated to \"Lax\" or \"None\" depending if Always Use HTTPS is enabled. Note: when using value \"None\", the secure attribute can not be set to \"Never\".\nAvailable values: \"Auto\", \"Lax\", \"None\", \"Strict\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -413,7 +413,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: stringdefault.StaticString("Auto"), }, "secure": schema.StringAttribute{ - Description: "Configures the Secure attribute on session affinity cookie. Value \"Always\" indicates the Secure attribute will be set in the Set-Cookie header, \"Never\" indicates the Secure attribute will not be set, and \"Auto\" will set the Secure attribute depending if Always Use HTTPS is enabled.", + Description: "Configures the Secure attribute on session affinity cookie. Value \"Always\" indicates the Secure attribute will be set in the Set-Cookie header, \"Never\" indicates the Secure attribute will not be set, and \"Auto\" will set the Secure attribute depending if Always Use HTTPS is enabled.\nAvailable values: \"Auto\", \"Always\", \"Never\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -426,7 +426,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: stringdefault.StaticString("Auto"), }, "zero_downtime_failover": schema.StringAttribute{ - Description: "Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are:\n- `\"none\"`: No failover takes place for sessions pinned to the origin (default).\n- `\"temporary\"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping.\n- `\"sticky\"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.", + Description: "Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are:\n- `\"none\"`: No failover takes place for sessions pinned to the origin (default).\n- `\"temporary\"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping.\n- `\"sticky\"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.\nAvailable values: \"none\", \"temporary\", \"sticky\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -446,7 +446,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "steering_policy": schema.StringAttribute{ - Description: "Steering Policy for this load balancer.\n- `\"off\"`: Use `default_pools`.\n- `\"geo\"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `\"random\"`: Select a pool randomly.\n- `\"dynamic_latency\"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `\"proximity\"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `\"least_outstanding_requests\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `\"least_connections\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `\"\"`: Will map to `\"geo\"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `\"off\"`.", + Description: "Steering Policy for this load balancer.\n- `\"off\"`: Use `default_pools`.\n- `\"geo\"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `\"random\"`: Select a pool randomly.\n- `\"dynamic_latency\"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `\"proximity\"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `\"least_outstanding_requests\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `\"least_connections\"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `\"\"`: Will map to `\"geo\"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `\"off\"`.\nAvailable values: \"off\", \"geo\", \"random\", \"dynamic_latency\", \"proximity\", \"least_outstanding_requests\", \"least_connections\", \"\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -511,7 +511,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { // Default: booldefault.StaticBool(false), // TODO: clean up schemas to remove this...or fix the service response }, "samesite": schema.StringAttribute{ - Description: "Configures the SameSite attribute on session affinity cookie. Value \"Auto\" will be translated to \"Lax\" or \"None\" depending if Always Use HTTPS is enabled. Note: when using value \"None\", the secure attribute can not be set to \"Never\".", + Description: "Configures the SameSite attribute on session affinity cookie. Value \"Auto\" will be translated to \"Lax\" or \"None\" depending if Always Use HTTPS is enabled. Note: when using value \"None\", the secure attribute can not be set to \"Never\".\nAvailable values: \"Auto\", \"Lax\", \"None\", \"Strict\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -525,7 +525,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { // Default: stringdefault.StaticString("Auto"), // TODO: clean up schemas to remove this...or fix the service response }, "secure": schema.StringAttribute{ - Description: "Configures the Secure attribute on session affinity cookie. Value \"Always\" indicates the Secure attribute will be set in the Set-Cookie header, \"Never\" indicates the Secure attribute will not be set, and \"Auto\" will set the Secure attribute depending if Always Use HTTPS is enabled.", + Description: "Configures the Secure attribute on session affinity cookie. Value \"Always\" indicates the Secure attribute will be set in the Set-Cookie header, \"Never\" indicates the Secure attribute will not be set, and \"Auto\" will set the Secure attribute depending if Always Use HTTPS is enabled.\nAvailable values: \"Auto\", \"Always\", \"Never\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -538,7 +538,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { // Default: stringdefault.StaticString("Auto"), // TODO: clean up schemas to remove this...or fix the service response }, "zero_downtime_failover": schema.StringAttribute{ - Description: "Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are:\n- `\"none\"`: No failover takes place for sessions pinned to the origin (default).\n- `\"temporary\"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping.\n- `\"sticky\"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.", + Description: "Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are:\n- `\"none\"`: No failover takes place for sessions pinned to the origin (default).\n- `\"temporary\"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping.\n- `\"sticky\"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.\nAvailable values: \"none\", \"temporary\", \"sticky\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -558,6 +558,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { "modified_on": schema.StringAttribute{ Computed: true, }, + "zone_name": schema.StringAttribute{ + Computed: true, + }, }, } } diff --git a/internal/services/load_balancer_monitor/data_source_schema.go b/internal/services/load_balancer_monitor/data_source_schema.go index 2e48a6e0da..05c08b44f2 100644 --- a/internal/services/load_balancer_monitor/data_source_schema.go +++ b/internal/services/load_balancer_monitor/data_source_schema.go @@ -91,7 +91,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.", + Description: "The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.\nAvailable values: \"http\", \"https\", \"tcp\", \"udp_icmp\", \"icmp_ping\", \"smtp\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/load_balancer_monitor/list_data_source_schema.go b/internal/services/load_balancer_monitor/list_data_source_schema.go index da26798a77..c727b659ca 100644 --- a/internal/services/load_balancer_monitor/list_data_source_schema.go +++ b/internal/services/load_balancer_monitor/list_data_source_schema.go @@ -110,7 +110,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.", + Description: "The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.\nAvailable values: \"http\", \"https\", \"tcp\", \"udp_icmp\", \"icmp_ping\", \"smtp\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/load_balancer_monitor/schema.go b/internal/services/load_balancer_monitor/schema.go index e7fa9a5020..80e9bd9bd0 100644 --- a/internal/services/load_balancer_monitor/schema.go +++ b/internal/services/load_balancer_monitor/schema.go @@ -115,7 +115,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: int64default.StaticInt64(5), }, "type": schema.StringAttribute{ - Description: "The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.", + Description: "The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.\nAvailable values: \"http\", \"https\", \"tcp\", \"udp_icmp\", \"icmp_ping\", \"smtp\".", Computed: true, Optional: true, Validators: []validator.String{ diff --git a/internal/services/load_balancer_pool/data_source_schema.go b/internal/services/load_balancer_pool/data_source_schema.go index 1750a8774e..db9b4a31e8 100644 --- a/internal/services/load_balancer_pool/data_source_schema.go +++ b/internal/services/load_balancer_pool/data_source_schema.go @@ -121,7 +121,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "default_policy": schema.StringAttribute{ - Description: "The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.", + Description: "The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.\nAvailable values: \"random\", \"hash\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("random", "hash"), @@ -135,7 +135,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "session_policy": schema.StringAttribute{ - Description: "Only the hash policy is supported for existing sessions (to avoid exponential decay).", + Description: "Only the hash policy is supported for existing sessions (to avoid exponential decay).\nAvailable values: \"hash\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("hash"), @@ -186,7 +186,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[LoadBalancerPoolOriginSteeringDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "policy": schema.StringAttribute{ - Description: "The type of origin steering policy to use.\n- `\"random\"`: Select an origin randomly.\n- `\"hash\"`: Select an origin by computing a hash over the CF-Connecting-IP address.\n- `\"least_outstanding_requests\"`: Select an origin by taking into consideration origin weights, as well as each origin's number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others.\n- `\"least_connections\"`: Select an origin by taking into consideration origin weights, as well as each origin's number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.", + Description: "The type of origin steering policy to use.\n- `\"random\"`: Select an origin randomly.\n- `\"hash\"`: Select an origin by computing a hash over the CF-Connecting-IP address.\n- `\"least_outstanding_requests\"`: Select an origin by taking into consideration origin weights, as well as each origin's number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others.\n- `\"least_connections\"`: Select an origin by taking into consideration origin weights, as well as each origin's number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\nAvailable values: \"random\", \"hash\", \"least_outstanding_requests\", \"least_connections\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/load_balancer_pool/list_data_source_schema.go b/internal/services/load_balancer_pool/list_data_source_schema.go index 588da4388e..d26a8f5cdd 100644 --- a/internal/services/load_balancer_pool/list_data_source_schema.go +++ b/internal/services/load_balancer_pool/list_data_source_schema.go @@ -105,7 +105,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "default_policy": schema.StringAttribute{ - Description: "The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.", + Description: "The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.\nAvailable values: \"random\", \"hash\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("random", "hash"), @@ -119,7 +119,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "session_policy": schema.StringAttribute{ - Description: "Only the hash policy is supported for existing sessions (to avoid exponential decay).", + Description: "Only the hash policy is supported for existing sessions (to avoid exponential decay).\nAvailable values: \"hash\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("hash"), @@ -199,7 +199,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[LoadBalancerPoolsOriginSteeringDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "policy": schema.StringAttribute{ - Description: "The type of origin steering policy to use.\n- `\"random\"`: Select an origin randomly.\n- `\"hash\"`: Select an origin by computing a hash over the CF-Connecting-IP address.\n- `\"least_outstanding_requests\"`: Select an origin by taking into consideration origin weights, as well as each origin's number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others.\n- `\"least_connections\"`: Select an origin by taking into consideration origin weights, as well as each origin's number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.", + Description: "The type of origin steering policy to use.\n- `\"random\"`: Select an origin randomly.\n- `\"hash\"`: Select an origin by computing a hash over the CF-Connecting-IP address.\n- `\"least_outstanding_requests\"`: Select an origin by taking into consideration origin weights, as well as each origin's number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others.\n- `\"least_connections\"`: Select an origin by taking into consideration origin weights, as well as each origin's number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\nAvailable values: \"random\", \"hash\", \"least_outstanding_requests\", \"least_connections\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/load_balancer_pool/schema.go b/internal/services/load_balancer_pool/schema.go index aef7069187..aee408e617 100644 --- a/internal/services/load_balancer_pool/schema.go +++ b/internal/services/load_balancer_pool/schema.go @@ -164,7 +164,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: float64default.StaticFloat64(0), }, "default_policy": schema.StringAttribute{ - Description: "The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.", + Description: "The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.\nAvailable values: \"random\", \"hash\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -182,7 +182,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: float64default.StaticFloat64(0), }, "session_policy": schema.StringAttribute{ - Description: "Only the hash policy is supported for existing sessions (to avoid exponential decay).", + Description: "Only the hash policy is supported for existing sessions (to avoid exponential decay).\nAvailable values: \"hash\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -243,7 +243,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[LoadBalancerPoolOriginSteeringModel](ctx), Attributes: map[string]schema.Attribute{ "policy": schema.StringAttribute{ - Description: "The type of origin steering policy to use.\n- `\"random\"`: Select an origin randomly.\n- `\"hash\"`: Select an origin by computing a hash over the CF-Connecting-IP address.\n- `\"least_outstanding_requests\"`: Select an origin by taking into consideration origin weights, as well as each origin's number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others.\n- `\"least_connections\"`: Select an origin by taking into consideration origin weights, as well as each origin's number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.", + Description: "The type of origin steering policy to use.\n- `\"random\"`: Select an origin randomly.\n- `\"hash\"`: Select an origin by computing a hash over the CF-Connecting-IP address.\n- `\"least_outstanding_requests\"`: Select an origin by taking into consideration origin weights, as well as each origin's number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others.\n- `\"least_connections\"`: Select an origin by taking into consideration origin weights, as well as each origin's number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\nAvailable values: \"random\", \"hash\", \"least_outstanding_requests\", \"least_connections\".", Computed: true, Optional: true, Validators: []validator.String{ diff --git a/internal/services/logpush_dataset_job/data_source_schema.go b/internal/services/logpush_dataset_job/data_source_schema.go index 59752c18d4..553cf0a94f 100644 --- a/internal/services/logpush_dataset_job/data_source_schema.go +++ b/internal/services/logpush_dataset_job/data_source_schema.go @@ -53,7 +53,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "frequency": schema.StringAttribute{ - Description: "This field is deprecated. Please use `max_upload_*` parameters instead. The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.", + Description: "This field is deprecated. Please use `max_upload_*` parameters instead. The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.\nAvailable values: \"high\", \"low\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("high", "low"), @@ -67,7 +67,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "kind": schema.StringAttribute{ - Description: "The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs. Currently, Edge Log Delivery is only supported for the `http_requests` dataset.", + Description: "The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs. Currently, Edge Log Delivery is only supported for the `http_requests` dataset.\nAvailable values: \"edge\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("edge"), @@ -140,7 +140,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "output_type": schema.StringAttribute{ - Description: "Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.", + Description: "Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.\nAvailable values: \"ndjson\", \"csv\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("ndjson", "csv"), @@ -170,7 +170,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "timestamp_format": schema.StringAttribute{ - Description: "String to specify the format for timestamps, such as `unixnano`, `unix`, or `rfc3339`.", + Description: "String to specify the format for timestamps, such as `unixnano`, `unix`, or `rfc3339`.\nAvailable values: \"unixnano\", \"unix\", \"rfc3339\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/logpush_job/data_source_schema.go b/internal/services/logpush_job/data_source_schema.go index cb6c940918..0084cc691c 100644 --- a/internal/services/logpush_job/data_source_schema.go +++ b/internal/services/logpush_job/data_source_schema.go @@ -63,14 +63,14 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "frequency": schema.StringAttribute{ - Description: "This field is deprecated. Please use `max_upload_*` parameters instead. The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.", + Description: "This field is deprecated. Please use `max_upload_*` parameters instead. The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.\nAvailable values: \"high\", \"low\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("high", "low"), }, }, "kind": schema.StringAttribute{ - Description: "The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs. Currently, Edge Log Delivery is only supported for the `http_requests` dataset.", + Description: "The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs. Currently, Edge Log Delivery is only supported for the `http_requests` dataset.\nAvailable values: \"edge\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("edge"), @@ -143,7 +143,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "output_type": schema.StringAttribute{ - Description: "Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.", + Description: "Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.\nAvailable values: \"ndjson\", \"csv\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("ndjson", "csv"), @@ -173,7 +173,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "timestamp_format": schema.StringAttribute{ - Description: "String to specify the format for timestamps, such as `unixnano`, `unix`, or `rfc3339`.", + Description: "String to specify the format for timestamps, such as `unixnano`, `unix`, or `rfc3339`.\nAvailable values: \"unixnano\", \"unix\", \"rfc3339\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/logpush_job/list_data_source_schema.go b/internal/services/logpush_job/list_data_source_schema.go index 11187e33be..7e36819d71 100644 --- a/internal/services/logpush_job/list_data_source_schema.go +++ b/internal/services/logpush_job/list_data_source_schema.go @@ -69,14 +69,14 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "frequency": schema.StringAttribute{ - Description: "This field is deprecated. Please use `max_upload_*` parameters instead. The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.", + Description: "This field is deprecated. Please use `max_upload_*` parameters instead. The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.\nAvailable values: \"high\", \"low\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("high", "low"), }, }, "kind": schema.StringAttribute{ - Description: "The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs. Currently, Edge Log Delivery is only supported for the `http_requests` dataset.", + Description: "The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs. Currently, Edge Log Delivery is only supported for the `http_requests` dataset.\nAvailable values: \"edge\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("edge"), @@ -149,7 +149,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "output_type": schema.StringAttribute{ - Description: "Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.", + Description: "Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.\nAvailable values: \"ndjson\", \"csv\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("ndjson", "csv"), @@ -179,7 +179,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "timestamp_format": schema.StringAttribute{ - Description: "String to specify the format for timestamps, such as `unixnano`, `unix`, or `rfc3339`.", + Description: "String to specify the format for timestamps, such as `unixnano`, `unix`, or `rfc3339`.\nAvailable values: \"unixnano\", \"unix\", \"rfc3339\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/logpush_job/schema.go b/internal/services/logpush_job/schema.go index 0861cbb973..53c05cb6cf 100644 --- a/internal/services/logpush_job/schema.go +++ b/internal/services/logpush_job/schema.go @@ -60,7 +60,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "kind": schema.StringAttribute{ - Description: "The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs. Currently, Edge Log Delivery is only supported for the `http_requests` dataset.", + Description: "The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs. Currently, Edge Log Delivery is only supported for the `http_requests` dataset.\nAvailable values: \"edge\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("edge"), @@ -86,7 +86,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "frequency": schema.StringAttribute{ - Description: "This field is deprecated. Please use `max_upload_*` parameters instead. The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.", + Description: "This field is deprecated. Please use `max_upload_*` parameters instead. The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.\nAvailable values: \"high\", \"low\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -148,7 +148,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "output_type": schema.StringAttribute{ - Description: "Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.", + Description: "Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.\nAvailable values: \"ndjson\", \"csv\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -190,7 +190,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: float64default.StaticFloat64(1), }, "timestamp_format": schema.StringAttribute{ - Description: "String to specify the format for timestamps, such as `unixnano`, `unix`, or `rfc3339`.", + Description: "String to specify the format for timestamps, such as `unixnano`, `unix`, or `rfc3339`.\nAvailable values: \"unixnano\", \"unix\", \"rfc3339\".", Computed: true, Optional: true, Validators: []validator.String{ diff --git a/internal/services/magic_network_monitoring_rule/data_source_model.go b/internal/services/magic_network_monitoring_rule/data_source_model.go index 7fb9b395ad..788009d28f 100644 --- a/internal/services/magic_network_monitoring_rule/data_source_model.go +++ b/internal/services/magic_network_monitoring_rule/data_source_model.go @@ -25,6 +25,10 @@ type MagicNetworkMonitoringRuleDataSourceModel struct { Duration types.String `tfsdk:"duration" json:"duration,computed"` Name types.String `tfsdk:"name" json:"name,computed"` PacketThreshold types.Float64 `tfsdk:"packet_threshold" json:"packet_threshold,computed"` + PrefixMatch types.String `tfsdk:"prefix_match" json:"prefix_match,computed"` + Type types.String `tfsdk:"type" json:"type,computed"` + ZscoreSensitivity types.String `tfsdk:"zscore_sensitivity" json:"zscore_sensitivity,computed"` + ZscoreTarget types.String `tfsdk:"zscore_target" json:"zscore_target,computed"` Prefixes customfield.List[types.String] `tfsdk:"prefixes" json:"prefixes,computed"` } diff --git a/internal/services/magic_network_monitoring_rule/data_source_schema.go b/internal/services/magic_network_monitoring_rule/data_source_schema.go index 82f4e6d6cf..f86019a235 100644 --- a/internal/services/magic_network_monitoring_rule/data_source_schema.go +++ b/internal/services/magic_network_monitoring_rule/data_source_schema.go @@ -7,6 +7,7 @@ import ( "github.com/cloudflare/terraform-provider-cloudflare/internal/customfield" "github.com/hashicorp/terraform-plugin-framework-validators/float64validator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/schema/validator" @@ -41,8 +42,20 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "duration": schema.StringAttribute{ - Description: "The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values [\"1m\",\"5m\",\"10m\",\"15m\",\"20m\",\"30m\",\"45m\",\"60m\"]. The format is AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at least one unit must be provided.", + Description: "The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values [\"1m\",\"5m\",\"10m\",\"15m\",\"20m\",\"30m\",\"45m\",\"60m\"].\nAvailable values: \"1m\", \"5m\", \"10m\", \"15m\", \"20m\", \"30m\", \"45m\", \"60m\".", Computed: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "1m", + "5m", + "10m", + "15m", + "20m", + "30m", + "45m", + "60m", + ), + }, }, "name": schema.StringAttribute{ Description: "The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.", @@ -55,6 +68,46 @@ func DataSourceSchema(ctx context.Context) schema.Schema { float64validator.AtLeast(1), }, }, + "prefix_match": schema.StringAttribute{ + Description: "Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule.\nAvailable values: \"exact\", \"subnet\", \"supernet\".", + Computed: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "exact", + "subnet", + "supernet", + ), + }, + }, + "type": schema.StringAttribute{ + Description: "MNM rule type.\nAvailable values: \"threshold\", \"zscore\", \"advanced_ddos\".", + Computed: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "threshold", + "zscore", + "advanced_ddos", + ), + }, + }, + "zscore_sensitivity": schema.StringAttribute{ + Description: "Level of sensitivity set for zscore rules.\nAvailable values: \"low\", \"medium\", \"high\".", + Computed: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "low", + "medium", + "high", + ), + }, + }, + "zscore_target": schema.StringAttribute{ + Description: "Target of the zscore rule analysis.\nAvailable values: \"bits\", \"packets\".", + Computed: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive("bits", "packets"), + }, + }, "prefixes": schema.ListAttribute{ Computed: true, CustomType: customfield.NewListType[types.String](ctx), diff --git a/internal/services/magic_network_monitoring_rule/list_data_source_model.go b/internal/services/magic_network_monitoring_rule/list_data_source_model.go index da8dfd898c..8b4a647f1a 100644 --- a/internal/services/magic_network_monitoring_rule/list_data_source_model.go +++ b/internal/services/magic_network_monitoring_rule/list_data_source_model.go @@ -32,10 +32,14 @@ func (m *MagicNetworkMonitoringRulesDataSourceModel) toListParams(_ context.Cont type MagicNetworkMonitoringRulesResultDataSourceModel struct { AutomaticAdvertisement types.Bool `tfsdk:"automatic_advertisement" json:"automatic_advertisement,computed"` - Duration types.String `tfsdk:"duration" json:"duration,computed"` Name types.String `tfsdk:"name" json:"name,computed"` Prefixes customfield.List[types.String] `tfsdk:"prefixes" json:"prefixes,computed"` + Type types.String `tfsdk:"type" json:"type,computed"` ID types.String `tfsdk:"id" json:"id,computed"` BandwidthThreshold types.Float64 `tfsdk:"bandwidth_threshold" json:"bandwidth_threshold,computed"` + Duration types.String `tfsdk:"duration" json:"duration,computed"` PacketThreshold types.Float64 `tfsdk:"packet_threshold" json:"packet_threshold,computed"` + PrefixMatch types.String `tfsdk:"prefix_match" json:"prefix_match,computed"` + ZscoreSensitivity types.String `tfsdk:"zscore_sensitivity" json:"zscore_sensitivity,computed"` + ZscoreTarget types.String `tfsdk:"zscore_target" json:"zscore_target,computed"` } diff --git a/internal/services/magic_network_monitoring_rule/list_data_source_schema.go b/internal/services/magic_network_monitoring_rule/list_data_source_schema.go index 8427614577..bf9d83f95b 100644 --- a/internal/services/magic_network_monitoring_rule/list_data_source_schema.go +++ b/internal/services/magic_network_monitoring_rule/list_data_source_schema.go @@ -8,6 +8,7 @@ import ( "github.com/cloudflare/terraform-provider-cloudflare/internal/customfield" "github.com/hashicorp/terraform-plugin-framework-validators/float64validator" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/schema/validator" @@ -39,10 +40,6 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Description: "Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.", Computed: true, }, - "duration": schema.StringAttribute{ - Description: "The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values [\"1m\",\"5m\",\"10m\",\"15m\",\"20m\",\"30m\",\"45m\",\"60m\"]. The format is AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at least one unit must be provided.", - Computed: true, - }, "name": schema.StringAttribute{ Description: "The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.", Computed: true, @@ -52,6 +49,17 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewListType[types.String](ctx), ElementType: types.StringType, }, + "type": schema.StringAttribute{ + Description: "MNM rule type.\nAvailable values: \"threshold\", \"zscore\", \"advanced_ddos\".", + Computed: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "threshold", + "zscore", + "advanced_ddos", + ), + }, + }, "id": schema.StringAttribute{ Description: "The id of the rule. Must be unique.", Computed: true, @@ -63,6 +71,22 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { float64validator.AtLeast(1), }, }, + "duration": schema.StringAttribute{ + Description: "The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values [\"1m\",\"5m\",\"10m\",\"15m\",\"20m\",\"30m\",\"45m\",\"60m\"].\nAvailable values: \"1m\", \"5m\", \"10m\", \"15m\", \"20m\", \"30m\", \"45m\", \"60m\".", + Computed: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "1m", + "5m", + "10m", + "15m", + "20m", + "30m", + "45m", + "60m", + ), + }, + }, "packet_threshold": schema.Float64Attribute{ Description: "The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.", Computed: true, @@ -70,6 +94,35 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { float64validator.AtLeast(1), }, }, + "prefix_match": schema.StringAttribute{ + Description: "Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule.\nAvailable values: \"exact\", \"subnet\", \"supernet\".", + Computed: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "exact", + "subnet", + "supernet", + ), + }, + }, + "zscore_sensitivity": schema.StringAttribute{ + Description: "Level of sensitivity set for zscore rules.\nAvailable values: \"low\", \"medium\", \"high\".", + Computed: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "low", + "medium", + "high", + ), + }, + }, + "zscore_target": schema.StringAttribute{ + Description: "Target of the zscore rule analysis.\nAvailable values: \"bits\", \"packets\".", + Computed: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive("bits", "packets"), + }, + }, }, }, }, diff --git a/internal/services/magic_network_monitoring_rule/model.go b/internal/services/magic_network_monitoring_rule/model.go index 25e81c3140..f27a4f72ae 100644 --- a/internal/services/magic_network_monitoring_rule/model.go +++ b/internal/services/magic_network_monitoring_rule/model.go @@ -21,6 +21,10 @@ type MagicNetworkMonitoringRuleModel struct { Prefixes *[]types.String `tfsdk:"prefixes" json:"prefixes,optional"` Duration types.String `tfsdk:"duration" json:"duration,computed_optional"` BandwidthThreshold types.Float64 `tfsdk:"bandwidth_threshold" json:"bandwidth_threshold,computed"` + PrefixMatch types.String `tfsdk:"prefix_match" json:"prefix_match,computed"` + Type types.String `tfsdk:"type" json:"type,computed"` + ZscoreSensitivity types.String `tfsdk:"zscore_sensitivity" json:"zscore_sensitivity,computed"` + ZscoreTarget types.String `tfsdk:"zscore_target" json:"zscore_target,computed"` } func (m MagicNetworkMonitoringRuleModel) MarshalJSON() (data []byte, err error) { diff --git a/internal/services/magic_network_monitoring_rule/schema.go b/internal/services/magic_network_monitoring_rule/schema.go index 7e31d6154d..f4dd3622c2 100644 --- a/internal/services/magic_network_monitoring_rule/schema.go +++ b/internal/services/magic_network_monitoring_rule/schema.go @@ -6,6 +6,7 @@ import ( "context" "github.com/hashicorp/terraform-plugin-framework-validators/float64validator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" @@ -56,10 +57,22 @@ func ResourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "duration": schema.StringAttribute{ - Description: "The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values [\"1m\",\"5m\",\"10m\",\"15m\",\"20m\",\"30m\",\"45m\",\"60m\"]. The format is AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at least one unit must be provided.", + Description: "The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values [\"1m\",\"5m\",\"10m\",\"15m\",\"20m\",\"30m\",\"45m\",\"60m\"].\nAvailable values: \"1m\", \"5m\", \"10m\", \"15m\", \"20m\", \"30m\", \"45m\", \"60m\".", Computed: true, Optional: true, - Default: stringdefault.StaticString("1m"), + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "1m", + "5m", + "10m", + "15m", + "20m", + "30m", + "45m", + "60m", + ), + }, + Default: stringdefault.StaticString("1m"), }, "bandwidth_threshold": schema.Float64Attribute{ Description: "The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.", @@ -68,6 +81,46 @@ func ResourceSchema(ctx context.Context) schema.Schema { float64validator.AtLeast(1), }, }, + "prefix_match": schema.StringAttribute{ + Description: "Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule.\nAvailable values: \"exact\", \"subnet\", \"supernet\".", + Computed: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "exact", + "subnet", + "supernet", + ), + }, + }, + "type": schema.StringAttribute{ + Description: "MNM rule type.\nAvailable values: \"threshold\", \"zscore\", \"advanced_ddos\".", + Computed: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "threshold", + "zscore", + "advanced_ddos", + ), + }, + }, + "zscore_sensitivity": schema.StringAttribute{ + Description: "Level of sensitivity set for zscore rules.\nAvailable values: \"low\", \"medium\", \"high\".", + Computed: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "low", + "medium", + "high", + ), + }, + }, + "zscore_target": schema.StringAttribute{ + Description: "Target of the zscore rule analysis.\nAvailable values: \"bits\", \"packets\".", + Computed: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive("bits", "packets"), + }, + }, }, } } diff --git a/internal/services/magic_transit_site_lan/data_source_model.go b/internal/services/magic_transit_site_lan/data_source_model.go index 3459f5d4e0..acab1cac97 100644 --- a/internal/services/magic_transit_site_lan/data_source_model.go +++ b/internal/services/magic_transit_site_lan/data_source_model.go @@ -20,7 +20,7 @@ type MagicTransitSiteLANDataSourceModel struct { ID types.String `tfsdk:"id" json:"-,computed"` LANID types.String `tfsdk:"lan_id" path:"lan_id,optional"` AccountID types.String `tfsdk:"account_id" path:"account_id,required"` - SiteID types.String `tfsdk:"site_id" path:"site_id,computed"` + SiteID types.String `tfsdk:"site_id" path:"site_id,required"` HaLink types.Bool `tfsdk:"ha_link" json:"ha_link,computed"` Name types.String `tfsdk:"name" json:"name,computed"` Physport types.Int64 `tfsdk:"physport" json:"physport,computed"` diff --git a/internal/services/magic_transit_site_lan/data_source_schema.go b/internal/services/magic_transit_site_lan/data_source_schema.go index 920bd09188..ee7b998b3c 100644 --- a/internal/services/magic_transit_site_lan/data_source_schema.go +++ b/internal/services/magic_transit_site_lan/data_source_schema.go @@ -30,7 +30,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, "site_id": schema.StringAttribute{ Description: "Identifier", - Computed: true, + Required: true, }, "ha_link": schema.BoolAttribute{ Description: "mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link.", diff --git a/internal/services/magic_transit_site_wan/data_source_model.go b/internal/services/magic_transit_site_wan/data_source_model.go index 3ea0e3c605..1e50db8750 100644 --- a/internal/services/magic_transit_site_wan/data_source_model.go +++ b/internal/services/magic_transit_site_wan/data_source_model.go @@ -20,7 +20,7 @@ type MagicTransitSiteWANDataSourceModel struct { ID types.String `tfsdk:"id" json:"-,computed"` WANID types.String `tfsdk:"wan_id" path:"wan_id,optional"` AccountID types.String `tfsdk:"account_id" path:"account_id,required"` - SiteID types.String `tfsdk:"site_id" path:"site_id,computed"` + SiteID types.String `tfsdk:"site_id" path:"site_id,required"` HealthCheckRate types.String `tfsdk:"health_check_rate" json:"health_check_rate,computed"` Name types.String `tfsdk:"name" json:"name,computed"` Physport types.Int64 `tfsdk:"physport" json:"physport,computed"` diff --git a/internal/services/magic_transit_site_wan/data_source_schema.go b/internal/services/magic_transit_site_wan/data_source_schema.go index 69c4745869..5ff3da83dd 100644 --- a/internal/services/magic_transit_site_wan/data_source_schema.go +++ b/internal/services/magic_transit_site_wan/data_source_schema.go @@ -31,10 +31,10 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, "site_id": schema.StringAttribute{ Description: "Identifier", - Computed: true, + Required: true, }, "health_check_rate": schema.StringAttribute{ - Description: "Magic WAN health check rate for tunnels created on this link. The default value is `mid`.", + Description: "Magic WAN health check rate for tunnels created on this link. The default value is `mid`.\nAvailable values: \"low\", \"mid\", \"high\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/magic_transit_site_wan/list_data_source_schema.go b/internal/services/magic_transit_site_wan/list_data_source_schema.go index a1bc386af4..7c0a8b0008 100644 --- a/internal/services/magic_transit_site_wan/list_data_source_schema.go +++ b/internal/services/magic_transit_site_wan/list_data_source_schema.go @@ -44,7 +44,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "health_check_rate": schema.StringAttribute{ - Description: "Magic WAN health check rate for tunnels created on this link. The default value is `mid`.", + Description: "Magic WAN health check rate for tunnels created on this link. The default value is `mid`.\nAvailable values: \"low\", \"mid\", \"high\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/magic_transit_site_wan/schema.go b/internal/services/magic_transit_site_wan/schema.go index 698e670165..38378256b8 100644 --- a/internal/services/magic_transit_site_wan/schema.go +++ b/internal/services/magic_transit_site_wan/schema.go @@ -69,7 +69,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "health_check_rate": schema.StringAttribute{ - Description: "Magic WAN health check rate for tunnels created on this link. The default value is `mid`.", + Description: "Magic WAN health check rate for tunnels created on this link. The default value is `mid`.\nAvailable values: \"low\", \"mid\", \"high\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/magic_wan_gre_tunnel/data_source_schema.go b/internal/services/magic_wan_gre_tunnel/data_source_schema.go index 8068e1ac46..1df256b801 100644 --- a/internal/services/magic_wan_gre_tunnel/data_source_schema.go +++ b/internal/services/magic_wan_gre_tunnel/data_source_schema.go @@ -64,7 +64,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[MagicWANGRETunnelGRETunnelHealthCheckDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.", + Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.\nAvailable values: \"unidirectional\", \"bidirectional\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("unidirectional", "bidirectional"), @@ -75,7 +75,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "rate": schema.StringAttribute{ - Description: "How frequent the health check is run. The default value is `mid`.", + Description: "How frequent the health check is run. The default value is `mid`.\nAvailable values: \"low\", \"mid\", \"high\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -101,7 +101,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "The type of healthcheck to run, reply or request. The default value is `reply`.", + Description: "The type of healthcheck to run, reply or request. The default value is `reply`.\nAvailable values: \"reply\", \"request\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("reply", "request"), diff --git a/internal/services/magic_wan_gre_tunnel/schema.go b/internal/services/magic_wan_gre_tunnel/schema.go index e79c809064..bc128ffd1c 100644 --- a/internal/services/magic_wan_gre_tunnel/schema.go +++ b/internal/services/magic_wan_gre_tunnel/schema.go @@ -71,7 +71,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[MagicWANGRETunnelHealthCheckModel](ctx), Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.", + Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.\nAvailable values: \"unidirectional\", \"bidirectional\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -86,7 +86,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: booldefault.StaticBool(true), }, "rate": schema.StringAttribute{ - Description: "How frequent the health check is run. The default value is `mid`.", + Description: "How frequent the health check is run. The default value is `mid`.\nAvailable values: \"low\", \"mid\", \"high\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -115,7 +115,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "The type of healthcheck to run, reply or request. The default value is `reply`.", + Description: "The type of healthcheck to run, reply or request. The default value is `reply`.\nAvailable values: \"reply\", \"request\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -166,7 +166,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[MagicWANGRETunnelGRETunnelHealthCheckModel](ctx), Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.", + Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.\nAvailable values: \"unidirectional\", \"bidirectional\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("unidirectional", "bidirectional"), @@ -179,7 +179,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: booldefault.StaticBool(true), }, "rate": schema.StringAttribute{ - Description: "How frequent the health check is run. The default value is `mid`.", + Description: "How frequent the health check is run. The default value is `mid`.\nAvailable values: \"low\", \"mid\", \"high\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -206,7 +206,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "The type of healthcheck to run, reply or request. The default value is `reply`.", + Description: "The type of healthcheck to run, reply or request. The default value is `reply`.\nAvailable values: \"reply\", \"request\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("reply", "request"), @@ -271,7 +271,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[MagicWANGRETunnelGRETunnelsHealthCheckModel](ctx), Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.", + Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.\nAvailable values: \"unidirectional\", \"bidirectional\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("unidirectional", "bidirectional"), @@ -284,7 +284,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: booldefault.StaticBool(true), }, "rate": schema.StringAttribute{ - Description: "How frequent the health check is run. The default value is `mid`.", + Description: "How frequent the health check is run. The default value is `mid`.\nAvailable values: \"low\", \"mid\", \"high\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -311,7 +311,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "The type of healthcheck to run, reply or request. The default value is `reply`.", + Description: "The type of healthcheck to run, reply or request. The default value is `reply`.\nAvailable values: \"reply\", \"request\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("reply", "request"), @@ -376,7 +376,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[MagicWANGRETunnelModifiedGRETunnelHealthCheckModel](ctx), Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.", + Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.\nAvailable values: \"unidirectional\", \"bidirectional\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("unidirectional", "bidirectional"), @@ -389,7 +389,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: booldefault.StaticBool(true), }, "rate": schema.StringAttribute{ - Description: "How frequent the health check is run. The default value is `mid`.", + Description: "How frequent the health check is run. The default value is `mid`.\nAvailable values: \"low\", \"mid\", \"high\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -416,7 +416,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "The type of healthcheck to run, reply or request. The default value is `reply`.", + Description: "The type of healthcheck to run, reply or request. The default value is `reply`.\nAvailable values: \"reply\", \"request\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("reply", "request"), diff --git a/internal/services/magic_wan_ipsec_tunnel/data_source_schema.go b/internal/services/magic_wan_ipsec_tunnel/data_source_schema.go index 75e26cddfe..6731df69e4 100644 --- a/internal/services/magic_wan_ipsec_tunnel/data_source_schema.go +++ b/internal/services/magic_wan_ipsec_tunnel/data_source_schema.go @@ -68,7 +68,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[MagicWANIPSECTunnelIPSECTunnelHealthCheckDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.", + Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.\nAvailable values: \"unidirectional\", \"bidirectional\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("unidirectional", "bidirectional"), @@ -79,7 +79,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "rate": schema.StringAttribute{ - Description: "How frequent the health check is run. The default value is `mid`.", + Description: "How frequent the health check is run. The default value is `mid`.\nAvailable values: \"low\", \"mid\", \"high\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -105,7 +105,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "The type of healthcheck to run, reply or request. The default value is `reply`.", + Description: "The type of healthcheck to run, reply or request. The default value is `reply`.\nAvailable values: \"reply\", \"request\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("reply", "request"), diff --git a/internal/services/magic_wan_ipsec_tunnel/schema.go b/internal/services/magic_wan_ipsec_tunnel/schema.go index 311cd3b7c3..993ef3379f 100644 --- a/internal/services/magic_wan_ipsec_tunnel/schema.go +++ b/internal/services/magic_wan_ipsec_tunnel/schema.go @@ -68,7 +68,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[MagicWANIPSECTunnelHealthCheckModel](ctx), Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.", + Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.\nAvailable values: \"unidirectional\", \"bidirectional\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -83,7 +83,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: booldefault.StaticBool(true), }, "rate": schema.StringAttribute{ - Description: "How frequent the health check is run. The default value is `mid`.", + Description: "How frequent the health check is run. The default value is `mid`.\nAvailable values: \"low\", \"mid\", \"high\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -112,7 +112,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "The type of healthcheck to run, reply or request. The default value is `reply`.", + Description: "The type of healthcheck to run, reply or request. The default value is `reply`.\nAvailable values: \"reply\", \"request\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -167,7 +167,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[MagicWANIPSECTunnelIPSECTunnelHealthCheckModel](ctx), Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.", + Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.\nAvailable values: \"unidirectional\", \"bidirectional\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("unidirectional", "bidirectional"), @@ -180,7 +180,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: booldefault.StaticBool(true), }, "rate": schema.StringAttribute{ - Description: "How frequent the health check is run. The default value is `mid`.", + Description: "How frequent the health check is run. The default value is `mid`.\nAvailable values: \"low\", \"mid\", \"high\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -207,7 +207,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "The type of healthcheck to run, reply or request. The default value is `reply`.", + Description: "The type of healthcheck to run, reply or request. The default value is `reply`.\nAvailable values: \"reply\", \"request\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("reply", "request"), @@ -283,7 +283,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[MagicWANIPSECTunnelIPSECTunnelsHealthCheckModel](ctx), Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.", + Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.\nAvailable values: \"unidirectional\", \"bidirectional\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("unidirectional", "bidirectional"), @@ -296,7 +296,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: booldefault.StaticBool(true), }, "rate": schema.StringAttribute{ - Description: "How frequent the health check is run. The default value is `mid`.", + Description: "How frequent the health check is run. The default value is `mid`.\nAvailable values: \"low\", \"mid\", \"high\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -323,7 +323,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "The type of healthcheck to run, reply or request. The default value is `reply`.", + Description: "The type of healthcheck to run, reply or request. The default value is `reply`.\nAvailable values: \"reply\", \"request\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("reply", "request"), @@ -399,7 +399,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[MagicWANIPSECTunnelModifiedIPSECTunnelHealthCheckModel](ctx), Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.", + Description: "The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.\nAvailable values: \"unidirectional\", \"bidirectional\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("unidirectional", "bidirectional"), @@ -412,7 +412,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: booldefault.StaticBool(true), }, "rate": schema.StringAttribute{ - Description: "How frequent the health check is run. The default value is `mid`.", + Description: "How frequent the health check is run. The default value is `mid`.\nAvailable values: \"low\", \"mid\", \"high\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -439,7 +439,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "The type of healthcheck to run, reply or request. The default value is `reply`.", + Description: "The type of healthcheck to run, reply or request. The default value is `reply`.\nAvailable values: \"reply\", \"request\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("reply", "request"), diff --git a/internal/services/notification_policy/data_source_schema.go b/internal/services/notification_policy/data_source_schema.go index bb4b5cc041..e69ee9652d 100644 --- a/internal/services/notification_policy/data_source_schema.go +++ b/internal/services/notification_policy/data_source_schema.go @@ -37,7 +37,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "alert_type": schema.StringAttribute{ - Description: "Refers to which event will trigger a Notification dispatch. You can use the endpoint to get available alert types which then will give you a list of possible values.", + Description: "Refers to which event will trigger a Notification dispatch. You can use the endpoint to get available alert types which then will give you a list of possible values.\nAvailable values: \"access_custom_certificate_expiration_type\", \"advanced_ddos_attack_l4_alert\", \"advanced_ddos_attack_l7_alert\", \"advanced_http_alert_error\", \"bgp_hijack_notification\", \"billing_usage_alert\", \"block_notification_block_removed\", \"block_notification_new_block\", \"block_notification_review_rejected\", \"brand_protection_alert\", \"brand_protection_digest\", \"clickhouse_alert_fw_anomaly\", \"clickhouse_alert_fw_ent_anomaly\", \"cloudforce_one_request_notification\", \"custom_analytics\", \"custom_ssl_certificate_event_type\", \"dedicated_ssl_certificate_event_type\", \"device_connectivity_anomaly_alert\", \"dos_attack_l4\", \"dos_attack_l7\", \"expiring_service_token_alert\", \"failing_logpush_job_disabled_alert\", \"fbm_auto_advertisement\", \"fbm_dosd_attack\", \"fbm_volumetric_attack\", \"health_check_status_notification\", \"hostname_aop_custom_certificate_expiration_type\", \"http_alert_edge_error\", \"http_alert_origin_error\", \"image_notification\", \"image_resizing_notification\", \"incident_alert\", \"load_balancing_health_alert\", \"load_balancing_pool_enablement_alert\", \"logo_match_alert\", \"magic_tunnel_health_check_event\", \"magic_wan_tunnel_health\", \"maintenance_event_notification\", \"mtls_certificate_store_certificate_expiration_type\", \"pages_event_alert\", \"radar_notification\", \"real_origin_monitoring\", \"scriptmonitor_alert_new_code_change_detections\", \"scriptmonitor_alert_new_hosts\", \"scriptmonitor_alert_new_malicious_hosts\", \"scriptmonitor_alert_new_malicious_scripts\", \"scriptmonitor_alert_new_malicious_url\", \"scriptmonitor_alert_new_max_length_resource_url\", \"scriptmonitor_alert_new_resources\", \"secondary_dns_all_primaries_failing\", \"secondary_dns_primaries_failing\", \"secondary_dns_warning\", \"secondary_dns_zone_successfully_updated\", \"secondary_dns_zone_validation_warning\", \"security_insights_alert\", \"sentinel_alert\", \"stream_live_notifications\", \"synthetic_test_latency_alert\", \"synthetic_test_low_availability_alert\", \"traffic_anomalies_alert\", \"tunnel_health_event\", \"tunnel_update_event\", \"universal_ssl_event_type\", \"web_analytics_metrics_update\", \"zone_aop_custom_certificate_expiration_type\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/notification_policy/list_data_source_schema.go b/internal/services/notification_policy/list_data_source_schema.go index 9bd5686438..965aecc029 100644 --- a/internal/services/notification_policy/list_data_source_schema.go +++ b/internal/services/notification_policy/list_data_source_schema.go @@ -47,7 +47,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "alert_type": schema.StringAttribute{ - Description: "Refers to which event will trigger a Notification dispatch. You can use the endpoint to get available alert types which then will give you a list of possible values.", + Description: "Refers to which event will trigger a Notification dispatch. You can use the endpoint to get available alert types which then will give you a list of possible values.\nAvailable values: \"access_custom_certificate_expiration_type\", \"advanced_ddos_attack_l4_alert\", \"advanced_ddos_attack_l7_alert\", \"advanced_http_alert_error\", \"bgp_hijack_notification\", \"billing_usage_alert\", \"block_notification_block_removed\", \"block_notification_new_block\", \"block_notification_review_rejected\", \"brand_protection_alert\", \"brand_protection_digest\", \"clickhouse_alert_fw_anomaly\", \"clickhouse_alert_fw_ent_anomaly\", \"cloudforce_one_request_notification\", \"custom_analytics\", \"custom_ssl_certificate_event_type\", \"dedicated_ssl_certificate_event_type\", \"device_connectivity_anomaly_alert\", \"dos_attack_l4\", \"dos_attack_l7\", \"expiring_service_token_alert\", \"failing_logpush_job_disabled_alert\", \"fbm_auto_advertisement\", \"fbm_dosd_attack\", \"fbm_volumetric_attack\", \"health_check_status_notification\", \"hostname_aop_custom_certificate_expiration_type\", \"http_alert_edge_error\", \"http_alert_origin_error\", \"image_notification\", \"image_resizing_notification\", \"incident_alert\", \"load_balancing_health_alert\", \"load_balancing_pool_enablement_alert\", \"logo_match_alert\", \"magic_tunnel_health_check_event\", \"magic_wan_tunnel_health\", \"maintenance_event_notification\", \"mtls_certificate_store_certificate_expiration_type\", \"pages_event_alert\", \"radar_notification\", \"real_origin_monitoring\", \"scriptmonitor_alert_new_code_change_detections\", \"scriptmonitor_alert_new_hosts\", \"scriptmonitor_alert_new_malicious_hosts\", \"scriptmonitor_alert_new_malicious_scripts\", \"scriptmonitor_alert_new_malicious_url\", \"scriptmonitor_alert_new_max_length_resource_url\", \"scriptmonitor_alert_new_resources\", \"secondary_dns_all_primaries_failing\", \"secondary_dns_primaries_failing\", \"secondary_dns_warning\", \"secondary_dns_zone_successfully_updated\", \"secondary_dns_zone_validation_warning\", \"security_insights_alert\", \"sentinel_alert\", \"stream_live_notifications\", \"synthetic_test_latency_alert\", \"synthetic_test_low_availability_alert\", \"traffic_anomalies_alert\", \"tunnel_health_event\", \"tunnel_update_event\", \"universal_ssl_event_type\", \"web_analytics_metrics_update\", \"zone_aop_custom_certificate_expiration_type\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/notification_policy/schema.go b/internal/services/notification_policy/schema.go index 20fdc31b3a..ee61a89168 100644 --- a/internal/services/notification_policy/schema.go +++ b/internal/services/notification_policy/schema.go @@ -34,7 +34,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "alert_type": schema.StringAttribute{ - Description: "Refers to which event will trigger a Notification dispatch. You can use the endpoint to get available alert types which then will give you a list of possible values.", + Description: "Refers to which event will trigger a Notification dispatch. You can use the endpoint to get available alert types which then will give you a list of possible values.\nAvailable values: \"access_custom_certificate_expiration_type\", \"advanced_ddos_attack_l4_alert\", \"advanced_ddos_attack_l7_alert\", \"advanced_http_alert_error\", \"bgp_hijack_notification\", \"billing_usage_alert\", \"block_notification_block_removed\", \"block_notification_new_block\", \"block_notification_review_rejected\", \"brand_protection_alert\", \"brand_protection_digest\", \"clickhouse_alert_fw_anomaly\", \"clickhouse_alert_fw_ent_anomaly\", \"cloudforce_one_request_notification\", \"custom_analytics\", \"custom_ssl_certificate_event_type\", \"dedicated_ssl_certificate_event_type\", \"device_connectivity_anomaly_alert\", \"dos_attack_l4\", \"dos_attack_l7\", \"expiring_service_token_alert\", \"failing_logpush_job_disabled_alert\", \"fbm_auto_advertisement\", \"fbm_dosd_attack\", \"fbm_volumetric_attack\", \"health_check_status_notification\", \"hostname_aop_custom_certificate_expiration_type\", \"http_alert_edge_error\", \"http_alert_origin_error\", \"image_notification\", \"image_resizing_notification\", \"incident_alert\", \"load_balancing_health_alert\", \"load_balancing_pool_enablement_alert\", \"logo_match_alert\", \"magic_tunnel_health_check_event\", \"magic_wan_tunnel_health\", \"maintenance_event_notification\", \"mtls_certificate_store_certificate_expiration_type\", \"pages_event_alert\", \"radar_notification\", \"real_origin_monitoring\", \"scriptmonitor_alert_new_code_change_detections\", \"scriptmonitor_alert_new_hosts\", \"scriptmonitor_alert_new_malicious_hosts\", \"scriptmonitor_alert_new_malicious_scripts\", \"scriptmonitor_alert_new_malicious_url\", \"scriptmonitor_alert_new_max_length_resource_url\", \"scriptmonitor_alert_new_resources\", \"secondary_dns_all_primaries_failing\", \"secondary_dns_primaries_failing\", \"secondary_dns_warning\", \"secondary_dns_zone_successfully_updated\", \"secondary_dns_zone_validation_warning\", \"security_insights_alert\", \"sentinel_alert\", \"stream_live_notifications\", \"synthetic_test_latency_alert\", \"synthetic_test_low_availability_alert\", \"traffic_anomalies_alert\", \"tunnel_health_event\", \"tunnel_update_event\", \"universal_ssl_event_type\", \"web_analytics_metrics_update\", \"zone_aop_custom_certificate_expiration_type\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/notification_policy_webhooks/data_source_schema.go b/internal/services/notification_policy_webhooks/data_source_schema.go index e671610910..11a444c53c 100644 --- a/internal/services/notification_policy_webhooks/data_source_schema.go +++ b/internal/services/notification_policy_webhooks/data_source_schema.go @@ -53,7 +53,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "Type of webhook endpoint.", + Description: "Type of webhook endpoint.\nAvailable values: \"slack\", \"generic\", \"gchat\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/notification_policy_webhooks/list_data_source_schema.go b/internal/services/notification_policy_webhooks/list_data_source_schema.go index 096b0407a1..1fb2afac1f 100644 --- a/internal/services/notification_policy_webhooks/list_data_source_schema.go +++ b/internal/services/notification_policy_webhooks/list_data_source_schema.go @@ -64,7 +64,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "Type of webhook endpoint.", + Description: "Type of webhook endpoint.\nAvailable values: \"slack\", \"generic\", \"gchat\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/notification_policy_webhooks/schema.go b/internal/services/notification_policy_webhooks/schema.go index 5ee03a89f7..d5e0fde4ca 100644 --- a/internal/services/notification_policy_webhooks/schema.go +++ b/internal/services/notification_policy_webhooks/schema.go @@ -57,7 +57,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "type": schema.StringAttribute{ - Description: "Type of webhook endpoint.", + Description: "Type of webhook endpoint.\nAvailable values: \"slack\", \"generic\", \"gchat\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/observatory_scheduled_test/data_source_model.go b/internal/services/observatory_scheduled_test/data_source_model.go index d6004edc3a..64b56211f3 100644 --- a/internal/services/observatory_scheduled_test/data_source_model.go +++ b/internal/services/observatory_scheduled_test/data_source_model.go @@ -16,9 +16,9 @@ type ObservatoryScheduledTestResultDataSourceEnvelope struct { } type ObservatoryScheduledTestDataSourceModel struct { + URL types.String `tfsdk:"url" path:"url,required"` ZoneID types.String `tfsdk:"zone_id" path:"zone_id,required"` - URL types.String `tfsdk:"url" path:"url,computed"` - Region types.String `tfsdk:"region" query:"region,computed"` + Region types.String `tfsdk:"region" query:"region,computed_optional"` Frequency types.String `tfsdk:"frequency" json:"frequency,computed"` } @@ -27,5 +27,9 @@ func (m *ObservatoryScheduledTestDataSourceModel) toReadParams(_ context.Context ZoneID: cloudflare.F(m.ZoneID.ValueString()), } + if !m.Region.IsNull() { + params.Region = cloudflare.F(speed.ScheduleGetParamsRegion(m.Region.ValueString())) + } + return } diff --git a/internal/services/observatory_scheduled_test/data_source_schema.go b/internal/services/observatory_scheduled_test/data_source_schema.go index 9021680443..c1f1daf1ed 100644 --- a/internal/services/observatory_scheduled_test/data_source_schema.go +++ b/internal/services/observatory_scheduled_test/data_source_schema.go @@ -16,17 +16,18 @@ var _ datasource.DataSourceWithConfigValidators = (*ObservatoryScheduledTestData func DataSourceSchema(ctx context.Context) schema.Schema { return schema.Schema{ Attributes: map[string]schema.Attribute{ + "url": schema.StringAttribute{ + Description: "A URL.", + Required: true, + }, "zone_id": schema.StringAttribute{ Description: "Identifier", Required: true, }, - "url": schema.StringAttribute{ - Description: "A URL.", - Computed: true, - }, "region": schema.StringAttribute{ - Description: "A test region.", + Description: "A test region.\nAvailable values: \"asia-east1\", \"asia-northeast1\", \"asia-northeast2\", \"asia-south1\", \"asia-southeast1\", \"australia-southeast1\", \"europe-north1\", \"europe-southwest1\", \"europe-west1\", \"europe-west2\", \"europe-west3\", \"europe-west4\", \"europe-west8\", \"europe-west9\", \"me-west1\", \"southamerica-east1\", \"us-central1\", \"us-east1\", \"us-east4\", \"us-south1\", \"us-west1\".", Computed: true, + Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "asia-east1", @@ -54,7 +55,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "frequency": schema.StringAttribute{ - Description: "The frequency of the test.", + Description: "The frequency of the test.\nAvailable values: \"DAILY\", \"WEEKLY\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("DAILY", "WEEKLY"), diff --git a/internal/services/observatory_scheduled_test/schema.go b/internal/services/observatory_scheduled_test/schema.go index a2370133cd..20085ddd9e 100644 --- a/internal/services/observatory_scheduled_test/schema.go +++ b/internal/services/observatory_scheduled_test/schema.go @@ -36,14 +36,14 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "frequency": schema.StringAttribute{ - Description: "The frequency of the test.", + Description: "The frequency of the test.\nAvailable values: \"DAILY\", \"WEEKLY\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("DAILY", "WEEKLY"), }, }, "region": schema.StringAttribute{ - Description: "A test region.", + Description: "A test region.\nAvailable values: \"asia-east1\", \"asia-northeast1\", \"asia-northeast2\", \"asia-south1\", \"asia-southeast1\", \"australia-southeast1\", \"europe-north1\", \"europe-southwest1\", \"europe-west1\", \"europe-west2\", \"europe-west3\", \"europe-west4\", \"europe-west8\", \"europe-west9\", \"me-west1\", \"southamerica-east1\", \"us-central1\", \"us-east1\", \"us-east4\", \"us-south1\", \"us-west1\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -77,14 +77,14 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ObservatoryScheduledTestScheduleModel](ctx), Attributes: map[string]schema.Attribute{ "frequency": schema.StringAttribute{ - Description: "The frequency of the test.", + Description: "The frequency of the test.\nAvailable values: \"DAILY\", \"WEEKLY\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("DAILY", "WEEKLY"), }, }, "region": schema.StringAttribute{ - Description: "A test region.", + Description: "A test region.\nAvailable values: \"asia-east1\", \"asia-northeast1\", \"asia-northeast2\", \"asia-south1\", \"asia-southeast1\", \"australia-southeast1\", \"europe-north1\", \"europe-southwest1\", \"europe-west1\", \"europe-west2\", \"europe-west3\", \"europe-west4\", \"europe-west8\", \"europe-west9\", \"me-west1\", \"southamerica-east1\", \"us-central1\", \"us-east1\", \"us-east4\", \"us-south1\", \"us-west1\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -140,7 +140,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "device_type": schema.StringAttribute{ - Description: "The type of device.", + Description: "The type of device.\nAvailable values: \"DESKTOP\", \"MOBILE\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("DESKTOP", "MOBILE"), @@ -151,7 +151,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ObservatoryScheduledTestTestDesktopReportErrorModel](ctx), Attributes: map[string]schema.Attribute{ "code": schema.StringAttribute{ - Description: "The error code of the Lighthouse result.", + Description: "The error code of the Lighthouse result.\nAvailable values: \"NOT_REACHABLE\", \"DNS_FAILURE\", \"NOT_HTML\", \"LIGHTHOUSE_TIMEOUT\", \"UNKNOWN\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -194,7 +194,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "state": schema.StringAttribute{ - Description: "The state of the Lighthouse report.", + Description: "The state of the Lighthouse report.\nAvailable values: \"RUNNING\", \"COMPLETE\", \"FAILED\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -228,7 +228,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "device_type": schema.StringAttribute{ - Description: "The type of device.", + Description: "The type of device.\nAvailable values: \"DESKTOP\", \"MOBILE\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("DESKTOP", "MOBILE"), @@ -239,7 +239,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ObservatoryScheduledTestTestMobileReportErrorModel](ctx), Attributes: map[string]schema.Attribute{ "code": schema.StringAttribute{ - Description: "The error code of the Lighthouse result.", + Description: "The error code of the Lighthouse result.\nAvailable values: \"NOT_REACHABLE\", \"DNS_FAILURE\", \"NOT_HTML\", \"LIGHTHOUSE_TIMEOUT\", \"UNKNOWN\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -282,7 +282,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "state": schema.StringAttribute{ - Description: "The state of the Lighthouse report.", + Description: "The state of the Lighthouse report.\nAvailable values: \"RUNNING\", \"COMPLETE\", \"FAILED\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -315,7 +315,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "value": schema.StringAttribute{ - Description: "A test region.", + Description: "A test region.\nAvailable values: \"asia-east1\", \"asia-northeast1\", \"asia-northeast2\", \"asia-south1\", \"asia-southeast1\", \"australia-southeast1\", \"europe-north1\", \"europe-southwest1\", \"europe-west1\", \"europe-west2\", \"europe-west3\", \"europe-west4\", \"europe-west8\", \"europe-west9\", \"me-west1\", \"southamerica-east1\", \"us-central1\", \"us-east1\", \"us-east4\", \"us-south1\", \"us-west1\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -346,7 +346,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "schedule_frequency": schema.StringAttribute{ - Description: "The frequency of the test.", + Description: "The frequency of the test.\nAvailable values: \"DAILY\", \"WEEKLY\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("DAILY", "WEEKLY"), diff --git a/internal/services/origin_ca_certificate/data_source_schema.go b/internal/services/origin_ca_certificate/data_source_schema.go index 0c0cd17e22..8f2c202f51 100644 --- a/internal/services/origin_ca_certificate/data_source_schema.go +++ b/internal/services/origin_ca_certificate/data_source_schema.go @@ -42,7 +42,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "request_type": schema.StringAttribute{ - Description: "Signature type desired on certificate (\"origin-rsa\" (rsa), \"origin-ecc\" (ecdsa), or \"keyless-certificate\" (for Keyless SSL servers).", + Description: "Signature type desired on certificate (\"origin-rsa\" (rsa), \"origin-ecc\" (ecdsa), or \"keyless-certificate\" (for Keyless SSL servers).\nAvailable values: \"origin-rsa\", \"origin-ecc\", \"keyless-certificate\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -53,7 +53,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "requested_validity": schema.Float64Attribute{ - Description: "The number of days for which the certificate should be valid.", + Description: "The number of days for which the certificate should be valid.\nAvailable values: 7, 30, 90, 365, 730, 1095, 5475.", Computed: true, Validators: []validator.Float64{ float64validator.OneOf( diff --git a/internal/services/origin_ca_certificate/list_data_source_schema.go b/internal/services/origin_ca_certificate/list_data_source_schema.go index 2a40d1aa88..3d64ecfac2 100644 --- a/internal/services/origin_ca_certificate/list_data_source_schema.go +++ b/internal/services/origin_ca_certificate/list_data_source_schema.go @@ -48,7 +48,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "request_type": schema.StringAttribute{ - Description: "Signature type desired on certificate (\"origin-rsa\" (rsa), \"origin-ecc\" (ecdsa), or \"keyless-certificate\" (for Keyless SSL servers).", + Description: "Signature type desired on certificate (\"origin-rsa\" (rsa), \"origin-ecc\" (ecdsa), or \"keyless-certificate\" (for Keyless SSL servers).\nAvailable values: \"origin-rsa\", \"origin-ecc\", \"keyless-certificate\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -59,7 +59,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "requested_validity": schema.Float64Attribute{ - Description: "The number of days for which the certificate should be valid.", + Description: "The number of days for which the certificate should be valid.\nAvailable values: 7, 30, 90, 365, 730, 1095, 5475.", Computed: true, Validators: []validator.Float64{ float64validator.OneOf( diff --git a/internal/services/origin_ca_certificate/schema.go b/internal/services/origin_ca_certificate/schema.go index 847e3cc98f..cc01114885 100644 --- a/internal/services/origin_ca_certificate/schema.go +++ b/internal/services/origin_ca_certificate/schema.go @@ -34,7 +34,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "request_type": schema.StringAttribute{ - Description: "Signature type desired on certificate (\"origin-rsa\" (rsa), \"origin-ecc\" (ecdsa), or \"keyless-certificate\" (for Keyless SSL servers).", + Description: "Signature type desired on certificate (\"origin-rsa\" (rsa), \"origin-ecc\" (ecdsa), or \"keyless-certificate\" (for Keyless SSL servers).\nAvailable values: \"origin-rsa\", \"origin-ecc\", \"keyless-certificate\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -52,7 +52,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.List{listplanmodifier.RequiresReplace()}, }, "requested_validity": schema.Float64Attribute{ - Description: "The number of days for which the certificate should be valid.", + Description: "The number of days for which the certificate should be valid.\nAvailable values: 7, 30, 90, 365, 730, 1095, 5475.", Computed: true, Optional: true, Validators: []validator.Float64{ diff --git a/internal/services/page_rule/data_source_schema.go b/internal/services/page_rule/data_source_schema.go index e6ffb90141..c8c6bd0982 100644 --- a/internal/services/page_rule/data_source_schema.go +++ b/internal/services/page_rule/data_source_schema.go @@ -40,11 +40,11 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "priority": schema.Int64Attribute{ - Description: "The priority of the rule, used to define which Page Rule is processed\nover another. A higher number indicates a higher priority. For example,\nif you have a catch-all Page Rule (rule A: `/images/*`) but want a more\nspecific Page Rule to take precedence (rule B: `/images/special/*`),\nspecify a higher priority for rule B so it overrides rule A.\n", + Description: "The priority of the rule, used to define which Page Rule is processed\nover another. A higher number indicates a higher priority. For example,\nif you have a catch-all Page Rule (rule A: `/images/*`) but want a more\nspecific Page Rule to take precedence (rule B: `/images/special/*`),\nspecify a higher priority for rule B so it overrides rule A.", Computed: true, }, "status": schema.StringAttribute{ - Description: "The status of the Page Rule.", + Description: "The status of the Page Rule.\nAvailable values: \"active\", \"disabled\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("active", "disabled"), diff --git a/internal/services/page_rule/schema.go b/internal/services/page_rule/schema.go index 9f01b6aa15..3c16a5c79f 100644 --- a/internal/services/page_rule/schema.go +++ b/internal/services/page_rule/schema.go @@ -37,13 +37,13 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "priority": schema.Int64Attribute{ - Description: "The priority of the rule, used to define which Page Rule is processed\nover another. A higher number indicates a higher priority. For example,\nif you have a catch-all Page Rule (rule A: `/images/*`) but want a more\nspecific Page Rule to take precedence (rule B: `/images/special/*`),\nspecify a higher priority for rule B so it overrides rule A.\n", + Description: "The priority of the rule, used to define which Page Rule is processed\nover another. A higher number indicates a higher priority. For example,\nif you have a catch-all Page Rule (rule A: `/images/*`) but want a more\nspecific Page Rule to take precedence (rule B: `/images/special/*`),\nspecify a higher priority for rule B so it overrides rule A.", Computed: true, Optional: true, Default: int64default.StaticInt64(1), }, "status": schema.StringAttribute{ - Description: "The status of the Page Rule.", + Description: "The status of the Page Rule.\nAvailable values: \"active\", \"disabled\".", Computed: true, Optional: true, Validators: []validator.String{ diff --git a/internal/services/page_shield_connections/list_data_source_schema.go b/internal/services/page_shield_connections/list_data_source_schema.go index 8f55291783..a3c8d68061 100644 --- a/internal/services/page_shield_connections/list_data_source_schema.go +++ b/internal/services/page_shield_connections/list_data_source_schema.go @@ -26,7 +26,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "direction": schema.StringAttribute{ - Description: "The direction used to sort returned connections.", + Description: "The direction used to sort returned connections.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), @@ -37,33 +37,33 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "exclude_urls": schema.StringAttribute{ - Description: "Excludes connections whose URL contains one of the URL-encoded URLs separated by commas.\n", + Description: "Excludes connections whose URL contains one of the URL-encoded URLs separated by commas.", Optional: true, }, "export": schema.StringAttribute{ - Description: "Export the list of connections as a file.", + Description: "Export the list of connections as a file.\nAvailable values: \"csv\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("csv"), }, }, "hosts": schema.StringAttribute{ - Description: "Includes connections that match one or more URL-encoded hostnames separated by commas.\n\nWildcards are supported at the start and end of each hostname to support starts with, ends with\nand contains. If no wildcards are used, results will be filtered by exact match\n", + Description: "Includes connections that match one or more URL-encoded hostnames separated by commas.\n\nWildcards are supported at the start and end of each hostname to support starts with, ends with\nand contains. If no wildcards are used, results will be filtered by exact match", Optional: true, }, "order_by": schema.StringAttribute{ - Description: "The field used to sort returned connections.", + Description: "The field used to sort returned connections.\nAvailable values: \"first_seen_at\", \"last_seen_at\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("first_seen_at", "last_seen_at"), }, }, "page": schema.StringAttribute{ - Description: "The current page number of the paginated results.\n\nWe additionally support a special value \"all\". When \"all\" is used, the API will return all the connections\nwith the applied filters in a single page. This feature is best-effort and it may only work for zones with\na low number of connections\n", + Description: "The current page number of the paginated results.\n\nWe additionally support a special value \"all\". When \"all\" is used, the API will return all the connections\nwith the applied filters in a single page. This feature is best-effort and it may only work for zones with\na low number of connections", Optional: true, }, "page_url": schema.StringAttribute{ - Description: "Includes connections that match one or more page URLs (separated by commas) where they were last seen\n\nWildcards are supported at the start and end of each page URL to support starts with, ends with\nand contains. If no wildcards are used, results will be filtered by exact match\n", + Description: "Includes connections that match one or more page URLs (separated by commas) where they were last seen\n\nWildcards are supported at the start and end of each page URL to support starts with, ends with\nand contains. If no wildcards are used, results will be filtered by exact match", Optional: true, }, "per_page": schema.Float64Attribute{ @@ -82,7 +82,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "urls": schema.StringAttribute{ - Description: "Includes connections whose URL contain one or more URL-encoded URLs separated by commas.\n", + Description: "Includes connections whose URL contain one or more URL-encoded URLs separated by commas.", Optional: true, }, "max_items": schema.Int64Attribute{ diff --git a/internal/services/page_shield_cookies/data_source_schema.go b/internal/services/page_shield_cookies/data_source_schema.go index 6ebfd4664d..0b278ed907 100644 --- a/internal/services/page_shield_cookies/data_source_schema.go +++ b/internal/services/page_shield_cookies/data_source_schema.go @@ -62,7 +62,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "same_site_attribute": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"lax\", \"strict\", \"none\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "lax", @@ -75,7 +76,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"first_party\", \"unknown\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("first_party", "unknown"), }, diff --git a/internal/services/page_shield_cookies/list_data_source_schema.go b/internal/services/page_shield_cookies/list_data_source_schema.go index c9bbcdafde..96a315284e 100644 --- a/internal/services/page_shield_cookies/list_data_source_schema.go +++ b/internal/services/page_shield_cookies/list_data_source_schema.go @@ -26,7 +26,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "direction": schema.StringAttribute{ - Description: "The direction used to sort returned cookies.'", + Description: "The direction used to sort returned cookies.'\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), @@ -37,14 +37,14 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "export": schema.StringAttribute{ - Description: "Export the list of cookies as a file.", + Description: "Export the list of cookies as a file.\nAvailable values: \"csv\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("csv"), }, }, "hosts": schema.StringAttribute{ - Description: "Includes cookies that match one or more URL-encoded hostnames separated by commas.\n\nWildcards are supported at the start and end of each hostname to support starts with, ends with\nand contains. If no wildcards are used, results will be filtered by exact match\n", + Description: "Includes cookies that match one or more URL-encoded hostnames separated by commas.\n\nWildcards are supported at the start and end of each hostname to support starts with, ends with\nand contains. If no wildcards are used, results will be filtered by exact match", Optional: true, }, "http_only": schema.BoolAttribute{ @@ -52,22 +52,22 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "name": schema.StringAttribute{ - Description: "Filters the returned cookies that match the specified name.\nWildcards are supported at the start and end to support starts with, ends with\nand contains. e.g. session*\n", + Description: "Filters the returned cookies that match the specified name.\nWildcards are supported at the start and end to support starts with, ends with\nand contains. e.g. session*", Optional: true, }, "order_by": schema.StringAttribute{ - Description: "The field used to sort returned cookies.", + Description: "The field used to sort returned cookies.\nAvailable values: \"first_seen_at\", \"last_seen_at\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("first_seen_at", "last_seen_at"), }, }, "page": schema.StringAttribute{ - Description: "The current page number of the paginated results.\n\nWe additionally support a special value \"all\". When \"all\" is used, the API will return all the cookies\nwith the applied filters in a single page. This feature is best-effort and it may only work for zones with \na low number of cookies\n", + Description: "The current page number of the paginated results.\n\nWe additionally support a special value \"all\". When \"all\" is used, the API will return all the cookies\nwith the applied filters in a single page. This feature is best-effort and it may only work for zones with \na low number of cookies", Optional: true, }, "page_url": schema.StringAttribute{ - Description: "Includes connections that match one or more page URLs (separated by commas) where they were last seen\n\nWildcards are supported at the start and end of each page URL to support starts with, ends with\nand contains. If no wildcards are used, results will be filtered by exact match\n", + Description: "Includes connections that match one or more page URLs (separated by commas) where they were last seen\n\nWildcards are supported at the start and end of each page URL to support starts with, ends with\nand contains. If no wildcards are used, results will be filtered by exact match", Optional: true, }, "path": schema.StringAttribute{ @@ -82,7 +82,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "same_site": schema.StringAttribute{ - Description: "Filters the returned cookies that match the specified same_site attribute", + Description: "Filters the returned cookies that match the specified same_site attribute\nAvailable values: \"lax\", \"strict\", \"none\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -97,7 +97,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "type": schema.StringAttribute{ - Description: "Filters the returned cookies that match the specified type attribute", + Description: "Filters the returned cookies that match the specified type attribute\nAvailable values: \"first_party\", \"unknown\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("first_party", "unknown"), @@ -135,7 +135,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"first_party\", \"unknown\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("first_party", "unknown"), }, @@ -162,7 +163,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "same_site_attribute": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"lax\", \"strict\", \"none\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "lax", diff --git a/internal/services/page_shield_policy/data_source_schema.go b/internal/services/page_shield_policy/data_source_schema.go index 0d929ba449..b949f68d5c 100644 --- a/internal/services/page_shield_policy/data_source_schema.go +++ b/internal/services/page_shield_policy/data_source_schema.go @@ -29,7 +29,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "action": schema.StringAttribute{ - Description: "The action to take if the expression matches", + Description: "The action to take if the expression matches\nAvailable values: \"allow\", \"log\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("allow", "log"), diff --git a/internal/services/page_shield_policy/list_data_source_schema.go b/internal/services/page_shield_policy/list_data_source_schema.go index f97d1d8adc..4abddbe53f 100644 --- a/internal/services/page_shield_policy/list_data_source_schema.go +++ b/internal/services/page_shield_policy/list_data_source_schema.go @@ -40,7 +40,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "action": schema.StringAttribute{ - Description: "The action to take if the expression matches", + Description: "The action to take if the expression matches\nAvailable values: \"allow\", \"log\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("allow", "log"), diff --git a/internal/services/page_shield_policy/schema.go b/internal/services/page_shield_policy/schema.go index eb5342abe6..5aa30130cf 100644 --- a/internal/services/page_shield_policy/schema.go +++ b/internal/services/page_shield_policy/schema.go @@ -29,7 +29,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "action": schema.StringAttribute{ - Description: "The action to take if the expression matches", + Description: "The action to take if the expression matches\nAvailable values: \"allow\", \"log\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("allow", "log"), diff --git a/internal/services/page_shield_scripts/list_data_source_schema.go b/internal/services/page_shield_scripts/list_data_source_schema.go index a5cb0b31ba..a7dda36874 100644 --- a/internal/services/page_shield_scripts/list_data_source_schema.go +++ b/internal/services/page_shield_scripts/list_data_source_schema.go @@ -26,40 +26,40 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "direction": schema.StringAttribute{ - Description: "The direction used to sort returned scripts.", + Description: "The direction used to sort returned scripts.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), }, }, "exclude_urls": schema.StringAttribute{ - Description: "Excludes scripts whose URL contains one of the URL-encoded URLs separated by commas.\n", + Description: "Excludes scripts whose URL contains one of the URL-encoded URLs separated by commas.", Optional: true, }, "export": schema.StringAttribute{ - Description: "Export the list of scripts as a file.", + Description: "Export the list of scripts as a file.\nAvailable values: \"csv\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("csv"), }, }, "hosts": schema.StringAttribute{ - Description: "Includes scripts that match one or more URL-encoded hostnames separated by commas.\n\nWildcards are supported at the start and end of each hostname to support starts with, ends with\nand contains. If no wildcards are used, results will be filtered by exact match\n", + Description: "Includes scripts that match one or more URL-encoded hostnames separated by commas.\n\nWildcards are supported at the start and end of each hostname to support starts with, ends with\nand contains. If no wildcards are used, results will be filtered by exact match", Optional: true, }, "order_by": schema.StringAttribute{ - Description: "The field used to sort returned scripts.", + Description: "The field used to sort returned scripts.\nAvailable values: \"first_seen_at\", \"last_seen_at\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("first_seen_at", "last_seen_at"), }, }, "page": schema.StringAttribute{ - Description: "The current page number of the paginated results.\n\nWe additionally support a special value \"all\". When \"all\" is used, the API will return all the scripts\nwith the applied filters in a single page. This feature is best-effort and it may only work for zones with \na low number of scripts\n", + Description: "The current page number of the paginated results.\n\nWe additionally support a special value \"all\". When \"all\" is used, the API will return all the scripts\nwith the applied filters in a single page. This feature is best-effort and it may only work for zones with \na low number of scripts", Optional: true, }, "page_url": schema.StringAttribute{ - Description: "Includes scripts that match one or more page URLs (separated by commas) where they were last seen\n\nWildcards are supported at the start and end of each page URL to support starts with, ends with\nand contains. If no wildcards are used, results will be filtered by exact match\n", + Description: "Includes scripts that match one or more page URLs (separated by commas) where they were last seen\n\nWildcards are supported at the start and end of each page URL to support starts with, ends with\nand contains. If no wildcards are used, results will be filtered by exact match", Optional: true, }, "per_page": schema.Float64Attribute{ @@ -78,7 +78,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "urls": schema.StringAttribute{ - Description: "Includes scripts whose URL contain one or more URL-encoded URLs separated by commas.\n", + Description: "Includes scripts whose URL contain one or more URL-encoded URLs separated by commas.", Optional: true, }, "exclude_cdn_cgi": schema.BoolAttribute{ @@ -87,7 +87,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "exclude_duplicates": schema.BoolAttribute{ - Description: "When true, excludes duplicate scripts. We consider a script duplicate of another if their javascript\ncontent matches and they share the same url host and zone hostname. In such case, we return the most\nrecent script for the URL host and zone hostname combination.\n", + Description: "When true, excludes duplicate scripts. We consider a script duplicate of another if their javascript\ncontent matches and they share the same url host and zone hostname. In such case, we return the most\nrecent script for the URL host and zone hostname combination.", Computed: true, Optional: true, }, diff --git a/internal/services/pages_domain/data_source_schema.go b/internal/services/pages_domain/data_source_schema.go index 9ca6e03fa3..4ab1b15326 100644 --- a/internal/services/pages_domain/data_source_schema.go +++ b/internal/services/pages_domain/data_source_schema.go @@ -34,7 +34,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "certificate_authority": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"google\", \"lets_encrypt\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("google", "lets_encrypt"), }, @@ -49,7 +50,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"initializing\", \"pending\", \"active\", \"deactivated\", \"blocked\", \"error\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "initializing", @@ -72,13 +74,15 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "method": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"http\", \"txt\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("http", "txt"), }, }, "status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"initializing\", \"pending\", \"active\", \"deactivated\", \"error\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "initializing", @@ -105,7 +109,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"pending\", \"active\", \"deactivated\", \"blocked\", \"error\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "pending", diff --git a/internal/services/pages_domain/list_data_source_schema.go b/internal/services/pages_domain/list_data_source_schema.go index 6bcab4c1e5..517bd60e6c 100644 --- a/internal/services/pages_domain/list_data_source_schema.go +++ b/internal/services/pages_domain/list_data_source_schema.go @@ -43,7 +43,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "certificate_authority": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"google\", \"lets_encrypt\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("google", "lets_encrypt"), }, @@ -58,7 +59,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"initializing\", \"pending\", \"active\", \"deactivated\", \"blocked\", \"error\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "initializing", @@ -78,13 +80,15 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "method": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"http\", \"txt\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("http", "txt"), }, }, "status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"initializing\", \"pending\", \"active\", \"deactivated\", \"error\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "initializing", @@ -111,7 +115,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"pending\", \"active\", \"deactivated\", \"blocked\", \"error\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "pending", diff --git a/internal/services/pages_domain/schema.go b/internal/services/pages_domain/schema.go index 2fdf7bde43..5d3973bbef 100644 --- a/internal/services/pages_domain/schema.go +++ b/internal/services/pages_domain/schema.go @@ -38,7 +38,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "certificate_authority": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"google\", \"lets_encrypt\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("google", "lets_encrypt"), }, @@ -50,7 +51,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"initializing\", \"pending\", \"active\", \"deactivated\", \"blocked\", \"error\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "initializing", @@ -73,13 +75,15 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "method": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"http\", \"txt\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("http", "txt"), }, }, "status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"initializing\", \"pending\", \"active\", \"deactivated\", \"error\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "initializing", @@ -106,7 +110,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"pending\", \"active\", \"deactivated\", \"blocked\", \"error\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "pending", diff --git a/internal/services/pages_project/data_source_schema.go b/internal/services/pages_project/data_source_schema.go index 8151e01366..2bf41f1004 100644 --- a/internal/services/pages_project/data_source_schema.go +++ b/internal/services/pages_project/data_source_schema.go @@ -271,7 +271,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "preview_deployment_setting": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"all\", \"none\", \"custom\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "all", @@ -419,7 +420,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The type of environment variable.", + Description: "The type of environment variable.\nAvailable values: \"plain_text\", \"secret_text\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("plain_text", "secret_text"), @@ -626,7 +627,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The type of environment variable.", + Description: "The type of environment variable.\nAvailable values: \"plain_text\", \"secret_text\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("plain_text", "secret_text"), @@ -936,7 +937,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "preview_deployment_setting": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"all\", \"none\", \"custom\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "all", @@ -1032,7 +1034,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "preview_deployment_setting": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"all\", \"none\", \"custom\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "all", diff --git a/internal/services/pages_project/list_data_source_schema.go b/internal/services/pages_project/list_data_source_schema.go index caf46d141f..d5450e437e 100644 --- a/internal/services/pages_project/list_data_source_schema.go +++ b/internal/services/pages_project/list_data_source_schema.go @@ -218,7 +218,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "preview_deployment_setting": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"all\", \"none\", \"custom\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "all", diff --git a/internal/services/pages_project/schema.go b/internal/services/pages_project/schema.go index e1f3800358..d571330838 100644 --- a/internal/services/pages_project/schema.go +++ b/internal/services/pages_project/schema.go @@ -167,7 +167,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "type": schema.StringAttribute{ - Description: "The type of environment variable.", + Description: "The type of environment variable.\nAvailable values: \"plain_text\", \"secret_text\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("plain_text", "secret_text"), @@ -386,7 +386,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "type": schema.StringAttribute{ - Description: "The type of environment variable.", + Description: "The type of environment variable.\nAvailable values: \"plain_text\", \"secret_text\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("plain_text", "secret_text"), @@ -719,7 +719,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "preview_deployment_setting": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"all\", \"none\", \"custom\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "all", @@ -963,7 +964,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "preview_deployment_setting": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"all\", \"none\", \"custom\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "all", @@ -1059,7 +1061,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "preview_deployment_setting": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"all\", \"none\", \"custom\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "all", diff --git a/internal/services/queue/data_source_schema.go b/internal/services/queue/data_source_schema.go index d5175cdab3..19567f86d9 100644 --- a/internal/services/queue/data_source_schema.go +++ b/internal/services/queue/data_source_schema.go @@ -100,7 +100,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"worker\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("worker", "http_pull"), }, @@ -117,7 +118,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"worker\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("worker", "r2_bucket"), }, diff --git a/internal/services/queue/list_data_source_schema.go b/internal/services/queue/list_data_source_schema.go index 2c671e5b40..7890d7f4d2 100644 --- a/internal/services/queue/list_data_source_schema.go +++ b/internal/services/queue/list_data_source_schema.go @@ -90,7 +90,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"worker\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("worker", "http_pull"), }, @@ -116,7 +117,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"worker\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("worker", "r2_bucket"), }, diff --git a/internal/services/queue/schema.go b/internal/services/queue/schema.go index c96f49caae..03710fc396 100644 --- a/internal/services/queue/schema.go +++ b/internal/services/queue/schema.go @@ -116,7 +116,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"worker\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("worker", "http_pull"), }, @@ -133,7 +134,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"worker\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("worker", "r2_bucket"), }, diff --git a/internal/services/queue_consumer/data_source_model.go b/internal/services/queue_consumer/data_source_model.go index 6ada68c19c..3a56a6ab7f 100644 --- a/internal/services/queue_consumer/data_source_model.go +++ b/internal/services/queue_consumer/data_source_model.go @@ -18,7 +18,7 @@ type QueueConsumerResultDataSourceEnvelope struct { type QueueConsumerDataSourceModel struct { AccountID types.String `tfsdk:"account_id" path:"account_id,required"` - QueueID types.String `tfsdk:"queue_id" path:"queue_id,computed"` + QueueID types.String `tfsdk:"queue_id" path:"queue_id,required"` ConsumerID types.String `tfsdk:"consumer_id" json:"consumer_id,computed"` CreatedOn types.String `tfsdk:"created_on" json:"created_on,computed"` Script types.String `tfsdk:"script" json:"script,computed"` diff --git a/internal/services/queue_consumer/data_source_schema.go b/internal/services/queue_consumer/data_source_schema.go index d5656504eb..2db6139cec 100644 --- a/internal/services/queue_consumer/data_source_schema.go +++ b/internal/services/queue_consumer/data_source_schema.go @@ -23,7 +23,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, "queue_id": schema.StringAttribute{ Description: "A Resource identifier.", - Computed: true, + Required: true, }, "consumer_id": schema.StringAttribute{ Description: "A Resource identifier.", @@ -41,7 +41,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"worker\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("worker", "http_pull"), }, diff --git a/internal/services/queue_consumer/schema.go b/internal/services/queue_consumer/schema.go index 7be34d97c1..befbfc3db9 100644 --- a/internal/services/queue_consumer/schema.go +++ b/internal/services/queue_consumer/schema.go @@ -42,7 +42,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "type": schema.StringAttribute{ - Optional: true, + Description: "Available values: \"worker\".", + Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("worker", "http_pull"), }, diff --git a/internal/services/r2_bucket/data_source_schema.go b/internal/services/r2_bucket/data_source_schema.go index 4192058201..7f8ba36ddc 100644 --- a/internal/services/r2_bucket/data_source_schema.go +++ b/internal/services/r2_bucket/data_source_schema.go @@ -29,7 +29,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "location": schema.StringAttribute{ - Description: "Location of the bucket", + Description: "Location of the bucket\nAvailable values: \"apac\", \"eeur\", \"enam\", \"weur\", \"wnam\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -46,7 +46,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "storage_class": schema.StringAttribute{ - Description: "Storage class for newly uploaded objects, unless specified otherwise.", + Description: "Storage class for newly uploaded objects, unless specified otherwise.\nAvailable values: \"Standard\", \"InfrequentAccess\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("Standard", "InfrequentAccess"), diff --git a/internal/services/r2_bucket/resource.go b/internal/services/r2_bucket/resource.go index dc2b2c0ff9..6339159564 100644 --- a/internal/services/r2_bucket/resource.go +++ b/internal/services/r2_bucket/resource.go @@ -12,6 +12,7 @@ import ( "github.com/cloudflare/cloudflare-go/v4/option" "github.com/cloudflare/cloudflare-go/v4/r2" "github.com/cloudflare/terraform-provider-cloudflare/internal/apijson" + "github.com/cloudflare/terraform-provider-cloudflare/internal/consts" "github.com/cloudflare/terraform-provider-cloudflare/internal/importpath" "github.com/cloudflare/terraform-provider-cloudflare/internal/logging" "github.com/hashicorp/terraform-plugin-framework/resource" @@ -23,8 +24,6 @@ var _ resource.ResourceWithConfigure = (*R2BucketResource)(nil) var _ resource.ResourceWithModifyPlan = (*R2BucketResource)(nil) var _ resource.ResourceWithImportState = (*R2BucketResource)(nil) -const jurisdictionHTTPHeaderName = "cf-r2-jurisdiction" - func NewResource() resource.Resource { return &R2BucketResource{} } @@ -78,7 +77,7 @@ func (r *R2BucketResource) Create(ctx context.Context, req resource.CreateReques r2.BucketNewParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, - option.WithHeader(jurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithRequestBody("application/json", dataBytes), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), @@ -128,7 +127,7 @@ func (r *R2BucketResource) Update(ctx context.Context, req resource.UpdateReques r2.BucketNewParams{ AccountID: cloudflare.F(data.Name.ValueString()), }, - option.WithHeader(jurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithRequestBody("application/json", dataBytes), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), @@ -166,7 +165,7 @@ func (r *R2BucketResource) Read(ctx context.Context, req resource.ReadRequest, r r2.BucketGetParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, - option.WithHeader(jurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), ) @@ -206,7 +205,7 @@ func (r *R2BucketResource) Delete(ctx context.Context, req resource.DeleteReques r2.BucketDeleteParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, - option.WithHeader(jurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithMiddleware(logging.Middleware(ctx)), ) if err != nil { @@ -253,7 +252,7 @@ func (r *R2BucketResource) ImportState(ctx context.Context, req resource.ImportS r2.BucketGetParams{ AccountID: cloudflare.F(path_account_id), }, - option.WithHeader(jurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), ) diff --git a/internal/services/r2_bucket/schema.go b/internal/services/r2_bucket/schema.go index 05007f59b3..0c8d732084 100644 --- a/internal/services/r2_bucket/schema.go +++ b/internal/services/r2_bucket/schema.go @@ -35,7 +35,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "location": schema.StringAttribute{ - Description: "Location of the bucket", + Description: "Location of the bucket\nAvailable values: \"apac\", \"eeur\", \"enam\", \"weur\", \"wnam\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -61,7 +61,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "storage_class": schema.StringAttribute{ - Description: "Storage class for newly uploaded objects, unless specified otherwise.", + Description: "Storage class for newly uploaded objects, unless specified otherwise.\nAvailable values: \"Standard\", \"InfrequentAccess\".", Computed: true, Optional: true, Validators: []validator.String{ diff --git a/internal/services/r2_bucket_cors/model.go b/internal/services/r2_bucket_cors/model.go index f4fbd34d12..99ee162e88 100644 --- a/internal/services/r2_bucket_cors/model.go +++ b/internal/services/r2_bucket_cors/model.go @@ -13,9 +13,10 @@ type R2BucketCORSResultEnvelope struct { } type R2BucketCORSModel struct { - AccountID types.String `tfsdk:"account_id" path:"account_id,required"` - BucketName types.String `tfsdk:"bucket_name" path:"bucket_name,required"` - Rules customfield.NestedObjectList[R2BucketCORSRulesModel] `tfsdk:"rules" json:"rules,computed_optional"` + AccountID types.String `tfsdk:"account_id" path:"account_id,required"` + BucketName types.String `tfsdk:"bucket_name" path:"bucket_name,required"` + Jurisdiction types.String `tfsdk:"jurisdiction" json:"-,computed_optional"` + Rules customfield.NestedObjectList[R2BucketCORSRulesModel] `tfsdk:"rules" json:"rules,computed_optional"` } func (m R2BucketCORSModel) MarshalJSON() (data []byte, err error) { diff --git a/internal/services/r2_bucket_cors/resource.go b/internal/services/r2_bucket_cors/resource.go index edbdc82f23..813fd33353 100644 --- a/internal/services/r2_bucket_cors/resource.go +++ b/internal/services/r2_bucket_cors/resource.go @@ -12,6 +12,7 @@ import ( "github.com/cloudflare/cloudflare-go/v4/option" "github.com/cloudflare/cloudflare-go/v4/r2" "github.com/cloudflare/terraform-provider-cloudflare/internal/apijson" + "github.com/cloudflare/terraform-provider-cloudflare/internal/consts" "github.com/cloudflare/terraform-provider-cloudflare/internal/logging" "github.com/hashicorp/terraform-plugin-framework/resource" ) @@ -74,6 +75,7 @@ func (r *R2BucketCORSResource) Create(ctx context.Context, req resource.CreateRe r2.BucketCORSUpdateParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithRequestBody("application/json", dataBytes), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), @@ -123,6 +125,7 @@ func (r *R2BucketCORSResource) Update(ctx context.Context, req resource.UpdateRe r2.BucketCORSUpdateParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithRequestBody("application/json", dataBytes), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), @@ -159,6 +162,7 @@ func (r *R2BucketCORSResource) Read(ctx context.Context, req resource.ReadReques r2.BucketCORSGetParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), ) @@ -197,6 +201,7 @@ func (r *R2BucketCORSResource) Delete(ctx context.Context, req resource.DeleteRe r2.BucketCORSDeleteParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithMiddleware(logging.Middleware(ctx)), ) if err != nil { diff --git a/internal/services/r2_bucket_cors/schema.go b/internal/services/r2_bucket_cors/schema.go index 2d4e4c1531..fd595c678f 100644 --- a/internal/services/r2_bucket_cors/schema.go +++ b/internal/services/r2_bucket_cors/schema.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/listplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" @@ -32,6 +33,19 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, + "jurisdiction": schema.StringAttribute{ + Description: "Jurisdiction of the bucket", + Optional: true, + Computed: true, + Default: stringdefault.StaticString("default"), + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "default", + "eu", + "fedramp", + ), + }, + }, "rules": schema.ListNestedAttribute{ Computed: true, Optional: true, diff --git a/internal/services/r2_bucket_event_notification/model.go b/internal/services/r2_bucket_event_notification/model.go index 6f298d3b4e..13ac0864a7 100644 --- a/internal/services/r2_bucket_event_notification/model.go +++ b/internal/services/r2_bucket_event_notification/model.go @@ -13,11 +13,12 @@ type R2BucketEventNotificationResultEnvelope struct { } type R2BucketEventNotificationModel struct { - AccountID types.String `tfsdk:"account_id" path:"account_id,required"` - BucketName types.String `tfsdk:"bucket_name" path:"bucket_name,required"` - QueueID types.String `tfsdk:"queue_id" path:"queue_id,optional"` - Rules customfield.NestedObjectList[R2BucketEventNotificationRulesModel] `tfsdk:"rules" json:"rules,computed_optional"` - Queues customfield.NestedObjectList[R2BucketEventNotificationQueuesModel] `tfsdk:"queues" json:"queues,computed"` + AccountID types.String `tfsdk:"account_id" path:"account_id,required"` + BucketName types.String `tfsdk:"bucket_name" path:"bucket_name,required"` + Jurisdiction types.String `tfsdk:"jurisdiction" json:"-,computed_optional"` + QueueID types.String `tfsdk:"queue_id" path:"queue_id,optional"` + Rules customfield.NestedObjectList[R2BucketEventNotificationRulesModel] `tfsdk:"rules" json:"rules,computed_optional"` + Queues customfield.NestedObjectList[R2BucketEventNotificationQueuesModel] `tfsdk:"queues" json:"queues,computed"` } func (m R2BucketEventNotificationModel) MarshalJSON() (data []byte, err error) { diff --git a/internal/services/r2_bucket_event_notification/resource.go b/internal/services/r2_bucket_event_notification/resource.go index 156b680016..dc9c564c8a 100644 --- a/internal/services/r2_bucket_event_notification/resource.go +++ b/internal/services/r2_bucket_event_notification/resource.go @@ -12,6 +12,7 @@ import ( "github.com/cloudflare/cloudflare-go/v4/option" "github.com/cloudflare/cloudflare-go/v4/r2" "github.com/cloudflare/terraform-provider-cloudflare/internal/apijson" + "github.com/cloudflare/terraform-provider-cloudflare/internal/consts" "github.com/cloudflare/terraform-provider-cloudflare/internal/logging" "github.com/hashicorp/terraform-plugin-framework/resource" ) @@ -75,6 +76,7 @@ func (r *R2BucketEventNotificationResource) Create(ctx context.Context, req reso r2.BucketEventNotificationUpdateParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithRequestBody("application/json", dataBytes), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), @@ -125,6 +127,7 @@ func (r *R2BucketEventNotificationResource) Update(ctx context.Context, req reso r2.BucketEventNotificationUpdateParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithRequestBody("application/json", dataBytes), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), @@ -161,6 +164,7 @@ func (r *R2BucketEventNotificationResource) Read(ctx context.Context, req resour r2.BucketEventNotificationGetParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), ) @@ -200,6 +204,7 @@ func (r *R2BucketEventNotificationResource) Delete(ctx context.Context, req reso r2.BucketEventNotificationDeleteParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithMiddleware(logging.Middleware(ctx)), ) if err != nil { diff --git a/internal/services/r2_bucket_event_notification/schema.go b/internal/services/r2_bucket_event_notification/schema.go index 533fb7b9dc..f4f5d538a1 100644 --- a/internal/services/r2_bucket_event_notification/schema.go +++ b/internal/services/r2_bucket_event_notification/schema.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/listplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" @@ -32,6 +33,19 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, + "jurisdiction": schema.StringAttribute{ + Description: "Jurisdiction of the bucket", + Optional: true, + Computed: true, + Default: stringdefault.StaticString("default"), + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "default", + "eu", + "fedramp", + ), + }, + }, "queue_id": schema.StringAttribute{ Description: "Queue ID", Optional: true, diff --git a/internal/services/r2_bucket_lifecycle/data_source_schema.go b/internal/services/r2_bucket_lifecycle/data_source_schema.go index 41309ed6c9..56d34af045 100644 --- a/internal/services/r2_bucket_lifecycle/data_source_schema.go +++ b/internal/services/r2_bucket_lifecycle/data_source_schema.go @@ -64,7 +64,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"Age\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("Age"), }, @@ -87,7 +88,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"Age\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("Age", "Date"), }, @@ -115,7 +117,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"Age\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("Age", "Date"), }, @@ -127,7 +130,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "storage_class": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"InfrequentAccess\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("InfrequentAccess"), }, diff --git a/internal/services/r2_bucket_lifecycle/model.go b/internal/services/r2_bucket_lifecycle/model.go index 094caf15f8..ffc03afb63 100644 --- a/internal/services/r2_bucket_lifecycle/model.go +++ b/internal/services/r2_bucket_lifecycle/model.go @@ -14,9 +14,10 @@ type R2BucketLifecycleResultEnvelope struct { } type R2BucketLifecycleModel struct { - AccountID types.String `tfsdk:"account_id" path:"account_id,required"` - BucketName types.String `tfsdk:"bucket_name" path:"bucket_name,required"` - Rules customfield.NestedObjectList[R2BucketLifecycleRulesModel] `tfsdk:"rules" json:"rules,computed_optional"` + AccountID types.String `tfsdk:"account_id" path:"account_id,required"` + BucketName types.String `tfsdk:"bucket_name" path:"bucket_name,required"` + Jurisdiction types.String `tfsdk:"jurisdiction" json:"-,computed_optional"` + Rules customfield.NestedObjectList[R2BucketLifecycleRulesModel] `tfsdk:"rules" json:"rules,computed_optional"` } func (m R2BucketLifecycleModel) MarshalJSON() (data []byte, err error) { diff --git a/internal/services/r2_bucket_lifecycle/resource.go b/internal/services/r2_bucket_lifecycle/resource.go index cce954fefc..82c7e113cd 100644 --- a/internal/services/r2_bucket_lifecycle/resource.go +++ b/internal/services/r2_bucket_lifecycle/resource.go @@ -12,6 +12,7 @@ import ( "github.com/cloudflare/cloudflare-go/v4/option" "github.com/cloudflare/cloudflare-go/v4/r2" "github.com/cloudflare/terraform-provider-cloudflare/internal/apijson" + "github.com/cloudflare/terraform-provider-cloudflare/internal/consts" "github.com/cloudflare/terraform-provider-cloudflare/internal/logging" "github.com/hashicorp/terraform-plugin-framework/resource" ) @@ -74,6 +75,7 @@ func (r *R2BucketLifecycleResource) Create(ctx context.Context, req resource.Cre r2.BucketLifecycleUpdateParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithRequestBody("application/json", dataBytes), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), @@ -123,6 +125,7 @@ func (r *R2BucketLifecycleResource) Update(ctx context.Context, req resource.Upd r2.BucketLifecycleUpdateParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithRequestBody("application/json", dataBytes), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), @@ -159,6 +162,7 @@ func (r *R2BucketLifecycleResource) Read(ctx context.Context, req resource.ReadR r2.BucketLifecycleGetParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), ) diff --git a/internal/services/r2_bucket_lifecycle/schema.go b/internal/services/r2_bucket_lifecycle/schema.go index 0887a8e17c..06cde1995a 100644 --- a/internal/services/r2_bucket_lifecycle/schema.go +++ b/internal/services/r2_bucket_lifecycle/schema.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/listplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" ) @@ -31,6 +32,19 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, + "jurisdiction": schema.StringAttribute{ + Description: "Jurisdiction of the bucket", + Optional: true, + Computed: true, + Default: stringdefault.StaticString("default"), + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "default", + "eu", + "fedramp", + ), + }, + }, "rules": schema.ListNestedAttribute{ Computed: true, Optional: true, @@ -71,7 +85,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "type": schema.StringAttribute{ - Required: true, + Description: "Available values: \"Age\".", + Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("Age"), }, @@ -96,7 +111,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "type": schema.StringAttribute{ - Required: true, + Description: "Available values: \"Age\".", + Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("Age", "Date"), }, @@ -124,7 +140,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "type": schema.StringAttribute{ - Required: true, + Description: "Available values: \"Age\".", + Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("Age", "Date"), }, @@ -136,7 +153,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "storage_class": schema.StringAttribute{ - Required: true, + Description: "Available values: \"InfrequentAccess\".", + Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("InfrequentAccess"), }, diff --git a/internal/services/r2_bucket_lock/data_source_schema.go b/internal/services/r2_bucket_lock/data_source_schema.go index fc0c4393a5..9b356cf676 100644 --- a/internal/services/r2_bucket_lock/data_source_schema.go +++ b/internal/services/r2_bucket_lock/data_source_schema.go @@ -44,7 +44,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"Age\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "Age", diff --git a/internal/services/r2_bucket_lock/model.go b/internal/services/r2_bucket_lock/model.go index f42652622d..ef62270190 100644 --- a/internal/services/r2_bucket_lock/model.go +++ b/internal/services/r2_bucket_lock/model.go @@ -14,9 +14,10 @@ type R2BucketLockResultEnvelope struct { } type R2BucketLockModel struct { - AccountID types.String `tfsdk:"account_id" path:"account_id,required"` - BucketName types.String `tfsdk:"bucket_name" path:"bucket_name,required"` - Rules customfield.NestedObjectList[R2BucketLockRulesModel] `tfsdk:"rules" json:"rules,computed_optional"` + AccountID types.String `tfsdk:"account_id" path:"account_id,required"` + BucketName types.String `tfsdk:"bucket_name" path:"bucket_name,required"` + Jurisdiction types.String `tfsdk:"jurisdiction" json:"-,computed_optional"` + Rules customfield.NestedObjectList[R2BucketLockRulesModel] `tfsdk:"rules" json:"rules,computed_optional"` } func (m R2BucketLockModel) MarshalJSON() (data []byte, err error) { diff --git a/internal/services/r2_bucket_lock/resource.go b/internal/services/r2_bucket_lock/resource.go index 0ae716f90e..ccbfbf1885 100644 --- a/internal/services/r2_bucket_lock/resource.go +++ b/internal/services/r2_bucket_lock/resource.go @@ -12,6 +12,7 @@ import ( "github.com/cloudflare/cloudflare-go/v4/option" "github.com/cloudflare/cloudflare-go/v4/r2" "github.com/cloudflare/terraform-provider-cloudflare/internal/apijson" + "github.com/cloudflare/terraform-provider-cloudflare/internal/consts" "github.com/cloudflare/terraform-provider-cloudflare/internal/logging" "github.com/hashicorp/terraform-plugin-framework/resource" ) @@ -74,6 +75,7 @@ func (r *R2BucketLockResource) Create(ctx context.Context, req resource.CreateRe r2.BucketLockUpdateParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithRequestBody("application/json", dataBytes), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), @@ -123,6 +125,7 @@ func (r *R2BucketLockResource) Update(ctx context.Context, req resource.UpdateRe r2.BucketLockUpdateParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithRequestBody("application/json", dataBytes), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), @@ -159,6 +162,7 @@ func (r *R2BucketLockResource) Read(ctx context.Context, req resource.ReadReques r2.BucketLockGetParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), ) diff --git a/internal/services/r2_bucket_lock/schema.go b/internal/services/r2_bucket_lock/schema.go index 5371108d45..9bfb8cd8c3 100644 --- a/internal/services/r2_bucket_lock/schema.go +++ b/internal/services/r2_bucket_lock/schema.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/listplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" ) @@ -31,6 +32,19 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, + "jurisdiction": schema.StringAttribute{ + Description: "Jurisdiction of the bucket", + Optional: true, + Computed: true, + Default: stringdefault.StaticString("default"), + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "default", + "eu", + "fedramp", + ), + }, + }, "rules": schema.ListNestedAttribute{ Computed: true, Optional: true, @@ -49,7 +63,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "type": schema.StringAttribute{ - Required: true, + Description: "Available values: \"Age\".", + Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "Age", diff --git a/internal/services/r2_bucket_sippy/data_source_schema.go b/internal/services/r2_bucket_sippy/data_source_schema.go index fac076890d..d969b7a074 100644 --- a/internal/services/r2_bucket_sippy/data_source_schema.go +++ b/internal/services/r2_bucket_sippy/data_source_schema.go @@ -35,7 +35,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[R2BucketSippyDestinationDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "access_key_id": schema.StringAttribute{ - Description: "ID of the Cloudflare API token used when writing objects to this\nbucket\n", + Description: "ID of the Cloudflare API token used when writing objects to this\nbucket", Computed: true, }, "account": schema.StringAttribute{ @@ -46,7 +46,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "provider": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"r2\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("r2"), }, @@ -63,7 +64,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "provider": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"aws\", \"gcs\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("aws", "gcs"), }, diff --git a/internal/services/r2_bucket_sippy/model.go b/internal/services/r2_bucket_sippy/model.go index 7c00f47304..9a90420575 100644 --- a/internal/services/r2_bucket_sippy/model.go +++ b/internal/services/r2_bucket_sippy/model.go @@ -13,11 +13,12 @@ type R2BucketSippyResultEnvelope struct { } type R2BucketSippyModel struct { - AccountID types.String `tfsdk:"account_id" path:"account_id,required"` - BucketName types.String `tfsdk:"bucket_name" path:"bucket_name,required"` - Destination customfield.NestedObject[R2BucketSippyDestinationModel] `tfsdk:"destination" json:"destination,computed_optional"` - Source customfield.NestedObject[R2BucketSippySourceModel] `tfsdk:"source" json:"source,computed_optional"` - Enabled types.Bool `tfsdk:"enabled" json:"enabled,computed"` + AccountID types.String `tfsdk:"account_id" path:"account_id,required"` + BucketName types.String `tfsdk:"bucket_name" path:"bucket_name,required"` + Jurisdiction types.String `tfsdk:"jurisdiction" json:"-,computed_optional"` + Destination customfield.NestedObject[R2BucketSippyDestinationModel] `tfsdk:"destination" json:"destination,computed_optional"` + Source customfield.NestedObject[R2BucketSippySourceModel] `tfsdk:"source" json:"source,computed_optional"` + Enabled types.Bool `tfsdk:"enabled" json:"enabled,computed"` } func (m R2BucketSippyModel) MarshalJSON() (data []byte, err error) { diff --git a/internal/services/r2_bucket_sippy/resource.go b/internal/services/r2_bucket_sippy/resource.go index 6630376ef9..b5ed89f2d2 100644 --- a/internal/services/r2_bucket_sippy/resource.go +++ b/internal/services/r2_bucket_sippy/resource.go @@ -12,6 +12,7 @@ import ( "github.com/cloudflare/cloudflare-go/v4/option" "github.com/cloudflare/cloudflare-go/v4/r2" "github.com/cloudflare/terraform-provider-cloudflare/internal/apijson" + "github.com/cloudflare/terraform-provider-cloudflare/internal/consts" "github.com/cloudflare/terraform-provider-cloudflare/internal/logging" "github.com/hashicorp/terraform-plugin-framework/resource" ) @@ -74,6 +75,7 @@ func (r *R2BucketSippyResource) Create(ctx context.Context, req resource.CreateR r2.BucketSippyUpdateParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithRequestBody("application/json", dataBytes), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), @@ -123,6 +125,7 @@ func (r *R2BucketSippyResource) Update(ctx context.Context, req resource.UpdateR r2.BucketSippyUpdateParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithRequestBody("application/json", dataBytes), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), @@ -159,6 +162,7 @@ func (r *R2BucketSippyResource) Read(ctx context.Context, req resource.ReadReque r2.BucketSippyGetParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), ) @@ -197,6 +201,7 @@ func (r *R2BucketSippyResource) Delete(ctx context.Context, req resource.DeleteR r2.BucketSippyDeleteParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithMiddleware(logging.Middleware(ctx)), ) if err != nil { diff --git a/internal/services/r2_bucket_sippy/schema.go b/internal/services/r2_bucket_sippy/schema.go index 17ec35f5ac..2ac950f931 100644 --- a/internal/services/r2_bucket_sippy/schema.go +++ b/internal/services/r2_bucket_sippy/schema.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/objectplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" ) @@ -30,6 +31,19 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, + "jurisdiction": schema.StringAttribute{ + Description: "Jurisdiction of the bucket", + Optional: true, + Computed: true, + Default: stringdefault.StaticString("default"), + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "default", + "eu", + "fedramp", + ), + }, + }, "destination": schema.SingleNestedAttribute{ Description: "R2 bucket to copy objects to", Computed: true, @@ -37,17 +51,18 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[R2BucketSippyDestinationModel](ctx), Attributes: map[string]schema.Attribute{ "access_key_id": schema.StringAttribute{ - Description: "ID of a Cloudflare API token.\nThis is the value labelled \"Access Key ID\" when creating an API\ntoken from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).\n\nSippy will use this token when writing objects to R2, so it is\nbest to scope this token to the bucket you're enabling Sippy for.\n", + Description: "ID of a Cloudflare API token.\nThis is the value labelled \"Access Key ID\" when creating an API\ntoken from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).\n\nSippy will use this token when writing objects to R2, so it is\nbest to scope this token to the bucket you're enabling Sippy for.", Optional: true, }, "provider": schema.StringAttribute{ - Optional: true, + Description: "Available values: \"r2\".", + Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("r2"), }, }, "secret_access_key": schema.StringAttribute{ - Description: "Value of a Cloudflare API token.\nThis is the value labelled \"Secret Access Key\" when creating an API\ntoken from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).\n\nSippy will use this token when writing objects to R2, so it is\nbest to scope this token to the bucket you're enabling Sippy for.\n", + Description: "Value of a Cloudflare API token.\nThis is the value labelled \"Secret Access Key\" when creating an API\ntoken from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).\n\nSippy will use this token when writing objects to R2, so it is\nbest to scope this token to the bucket you're enabling Sippy for.", Optional: true, }, }, @@ -68,7 +83,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "provider": schema.StringAttribute{ - Optional: true, + Description: "Available values: \"aws\".", + Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("aws", "gcs"), }, diff --git a/internal/services/r2_custom_domain/data_source_schema.go b/internal/services/r2_custom_domain/data_source_schema.go index 8e97363d7b..3451b531cb 100644 --- a/internal/services/r2_custom_domain/data_source_schema.go +++ b/internal/services/r2_custom_domain/data_source_schema.go @@ -38,7 +38,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "min_tls": schema.StringAttribute{ - Description: "Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to 1.0.", + Description: "Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to 1.0.\nAvailable values: \"1.0\", \"1.1\", \"1.2\", \"1.3\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -62,7 +62,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[R2CustomDomainStatusDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "ownership": schema.StringAttribute{ - Description: "Ownership status of the domain", + Description: "Ownership status of the domain\nAvailable values: \"pending\", \"active\", \"deactivated\", \"blocked\", \"error\", \"unknown\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -76,7 +76,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "ssl": schema.StringAttribute{ - Description: "SSL certificate status", + Description: "SSL certificate status\nAvailable values: \"initializing\", \"pending\", \"active\", \"deactivated\", \"error\", \"unknown\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/r2_custom_domain/model.go b/internal/services/r2_custom_domain/model.go index e258f9b72d..93f2842650 100644 --- a/internal/services/r2_custom_domain/model.go +++ b/internal/services/r2_custom_domain/model.go @@ -13,15 +13,16 @@ type R2CustomDomainResultEnvelope struct { } type R2CustomDomainModel struct { - AccountID types.String `tfsdk:"account_id" path:"account_id,required"` - BucketName types.String `tfsdk:"bucket_name" path:"bucket_name,required"` - DomainName types.String `tfsdk:"domain_name" path:"domain_name,optional"` - Domain types.String `tfsdk:"domain" json:"domain,required"` - ZoneID types.String `tfsdk:"zone_id" json:"zoneId,required"` - Enabled types.Bool `tfsdk:"enabled" json:"enabled,required"` - MinTLS types.String `tfsdk:"min_tls" json:"minTLS,optional"` - ZoneName types.String `tfsdk:"zone_name" json:"zoneName,computed"` - Status customfield.NestedObject[R2CustomDomainStatusModel] `tfsdk:"status" json:"status,computed"` + AccountID types.String `tfsdk:"account_id" path:"account_id,required"` + BucketName types.String `tfsdk:"bucket_name" path:"bucket_name,required"` + Jurisdiction types.String `tfsdk:"jurisdiction" json:"-,computed_optional"` + DomainName types.String `tfsdk:"domain_name" path:"domain_name,optional"` + Domain types.String `tfsdk:"domain" json:"domain,required"` + ZoneID types.String `tfsdk:"zone_id" json:"zoneId,required"` + Enabled types.Bool `tfsdk:"enabled" json:"enabled,required"` + MinTLS types.String `tfsdk:"min_tls" json:"minTLS,optional"` + ZoneName types.String `tfsdk:"zone_name" json:"zoneName,computed"` + Status customfield.NestedObject[R2CustomDomainStatusModel] `tfsdk:"status" json:"status,computed"` } func (m R2CustomDomainModel) MarshalJSON() (data []byte, err error) { diff --git a/internal/services/r2_custom_domain/resource.go b/internal/services/r2_custom_domain/resource.go index dcd3006a4b..a79eb8bf25 100644 --- a/internal/services/r2_custom_domain/resource.go +++ b/internal/services/r2_custom_domain/resource.go @@ -12,6 +12,7 @@ import ( "github.com/cloudflare/cloudflare-go/v4/option" "github.com/cloudflare/cloudflare-go/v4/r2" "github.com/cloudflare/terraform-provider-cloudflare/internal/apijson" + "github.com/cloudflare/terraform-provider-cloudflare/internal/consts" "github.com/cloudflare/terraform-provider-cloudflare/internal/logging" "github.com/hashicorp/terraform-plugin-framework/resource" ) @@ -74,6 +75,7 @@ func (r *R2CustomDomainResource) Create(ctx context.Context, req resource.Create r2.BucketDomainCustomNewParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithRequestBody("application/json", dataBytes), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), @@ -124,6 +126,7 @@ func (r *R2CustomDomainResource) Update(ctx context.Context, req resource.Update r2.BucketDomainCustomUpdateParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithRequestBody("application/json", dataBytes), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), @@ -161,6 +164,7 @@ func (r *R2CustomDomainResource) Read(ctx context.Context, req resource.ReadRequ r2.BucketDomainCustomGetParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), ) @@ -200,6 +204,7 @@ func (r *R2CustomDomainResource) Delete(ctx context.Context, req resource.Delete r2.BucketDomainCustomDeleteParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithMiddleware(logging.Middleware(ctx)), ) if err != nil { diff --git a/internal/services/r2_custom_domain/schema.go b/internal/services/r2_custom_domain/schema.go index 1c0e1187c7..b1159711a7 100644 --- a/internal/services/r2_custom_domain/schema.go +++ b/internal/services/r2_custom_domain/schema.go @@ -49,7 +49,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "min_tls": schema.StringAttribute{ - Description: "Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to 1.0.", + Description: "Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to 1.0.\nAvailable values: \"1.0\", \"1.1\", \"1.2\", \"1.3\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -69,7 +69,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[R2CustomDomainStatusModel](ctx), Attributes: map[string]schema.Attribute{ "ownership": schema.StringAttribute{ - Description: "Ownership status of the domain", + Description: "Ownership status of the domain\nAvailable values: \"pending\", \"active\", \"deactivated\", \"blocked\", \"error\", \"unknown\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -83,7 +83,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "ssl": schema.StringAttribute{ - Description: "SSL certificate status", + Description: "SSL certificate status\nAvailable values: \"initializing\", \"pending\", \"active\", \"deactivated\", \"error\", \"unknown\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/r2_managed_domain/model.go b/internal/services/r2_managed_domain/model.go index 822292c54c..8fee03b84f 100644 --- a/internal/services/r2_managed_domain/model.go +++ b/internal/services/r2_managed_domain/model.go @@ -12,11 +12,12 @@ type R2ManagedDomainResultEnvelope struct { } type R2ManagedDomainModel struct { - AccountID types.String `tfsdk:"account_id" path:"account_id,required"` - BucketName types.String `tfsdk:"bucket_name" path:"bucket_name,required"` - Enabled types.Bool `tfsdk:"enabled" json:"enabled,required"` - BucketID types.String `tfsdk:"bucket_id" json:"bucketId,computed"` - Domain types.String `tfsdk:"domain" json:"domain,computed"` + AccountID types.String `tfsdk:"account_id" path:"account_id,required"` + BucketName types.String `tfsdk:"bucket_name" path:"bucket_name,required"` + Jurisdiction types.String `tfsdk:"jurisdiction" json:"-,computed_optional"` + Enabled types.Bool `tfsdk:"enabled" json:"enabled,required"` + BucketID types.String `tfsdk:"bucket_id" json:"bucketId,computed"` + Domain types.String `tfsdk:"domain" json:"domain,computed"` } func (m R2ManagedDomainModel) MarshalJSON() (data []byte, err error) { diff --git a/internal/services/r2_managed_domain/resource.go b/internal/services/r2_managed_domain/resource.go index 3fffc08127..b4ee36a8db 100644 --- a/internal/services/r2_managed_domain/resource.go +++ b/internal/services/r2_managed_domain/resource.go @@ -12,6 +12,7 @@ import ( "github.com/cloudflare/cloudflare-go/v4/option" "github.com/cloudflare/cloudflare-go/v4/r2" "github.com/cloudflare/terraform-provider-cloudflare/internal/apijson" + "github.com/cloudflare/terraform-provider-cloudflare/internal/consts" "github.com/cloudflare/terraform-provider-cloudflare/internal/logging" "github.com/hashicorp/terraform-plugin-framework/resource" ) @@ -74,6 +75,7 @@ func (r *R2ManagedDomainResource) Create(ctx context.Context, req resource.Creat r2.BucketDomainManagedUpdateParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithRequestBody("application/json", dataBytes), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), @@ -123,6 +125,7 @@ func (r *R2ManagedDomainResource) Update(ctx context.Context, req resource.Updat r2.BucketDomainManagedUpdateParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, + option.WithHeader(consts.R2JurisdictionHTTPHeaderName, data.Jurisdiction.ValueString()), option.WithRequestBody("application/json", dataBytes), option.WithResponseBodyInto(&res), option.WithMiddleware(logging.Middleware(ctx)), diff --git a/internal/services/r2_managed_domain/schema.go b/internal/services/r2_managed_domain/schema.go index 1a79bc3016..c85529c5f2 100644 --- a/internal/services/r2_managed_domain/schema.go +++ b/internal/services/r2_managed_domain/schema.go @@ -5,11 +5,14 @@ package r2_managed_domain import ( "context" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" ) var _ resource.ResourceWithConfigValidators = (*R2ManagedDomainResource)(nil) @@ -27,6 +30,19 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, + "jurisdiction": schema.StringAttribute{ + Description: "Jurisdiction of the bucket", + Optional: true, + Computed: true, + Default: stringdefault.StaticString("default"), + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "default", + "eu", + "fedramp", + ), + }, + }, "enabled": schema.BoolAttribute{ Description: "Whether to enable public bucket access at the r2.dev domain", Required: true, diff --git a/internal/services/rate_limit/data_source_schema.go b/internal/services/rate_limit/data_source_schema.go index 93a9199ce0..e56cb74957 100644 --- a/internal/services/rate_limit/data_source_schema.go +++ b/internal/services/rate_limit/data_source_schema.go @@ -60,7 +60,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[RateLimitActionDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "mode": schema.StringAttribute{ - Description: "The action to perform.", + Description: "The action to perform.\nAvailable values: \"simulate\", \"ban\", \"challenge\", \"js_challenge\", \"managed_challenge\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -103,7 +103,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "name": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"url\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("url"), }, @@ -130,7 +131,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "op": schema.StringAttribute{ - Description: "The operator used when matching: `eq` means \"equal\" and `ne` means \"not equal\".", + Description: "The operator used when matching: `eq` means \"equal\" and `ne` means \"not equal\".\nAvailable values: \"eq\", \"ne\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("eq", "ne"), diff --git a/internal/services/rate_limit/list_data_source_schema.go b/internal/services/rate_limit/list_data_source_schema.go index 4a7a6950ad..f8efb22be2 100644 --- a/internal/services/rate_limit/list_data_source_schema.go +++ b/internal/services/rate_limit/list_data_source_schema.go @@ -48,7 +48,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[RateLimitsActionDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "mode": schema.StringAttribute{ - Description: "The action to perform.", + Description: "The action to perform.\nAvailable values: \"simulate\", \"ban\", \"challenge\", \"js_challenge\", \"managed_challenge\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -91,7 +91,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "name": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"url\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("url"), }, @@ -126,7 +127,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "op": schema.StringAttribute{ - Description: "The operator used when matching: `eq` means \"equal\" and `ne` means \"not equal\".", + Description: "The operator used when matching: `eq` means \"equal\" and `ne` means \"not equal\".\nAvailable values: \"eq\", \"ne\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("eq", "ne"), diff --git a/internal/services/rate_limit/schema.go b/internal/services/rate_limit/schema.go index f0bc42992a..a1ad014a4c 100644 --- a/internal/services/rate_limit/schema.go +++ b/internal/services/rate_limit/schema.go @@ -51,7 +51,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, Attributes: map[string]schema.Attribute{ "mode": schema.StringAttribute{ - Description: "The action to perform.", + Description: "The action to perform.\nAvailable values: \"simulate\", \"ban\", \"challenge\", \"js_challenge\", \"managed_challenge\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -99,7 +99,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "op": schema.StringAttribute{ - Description: "The operator used when matching: `eq` means \"equal\" and `ne` means \"not equal\".", + Description: "The operator used when matching: `eq` means \"equal\" and `ne` means \"not equal\".\nAvailable values: \"eq\", \"ne\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("eq", "ne"), @@ -170,7 +170,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "name": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"url\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("url"), }, diff --git a/internal/services/regional_tiered_cache/data_source_schema.go b/internal/services/regional_tiered_cache/data_source_schema.go index dc9da6a0f4..7e3e86c5bb 100644 --- a/internal/services/regional_tiered_cache/data_source_schema.go +++ b/internal/services/regional_tiered_cache/data_source_schema.go @@ -26,7 +26,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "id": schema.StringAttribute{ - Description: "ID of the zone setting.", + Description: "ID of the zone setting.\nAvailable values: \"tc_regional\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("tc_regional"), @@ -38,7 +38,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "value": schema.StringAttribute{ - Description: "The value of the feature", + Description: "The value of the feature\nAvailable values: \"on\", \"off\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("on", "off"), diff --git a/internal/services/regional_tiered_cache/schema.go b/internal/services/regional_tiered_cache/schema.go index 15894a7cc5..9be2522584 100644 --- a/internal/services/regional_tiered_cache/schema.go +++ b/internal/services/regional_tiered_cache/schema.go @@ -31,7 +31,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown(), stringplanmodifier.RequiresReplace()}, }, "value": schema.StringAttribute{ - Description: "Value of the Regional Tiered Cache zone setting.", + Description: "Value of the Regional Tiered Cache zone setting.\nAvailable values: \"on\", \"off\".", Computed: true, Optional: true, Validators: []validator.String{ diff --git a/internal/services/registrar_domain/list_data_source_schema.go b/internal/services/registrar_domain/list_data_source_schema.go index cadbe4b8a3..b221f04970 100644 --- a/internal/services/registrar_domain/list_data_source_schema.go +++ b/internal/services/registrar_domain/list_data_source_schema.go @@ -139,14 +139,14 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[RegistrarDomainsTransferInDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "accept_foa": schema.StringAttribute{ - Description: "Form of authorization has been accepted by the registrant.", + Description: "Form of authorization has been accepted by the registrant.\nAvailable values: \"needed\", \"ok\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("needed", "ok"), }, }, "approve_transfer": schema.StringAttribute{ - Description: "Shows transfer status with the registry.", + Description: "Shows transfer status with the registry.\nAvailable values: \"needed\", \"ok\", \"pending\", \"trying\", \"rejected\", \"unknown\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -164,7 +164,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "disable_privacy": schema.StringAttribute{ - Description: "Privacy guards are disabled at the foreign registrar.", + Description: "Privacy guards are disabled at the foreign registrar.\nAvailable values: \"needed\", \"ok\", \"unknown\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -175,7 +175,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "enter_auth_code": schema.StringAttribute{ - Description: "Auth code has been entered and verified.", + Description: "Auth code has been entered and verified.\nAvailable values: \"needed\", \"ok\", \"pending\", \"trying\", \"rejected\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -188,7 +188,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "unlock_domain": schema.StringAttribute{ - Description: "Domain is unlocked at the foreign registrar.", + Description: "Domain is unlocked at the foreign registrar.\nAvailable values: \"needed\", \"ok\", \"pending\", \"trying\", \"unknown\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/ruleset/data_source_model.go b/internal/services/ruleset/data_source_model.go index a7df65e963..29a1c3e33c 100644 --- a/internal/services/ruleset/data_source_model.go +++ b/internal/services/ruleset/data_source_model.go @@ -67,58 +67,60 @@ type RulesetRulesDataSourceModel struct { } type RulesetRulesActionParametersDataSourceModel struct { - Response customfield.NestedObject[RulesetRulesActionParametersResponseDataSourceModel] `tfsdk:"response" json:"response,computed"` - Algorithms customfield.NestedObjectList[RulesetRulesActionParametersAlgorithmsDataSourceModel] `tfsdk:"algorithms" json:"algorithms,computed"` - ID types.String `tfsdk:"id" json:"id,computed"` - MatchedData customfield.NestedObject[RulesetRulesActionParametersMatchedDataDataSourceModel] `tfsdk:"matched_data" json:"matched_data,computed"` - Overrides customfield.NestedObject[RulesetRulesActionParametersOverridesDataSourceModel] `tfsdk:"overrides" json:"overrides,computed"` - FromList customfield.NestedObject[RulesetRulesActionParametersFromListDataSourceModel] `tfsdk:"from_list" json:"from_list,computed"` - FromValue customfield.NestedObject[RulesetRulesActionParametersFromValueDataSourceModel] `tfsdk:"from_value" json:"from_value,computed"` - Headers customfield.NestedObjectMap[RulesetRulesActionParametersHeadersDataSourceModel] `tfsdk:"headers" json:"headers,computed"` - URI customfield.NestedObject[RulesetRulesActionParametersURIDataSourceModel] `tfsdk:"uri" json:"uri,computed"` - HostHeader types.String `tfsdk:"host_header" json:"host_header,computed"` - Origin customfield.NestedObject[RulesetRulesActionParametersOriginDataSourceModel] `tfsdk:"origin" json:"origin,computed"` - SNI customfield.NestedObject[RulesetRulesActionParametersSNIDataSourceModel] `tfsdk:"sni" json:"sni,computed"` - Increment types.Int64 `tfsdk:"increment" json:"increment,computed"` - Content types.String `tfsdk:"content" json:"content,computed"` - ContentType types.String `tfsdk:"content_type" json:"content_type,computed"` - StatusCode types.Float64 `tfsdk:"status_code" json:"status_code,computed"` - AutomaticHTTPSRewrites types.Bool `tfsdk:"automatic_https_rewrites" json:"automatic_https_rewrites,computed"` - Autominify customfield.NestedObject[RulesetRulesActionParametersAutominifyDataSourceModel] `tfsdk:"autominify" json:"autominify,computed"` - BIC types.Bool `tfsdk:"bic" json:"bic,computed"` - DisableApps types.Bool `tfsdk:"disable_apps" json:"disable_apps,computed"` - DisableRUM types.Bool `tfsdk:"disable_rum" json:"disable_rum,computed"` - DisableZaraz types.Bool `tfsdk:"disable_zaraz" json:"disable_zaraz,computed"` - EmailObfuscation types.Bool `tfsdk:"email_obfuscation" json:"email_obfuscation,computed"` - Fonts types.Bool `tfsdk:"fonts" json:"fonts,computed"` - HotlinkProtection types.Bool `tfsdk:"hotlink_protection" json:"hotlink_protection,computed"` - Mirage types.Bool `tfsdk:"mirage" json:"mirage,computed"` - OpportunisticEncryption types.Bool `tfsdk:"opportunistic_encryption" json:"opportunistic_encryption,computed"` - Polish types.String `tfsdk:"polish" json:"polish,computed"` - RocketLoader types.Bool `tfsdk:"rocket_loader" json:"rocket_loader,computed"` - SecurityLevel types.String `tfsdk:"security_level" json:"security_level,computed"` - ServerSideExcludes types.Bool `tfsdk:"server_side_excludes" json:"server_side_excludes,computed"` - SSL types.String `tfsdk:"ssl" json:"ssl,computed"` - SXG types.Bool `tfsdk:"sxg" json:"sxg,computed"` - Phases customfield.List[types.String] `tfsdk:"phases" json:"phases,computed"` - Products customfield.List[types.String] `tfsdk:"products" json:"products,computed"` - Rules customfield.Map[customfield.List[types.String]] `tfsdk:"rules" json:"rules,computed"` - Ruleset types.String `tfsdk:"ruleset" json:"ruleset,computed"` - Rulesets customfield.List[types.String] `tfsdk:"rulesets" json:"rulesets,computed"` - AdditionalCacheablePorts customfield.List[types.Int64] `tfsdk:"additional_cacheable_ports" json:"additional_cacheable_ports,computed"` - BrowserTTL customfield.NestedObject[RulesetRulesActionParametersBrowserTTLDataSourceModel] `tfsdk:"browser_ttl" json:"browser_ttl,computed"` - Cache types.Bool `tfsdk:"cache" json:"cache,computed"` - CacheKey customfield.NestedObject[RulesetRulesActionParametersCacheKeyDataSourceModel] `tfsdk:"cache_key" json:"cache_key,computed"` - CacheReserve customfield.NestedObject[RulesetRulesActionParametersCacheReserveDataSourceModel] `tfsdk:"cache_reserve" json:"cache_reserve,computed"` - EdgeTTL customfield.NestedObject[RulesetRulesActionParametersEdgeTTLDataSourceModel] `tfsdk:"edge_ttl" json:"edge_ttl,computed"` - OriginCacheControl types.Bool `tfsdk:"origin_cache_control" json:"origin_cache_control,computed"` - OriginErrorPagePassthru types.Bool `tfsdk:"origin_error_page_passthru" json:"origin_error_page_passthru,computed"` - ReadTimeout types.Int64 `tfsdk:"read_timeout" json:"read_timeout,computed"` - RespectStrongEtags types.Bool `tfsdk:"respect_strong_etags" json:"respect_strong_etags,computed"` - ServeStale customfield.NestedObject[RulesetRulesActionParametersServeStaleDataSourceModel] `tfsdk:"serve_stale" json:"serve_stale,computed"` - CookieFields customfield.NestedObjectList[RulesetRulesActionParametersCookieFieldsDataSourceModel] `tfsdk:"cookie_fields" json:"cookie_fields,computed"` - RequestFields customfield.NestedObjectList[RulesetRulesActionParametersRequestFieldsDataSourceModel] `tfsdk:"request_fields" json:"request_fields,computed"` - ResponseFields customfield.NestedObjectList[RulesetRulesActionParametersResponseFieldsDataSourceModel] `tfsdk:"response_fields" json:"response_fields,computed"` + Response customfield.NestedObject[RulesetRulesActionParametersResponseDataSourceModel] `tfsdk:"response" json:"response,computed"` + Algorithms customfield.NestedObjectList[RulesetRulesActionParametersAlgorithmsDataSourceModel] `tfsdk:"algorithms" json:"algorithms,computed"` + ID types.String `tfsdk:"id" json:"id,computed"` + MatchedData customfield.NestedObject[RulesetRulesActionParametersMatchedDataDataSourceModel] `tfsdk:"matched_data" json:"matched_data,computed"` + Overrides customfield.NestedObject[RulesetRulesActionParametersOverridesDataSourceModel] `tfsdk:"overrides" json:"overrides,computed"` + FromList customfield.NestedObject[RulesetRulesActionParametersFromListDataSourceModel] `tfsdk:"from_list" json:"from_list,computed"` + FromValue customfield.NestedObject[RulesetRulesActionParametersFromValueDataSourceModel] `tfsdk:"from_value" json:"from_value,computed"` + Headers customfield.NestedObjectMap[RulesetRulesActionParametersHeadersDataSourceModel] `tfsdk:"headers" json:"headers,computed"` + URI customfield.NestedObject[RulesetRulesActionParametersURIDataSourceModel] `tfsdk:"uri" json:"uri,computed"` + HostHeader types.String `tfsdk:"host_header" json:"host_header,computed"` + Origin customfield.NestedObject[RulesetRulesActionParametersOriginDataSourceModel] `tfsdk:"origin" json:"origin,computed"` + SNI customfield.NestedObject[RulesetRulesActionParametersSNIDataSourceModel] `tfsdk:"sni" json:"sni,computed"` + Increment types.Int64 `tfsdk:"increment" json:"increment,computed"` + Content types.String `tfsdk:"content" json:"content,computed"` + ContentType types.String `tfsdk:"content_type" json:"content_type,computed"` + StatusCode types.Float64 `tfsdk:"status_code" json:"status_code,computed"` + AutomaticHTTPSRewrites types.Bool `tfsdk:"automatic_https_rewrites" json:"automatic_https_rewrites,computed"` + Autominify customfield.NestedObject[RulesetRulesActionParametersAutominifyDataSourceModel] `tfsdk:"autominify" json:"autominify,computed"` + BIC types.Bool `tfsdk:"bic" json:"bic,computed"` + DisableApps types.Bool `tfsdk:"disable_apps" json:"disable_apps,computed"` + DisableRUM types.Bool `tfsdk:"disable_rum" json:"disable_rum,computed"` + DisableZaraz types.Bool `tfsdk:"disable_zaraz" json:"disable_zaraz,computed"` + EmailObfuscation types.Bool `tfsdk:"email_obfuscation" json:"email_obfuscation,computed"` + Fonts types.Bool `tfsdk:"fonts" json:"fonts,computed"` + HotlinkProtection types.Bool `tfsdk:"hotlink_protection" json:"hotlink_protection,computed"` + Mirage types.Bool `tfsdk:"mirage" json:"mirage,computed"` + OpportunisticEncryption types.Bool `tfsdk:"opportunistic_encryption" json:"opportunistic_encryption,computed"` + Polish types.String `tfsdk:"polish" json:"polish,computed"` + RocketLoader types.Bool `tfsdk:"rocket_loader" json:"rocket_loader,computed"` + SecurityLevel types.String `tfsdk:"security_level" json:"security_level,computed"` + ServerSideExcludes types.Bool `tfsdk:"server_side_excludes" json:"server_side_excludes,computed"` + SSL types.String `tfsdk:"ssl" json:"ssl,computed"` + SXG types.Bool `tfsdk:"sxg" json:"sxg,computed"` + Phases customfield.List[types.String] `tfsdk:"phases" json:"phases,computed"` + Products customfield.List[types.String] `tfsdk:"products" json:"products,computed"` + Rules customfield.Map[customfield.List[types.String]] `tfsdk:"rules" json:"rules,computed"` + Ruleset types.String `tfsdk:"ruleset" json:"ruleset,computed"` + Rulesets customfield.List[types.String] `tfsdk:"rulesets" json:"rulesets,computed"` + AdditionalCacheablePorts customfield.List[types.Int64] `tfsdk:"additional_cacheable_ports" json:"additional_cacheable_ports,computed"` + BrowserTTL customfield.NestedObject[RulesetRulesActionParametersBrowserTTLDataSourceModel] `tfsdk:"browser_ttl" json:"browser_ttl,computed"` + Cache types.Bool `tfsdk:"cache" json:"cache,computed"` + CacheKey customfield.NestedObject[RulesetRulesActionParametersCacheKeyDataSourceModel] `tfsdk:"cache_key" json:"cache_key,computed"` + CacheReserve customfield.NestedObject[RulesetRulesActionParametersCacheReserveDataSourceModel] `tfsdk:"cache_reserve" json:"cache_reserve,computed"` + EdgeTTL customfield.NestedObject[RulesetRulesActionParametersEdgeTTLDataSourceModel] `tfsdk:"edge_ttl" json:"edge_ttl,computed"` + OriginCacheControl types.Bool `tfsdk:"origin_cache_control" json:"origin_cache_control,computed"` + OriginErrorPagePassthru types.Bool `tfsdk:"origin_error_page_passthru" json:"origin_error_page_passthru,computed"` + ReadTimeout types.Int64 `tfsdk:"read_timeout" json:"read_timeout,computed"` + RespectStrongEtags types.Bool `tfsdk:"respect_strong_etags" json:"respect_strong_etags,computed"` + ServeStale customfield.NestedObject[RulesetRulesActionParametersServeStaleDataSourceModel] `tfsdk:"serve_stale" json:"serve_stale,computed"` + CookieFields customfield.NestedObjectList[RulesetRulesActionParametersCookieFieldsDataSourceModel] `tfsdk:"cookie_fields" json:"cookie_fields,computed"` + RawResponseFields customfield.NestedObjectList[RulesetRulesActionParametersRawResponseFieldsDataSourceModel] `tfsdk:"raw_response_fields" json:"raw_response_fields,computed"` + RequestFields customfield.NestedObjectList[RulesetRulesActionParametersRequestFieldsDataSourceModel] `tfsdk:"request_fields" json:"request_fields,computed"` + ResponseFields customfield.NestedObjectList[RulesetRulesActionParametersResponseFieldsDataSourceModel] `tfsdk:"response_fields" json:"response_fields,computed"` + TransformedRequestFields customfield.NestedObjectList[RulesetRulesActionParametersTransformedRequestFieldsDataSourceModel] `tfsdk:"transformed_request_fields" json:"transformed_request_fields,computed"` } type RulesetRulesActionParametersResponseDataSourceModel struct { @@ -297,11 +299,21 @@ type RulesetRulesActionParametersCookieFieldsDataSourceModel struct { Name types.String `tfsdk:"name" json:"name,computed"` } +type RulesetRulesActionParametersRawResponseFieldsDataSourceModel struct { + Name types.String `tfsdk:"name" json:"name,computed"` + PreserveDuplicates types.Bool `tfsdk:"preserve_duplicates" json:"preserve_duplicates,computed"` +} + type RulesetRulesActionParametersRequestFieldsDataSourceModel struct { Name types.String `tfsdk:"name" json:"name,computed"` } type RulesetRulesActionParametersResponseFieldsDataSourceModel struct { + Name types.String `tfsdk:"name" json:"name,computed"` + PreserveDuplicates types.Bool `tfsdk:"preserve_duplicates" json:"preserve_duplicates,computed"` +} + +type RulesetRulesActionParametersTransformedRequestFieldsDataSourceModel struct { Name types.String `tfsdk:"name" json:"name,computed"` } diff --git a/internal/services/ruleset/data_source_schema.go b/internal/services/ruleset/data_source_schema.go index 9a8b26a58c..457ebe1196 100644 --- a/internal/services/ruleset/data_source_schema.go +++ b/internal/services/ruleset/data_source_schema.go @@ -45,7 +45,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "kind": schema.StringAttribute{ - Description: "The kind of the ruleset.", + Description: "The kind of the ruleset.\nAvailable values: \"managed\", \"custom\", \"root\", \"zone\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -61,7 +61,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "phase": schema.StringAttribute{ - Description: "The phase of the ruleset.", + Description: "The phase of the ruleset.\nAvailable values: \"ddos_l4\", \"ddos_l7\", \"http_config_settings\", \"http_custom_errors\", \"http_log_custom_fields\", \"http_ratelimit\", \"http_request_cache_settings\", \"http_request_dynamic_redirect\", \"http_request_firewall_custom\", \"http_request_firewall_managed\", \"http_request_late_transform\", \"http_request_origin\", \"http_request_redirect\", \"http_request_sanitize\", \"http_request_sbfm\", \"http_request_transform\", \"http_response_compression\", \"http_response_firewall_managed\", \"http_response_headers_transform\", \"magic_transit\", \"magic_transit_ids_managed\", \"magic_transit_managed\", \"magic_transit_ratelimit\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -102,7 +102,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "action": schema.StringAttribute{ - Description: "The action to perform when the rule matches.", + Description: "The action to perform when the rule matches.\nAvailable values: \"block\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -161,7 +161,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "name": schema.StringAttribute{ - Description: "Name of compression algorithm to enable.", + Description: "Name of compression algorithm to enable.\nAvailable values: \"none\", \"auto\", \"default\", \"gzip\", \"brotli\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -219,7 +219,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "sensitivity_level": schema.StringAttribute{ - Description: "The sensitivity level to use for rules in the category.", + Description: "The sensitivity level to use for rules in the category.\nAvailable values: \"default\", \"medium\", \"low\", \"eoff\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -260,7 +260,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "sensitivity_level": schema.StringAttribute{ - Description: "The sensitivity level to use for the rule.", + Description: "The sensitivity level to use for the rule.\nAvailable values: \"default\", \"medium\", \"low\", \"eoff\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -275,7 +275,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "sensitivity_level": schema.StringAttribute{ - Description: "A sensitivity level to set for all rules. This option has lower precedence than rule and category overrides and is only applicable for DDoS phases.", + Description: "A sensitivity level to set for all rules. This option has lower precedence than rule and category overrides and is only applicable for DDoS phases.\nAvailable values: \"default\", \"medium\", \"low\", \"eoff\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -313,7 +313,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status_code": schema.Float64Attribute{ - Description: "The status code to be used for the redirect.", + Description: "The status code to be used for the redirect.\nAvailable values: 301, 302, 303, 307, 308.", Computed: true, Validators: []validator.Float64{ float64validator.OneOf( @@ -349,7 +349,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "operation": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"remove\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("remove", "set"), }, @@ -444,7 +445,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "content_type": schema.StringAttribute{ - Description: "Content-type header to set with the response.", + Description: "Content-type header to set with the response.\nAvailable values: \"application/json\", \"text/xml\", \"text/plain\", \"text/html\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -522,7 +523,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "polish": schema.StringAttribute{ - Description: "Configure the Polish level.", + Description: "Configure the Polish level.\nAvailable values: \"off\", \"lossless\", \"lossy\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -537,7 +538,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "security_level": schema.StringAttribute{ - Description: "Configure the Security Level.", + Description: "Configure the Security Level.\nAvailable values: \"off\", \"essentially_off\", \"low\", \"medium\", \"high\", \"under_attack\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -555,7 +556,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "ssl": schema.StringAttribute{ - Description: "Configure the SSL level.", + Description: "Configure the SSL level.\nAvailable values: \"off\", \"flexible\", \"full\", \"strict\", \"origin_pull\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -634,7 +635,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "ruleset": schema.StringAttribute{ - Description: "A ruleset to skip the execution of. This option is incompatible with the rulesets, rules and phases options.", + Description: "A ruleset to skip the execution of. This option is incompatible with the rulesets, rules and phases options.\nAvailable values: \"current\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("current"), @@ -658,7 +659,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersBrowserTTLDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "mode": schema.StringAttribute{ - Description: "Determines which browser ttl mode to use.", + Description: "Determines which browser ttl mode to use.\nAvailable values: \"respect_origin\", \"bypass_by_default\", \"override_origin\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -851,7 +852,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "mode": schema.StringAttribute{ - Description: "edge ttl options", + Description: "edge ttl options\nAvailable values: \"respect_origin\", \"bypass_by_default\", \"override_origin\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -935,8 +936,25 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, }, + "raw_response_fields": schema.ListNestedAttribute{ + Description: "The raw response fields to log.", + Computed: true, + CustomType: customfield.NewNestedObjectListType[RulesetRulesActionParametersRawResponseFieldsDataSourceModel](ctx), + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "name": schema.StringAttribute{ + Description: "The name of the field.", + Computed: true, + }, + "preserve_duplicates": schema.BoolAttribute{ + Description: "Whether to log duplicate values of the same header.", + Computed: true, + }, + }, + }, + }, "request_fields": schema.ListNestedAttribute{ - Description: "The request fields to log.", + Description: "The raw request fields to log.", Computed: true, CustomType: customfield.NewNestedObjectListType[RulesetRulesActionParametersRequestFieldsDataSourceModel](ctx), NestedObject: schema.NestedAttributeObject{ @@ -949,9 +967,26 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "response_fields": schema.ListNestedAttribute{ - Description: "The response fields to log.", + Description: "The transformed response fields to log.", Computed: true, CustomType: customfield.NewNestedObjectListType[RulesetRulesActionParametersResponseFieldsDataSourceModel](ctx), + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "name": schema.StringAttribute{ + Description: "The name of the field.", + Computed: true, + }, + "preserve_duplicates": schema.BoolAttribute{ + Description: "Whether to log duplicate values of the same header.", + Computed: true, + }, + }, + }, + }, + "transformed_request_fields": schema.ListNestedAttribute{ + Description: "The transformed request fields to log.", + Computed: true, + CustomType: customfield.NewNestedObjectListType[RulesetRulesActionParametersTransformedRequestFieldsDataSourceModel](ctx), NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "name": schema.StringAttribute{ @@ -1019,7 +1054,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "period": schema.Int64Attribute{ - Description: "Period in seconds over which the counter is being incremented.", + Description: "Period in seconds over which the counter is being incremented.\nAvailable values: 10, 60, 600, 3600.", Computed: true, Validators: []validator.Int64{ int64validator.OneOf( diff --git a/internal/services/ruleset/data_source_test.go b/internal/services/ruleset/data_source_test.go index 20040fa77e..ead6890fe4 100644 --- a/internal/services/ruleset/data_source_test.go +++ b/internal/services/ruleset/data_source_test.go @@ -2,14 +2,12 @@ package ruleset_test import ( "fmt" - "os" "regexp" "testing" "github.com/cloudflare/terraform-provider-cloudflare/internal/acctest" "github.com/cloudflare/terraform-provider-cloudflare/internal/utils" "github.com/hashicorp/terraform-plugin-testing/helper/resource" - "github.com/hashicorp/terraform-plugin-testing/terraform" ) func TestAccCloudflareRulesetsProviderDataSource_PreventZoneIdAndAccountIdConflicts(t *testing.T) { @@ -20,7 +18,7 @@ func TestAccCloudflareRulesetsProviderDataSource_PreventZoneIdAndAccountIdConfli Steps: []resource.TestStep{ { Config: testCloudflareRulesetsProviderDataSourceConfigConflictingFields(rnd), - ExpectError: regexp.MustCompile(regexp.QuoteMeta("only one of `account_id,zone_id` can be specified")), + ExpectError: regexp.MustCompile(regexp.QuoteMeta("Exactly one of these attributes must be configured")), }, }, }) @@ -43,7 +41,7 @@ func TestAccCloudflareRulesetsProviderDataSource_RequireOneOfZoneAccountID(t *te Steps: []resource.TestStep{ { Config: testCloudflareRulesetsProviderDataSourceRequireOneOfZoneAccountID(rnd), - ExpectError: regexp.MustCompile(regexp.QuoteMeta("one of `account_id,zone_id` must be specified")), + ExpectError: regexp.MustCompile(regexp.QuoteMeta("Exactly one of these attributes must be configured")), }, }, }) @@ -55,82 +53,3 @@ data "cloudflare_rulesets" "%[1]s" { } `, rnd) } - -func TestAccCloudflareRulesetsProviderDataSource_FetchOWASPRulesetByName(t *testing.T) { - rnd := utils.GenerateRandomResourceName() - zoneID := os.Getenv("CLOUDFLARE_ZONE_ID") - name := fmt.Sprintf("data.cloudflare_rulesets.%s", rnd) - - resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.TestAccPreCheck(t) }, - ProtoV6ProviderFactories: acctest.TestAccProtoV6ProviderFactories, - Steps: []resource.TestStep{ - { - Config: testCloudflareRulesetsProviderDataSourceFetchOWASPRulesetByName(rnd, zoneID), - Check: resource.ComposeTestCheckFunc( - testAccCheckCloudflareRulesetsDataSourceID(name), - resource.TestCheckResourceAttr(name, "rulesets.0.name", "Cloudflare OWASP Core Ruleset"), - ), - }, - }, - }) -} - -func testCloudflareRulesetsProviderDataSourceFetchOWASPRulesetByName(rnd string, zoneID string) string { - return fmt.Sprintf(` -data "cloudflare_rulesets" "%[1]s" { - zone_id = "%[2]s" - - filter { - name = ".*OWASP.*" - } -} -`, rnd, zoneID) -} - -func TestAccCloudflareRulesetsProviderDataSource_FetchOWASPRulesetByID(t *testing.T) { - rnd := utils.GenerateRandomResourceName() - zoneID := os.Getenv("CLOUDFLARE_ZONE_ID") - name := fmt.Sprintf("data.cloudflare_rulesets.%s", rnd) - - resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.TestAccPreCheck(t) }, - ProtoV6ProviderFactories: acctest.TestAccProtoV6ProviderFactories, - Steps: []resource.TestStep{ - { - Config: testCloudflareRulesetsProviderDataSourceFetchOWASPRulesetByID(rnd, zoneID), - Check: resource.ComposeTestCheckFunc( - testAccCheckCloudflareRulesetsDataSourceID(name), - resource.TestCheckResourceAttr(name, "rulesets.0.name", "Cloudflare OWASP Core Ruleset"), - ), - }, - }, - }) -} - -func testCloudflareRulesetsProviderDataSourceFetchOWASPRulesetByID(rnd string, zoneID string) string { - return fmt.Sprintf(` -data "cloudflare_rulesets" "%[1]s" { - zone_id = "%[2]s" - - filter { - id = "4814384a9e5d4991b9815dcfc25d2f1f" - } -} -`, rnd, zoneID) -} - -func testAccCheckCloudflareRulesetsDataSourceID(n string) resource.TestCheckFunc { - return func(s *terraform.State) error { - all := s.RootModule().Resources - rs, ok := all[n] - if !ok { - return fmt.Errorf("can't find Rulesets data source: %s", n) - } - - if rs.Primary.ID == "" { - return fmt.Errorf("Snapshot Rulesets source ID not set") - } - return nil - } -} diff --git a/internal/services/ruleset/list_data_source_schema.go b/internal/services/ruleset/list_data_source_schema.go index 9938631311..48a04bb302 100644 --- a/internal/services/ruleset/list_data_source_schema.go +++ b/internal/services/ruleset/list_data_source_schema.go @@ -46,7 +46,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "kind": schema.StringAttribute{ - Description: "The kind of the ruleset.", + Description: "The kind of the ruleset.\nAvailable values: \"managed\", \"custom\", \"root\", \"zone\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -62,7 +62,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "phase": schema.StringAttribute{ - Description: "The phase of the ruleset.", + Description: "The phase of the ruleset.\nAvailable values: \"ddos_l4\", \"ddos_l7\", \"http_config_settings\", \"http_custom_errors\", \"http_log_custom_fields\", \"http_ratelimit\", \"http_request_cache_settings\", \"http_request_dynamic_redirect\", \"http_request_firewall_custom\", \"http_request_firewall_managed\", \"http_request_late_transform\", \"http_request_origin\", \"http_request_redirect\", \"http_request_sanitize\", \"http_request_sbfm\", \"http_request_transform\", \"http_response_compression\", \"http_response_firewall_managed\", \"http_response_headers_transform\", \"magic_transit\", \"magic_transit_ids_managed\", \"magic_transit_managed\", \"magic_transit_ratelimit\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/ruleset/model.go b/internal/services/ruleset/model.go index 19c006add1..284336ce36 100644 --- a/internal/services/ruleset/model.go +++ b/internal/services/ruleset/model.go @@ -13,14 +13,14 @@ type RulesetResultEnvelope struct { } type RulesetModel struct { - ID types.String `tfsdk:"id" json:"id,computed"` - AccountID types.String `tfsdk:"account_id" path:"account_id,optional"` - ZoneID types.String `tfsdk:"zone_id" path:"zone_id,optional"` - Kind types.String `tfsdk:"kind" json:"kind,required"` - Name types.String `tfsdk:"name" json:"name,required"` - Phase types.String `tfsdk:"phase" json:"phase,required"` - Rules *[]*RulesetRulesModel `tfsdk:"rules" json:"rules,required"` - Description types.String `tfsdk:"description" json:"description,computed_optional"` + ID types.String `tfsdk:"id" json:"id,computed"` + AccountID types.String `tfsdk:"account_id" path:"account_id,optional"` + ZoneID types.String `tfsdk:"zone_id" path:"zone_id,optional"` + Kind types.String `tfsdk:"kind" json:"kind,required"` + Name types.String `tfsdk:"name" json:"name,required"` + Phase types.String `tfsdk:"phase" json:"phase,required"` + Description types.String `tfsdk:"description" json:"description,computed_optional"` + Rules customfield.NestedObjectList[RulesetRulesModel] `tfsdk:"rules" json:"rules,computed_optional"` } func (m RulesetModel) MarshalJSON() (data []byte, err error) { @@ -32,72 +32,74 @@ func (m RulesetModel) MarshalJSONForUpdate(state RulesetModel) (data []byte, err } type RulesetRulesModel struct { - ID types.String `tfsdk:"id" json:"id,computed"` - Action types.String `tfsdk:"action" json:"action,optional"` - ActionParameters *RulesetRulesActionParametersModel `tfsdk:"action_parameters" json:"action_parameters,optional"` - Categories customfield.List[types.String] `tfsdk:"categories" json:"categories,computed"` - Description types.String `tfsdk:"description" json:"description,computed_optional"` - Enabled types.Bool `tfsdk:"enabled" json:"enabled,computed_optional"` - ExposedCredentialCheck *RulesetRulesExposedCredentialCheckModel `tfsdk:"exposed_credential_check" json:"exposed_credential_check,optional"` - Expression types.String `tfsdk:"expression" json:"expression,optional"` - Logging *RulesetRulesLoggingModel `tfsdk:"logging" json:"logging,optional"` - Ratelimit *RulesetRulesRatelimitModel `tfsdk:"ratelimit" json:"ratelimit,optional"` - Ref types.String `tfsdk:"ref" json:"ref,computed_optional"` + ID types.String `tfsdk:"id" json:"id,computed"` + Action types.String `tfsdk:"action" json:"action,optional"` + ActionParameters customfield.NestedObject[RulesetRulesActionParametersModel] `tfsdk:"action_parameters" json:"action_parameters,computed_optional"` + Categories customfield.List[types.String] `tfsdk:"categories" json:"categories,computed"` + Description types.String `tfsdk:"description" json:"description,computed_optional"` + Enabled types.Bool `tfsdk:"enabled" json:"enabled,computed_optional"` + ExposedCredentialCheck customfield.NestedObject[RulesetRulesExposedCredentialCheckModel] `tfsdk:"exposed_credential_check" json:"exposed_credential_check,computed_optional"` + Expression types.String `tfsdk:"expression" json:"expression,optional"` + Logging customfield.NestedObject[RulesetRulesLoggingModel] `tfsdk:"logging" json:"logging,computed_optional"` + Ratelimit customfield.NestedObject[RulesetRulesRatelimitModel] `tfsdk:"ratelimit" json:"ratelimit,computed_optional"` + Ref types.String `tfsdk:"ref" json:"ref,computed_optional"` } type RulesetRulesActionParametersModel struct { - Response *RulesetRulesActionParametersResponseModel `tfsdk:"response" json:"response,optional"` - Algorithms *[]*RulesetRulesActionParametersAlgorithmsModel `tfsdk:"algorithms" json:"algorithms,optional"` - ID types.String `tfsdk:"id" json:"id,optional"` - MatchedData *RulesetRulesActionParametersMatchedDataModel `tfsdk:"matched_data" json:"matched_data,optional"` - Overrides *RulesetRulesActionParametersOverridesModel `tfsdk:"overrides" json:"overrides,optional"` - FromList *RulesetRulesActionParametersFromListModel `tfsdk:"from_list" json:"from_list,optional"` - FromValue *RulesetRulesActionParametersFromValueModel `tfsdk:"from_value" json:"from_value,optional"` - Headers *map[string]RulesetRulesActionParametersHeadersModel `tfsdk:"headers" json:"headers,optional"` - URI *RulesetRulesActionParametersURIModel `tfsdk:"uri" json:"uri,optional"` - HostHeader types.String `tfsdk:"host_header" json:"host_header,optional"` - Origin *RulesetRulesActionParametersOriginModel `tfsdk:"origin" json:"origin,optional"` - SNI *RulesetRulesActionParametersSNIModel `tfsdk:"sni" json:"sni,optional"` - Increment types.Int64 `tfsdk:"increment" json:"increment,optional"` - Content types.String `tfsdk:"content" json:"content,optional"` - ContentType types.String `tfsdk:"content_type" json:"content_type,optional"` - StatusCode types.Float64 `tfsdk:"status_code" json:"status_code,optional"` - AutomaticHTTPSRewrites types.Bool `tfsdk:"automatic_https_rewrites" json:"automatic_https_rewrites,optional"` - Autominify *RulesetRulesActionParametersAutominifyModel `tfsdk:"autominify" json:"autominify,optional"` - BIC types.Bool `tfsdk:"bic" json:"bic,optional"` - DisableApps types.Bool `tfsdk:"disable_apps" json:"disable_apps,optional"` - DisableRUM types.Bool `tfsdk:"disable_rum" json:"disable_rum,optional"` - DisableZaraz types.Bool `tfsdk:"disable_zaraz" json:"disable_zaraz,optional"` - EmailObfuscation types.Bool `tfsdk:"email_obfuscation" json:"email_obfuscation,optional"` - Fonts types.Bool `tfsdk:"fonts" json:"fonts,optional"` - HotlinkProtection types.Bool `tfsdk:"hotlink_protection" json:"hotlink_protection,optional"` - Mirage types.Bool `tfsdk:"mirage" json:"mirage,optional"` - OpportunisticEncryption types.Bool `tfsdk:"opportunistic_encryption" json:"opportunistic_encryption,optional"` - Polish types.String `tfsdk:"polish" json:"polish,optional"` - RocketLoader types.Bool `tfsdk:"rocket_loader" json:"rocket_loader,optional"` - SecurityLevel types.String `tfsdk:"security_level" json:"security_level,optional"` - ServerSideExcludes types.Bool `tfsdk:"server_side_excludes" json:"server_side_excludes,optional"` - SSL types.String `tfsdk:"ssl" json:"ssl,optional"` - SXG types.Bool `tfsdk:"sxg" json:"sxg,optional"` - Phases *[]types.String `tfsdk:"phases" json:"phases,optional"` - Products *[]types.String `tfsdk:"products" json:"products,optional"` - Rules customfield.Map[customfield.List[types.String]] `tfsdk:"rules" json:"rules,optional"` - Ruleset types.String `tfsdk:"ruleset" json:"ruleset,optional"` - Rulesets *[]types.String `tfsdk:"rulesets" json:"rulesets,optional"` - AdditionalCacheablePorts *[]types.Int64 `tfsdk:"additional_cacheable_ports" json:"additional_cacheable_ports,optional"` - BrowserTTL *RulesetRulesActionParametersBrowserTTLModel `tfsdk:"browser_ttl" json:"browser_ttl,optional"` - Cache types.Bool `tfsdk:"cache" json:"cache,optional"` - CacheKey *RulesetRulesActionParametersCacheKeyModel `tfsdk:"cache_key" json:"cache_key,optional"` - CacheReserve *RulesetRulesActionParametersCacheReserveModel `tfsdk:"cache_reserve" json:"cache_reserve,optional"` - EdgeTTL *RulesetRulesActionParametersEdgeTTLModel `tfsdk:"edge_ttl" json:"edge_ttl,optional"` - OriginCacheControl types.Bool `tfsdk:"origin_cache_control" json:"origin_cache_control,optional"` - OriginErrorPagePassthru types.Bool `tfsdk:"origin_error_page_passthru" json:"origin_error_page_passthru,optional"` - ReadTimeout types.Int64 `tfsdk:"read_timeout" json:"read_timeout,optional"` - RespectStrongEtags types.Bool `tfsdk:"respect_strong_etags" json:"respect_strong_etags,optional"` - ServeStale *RulesetRulesActionParametersServeStaleModel `tfsdk:"serve_stale" json:"serve_stale,optional"` - CookieFields *[]*RulesetRulesActionParametersCookieFieldsModel `tfsdk:"cookie_fields" json:"cookie_fields,optional"` - RequestFields *[]*RulesetRulesActionParametersRequestFieldsModel `tfsdk:"request_fields" json:"request_fields,optional"` - ResponseFields *[]*RulesetRulesActionParametersResponseFieldsModel `tfsdk:"response_fields" json:"response_fields,optional"` + Response customfield.NestedObject[RulesetRulesActionParametersResponseModel] `tfsdk:"response" json:"response,computed_optional"` + Algorithms customfield.NestedObjectList[RulesetRulesActionParametersAlgorithmsModel] `tfsdk:"algorithms" json:"algorithms,computed_optional"` + ID types.String `tfsdk:"id" json:"id,optional"` + MatchedData customfield.NestedObject[RulesetRulesActionParametersMatchedDataModel] `tfsdk:"matched_data" json:"matched_data,computed_optional"` + Overrides customfield.NestedObject[RulesetRulesActionParametersOverridesModel] `tfsdk:"overrides" json:"overrides,computed_optional"` + FromList customfield.NestedObject[RulesetRulesActionParametersFromListModel] `tfsdk:"from_list" json:"from_list,computed_optional"` + FromValue customfield.NestedObject[RulesetRulesActionParametersFromValueModel] `tfsdk:"from_value" json:"from_value,computed_optional"` + Headers customfield.NestedObjectMap[RulesetRulesActionParametersHeadersModel] `tfsdk:"headers" json:"headers,computed_optional"` + URI customfield.NestedObject[RulesetRulesActionParametersURIModel] `tfsdk:"uri" json:"uri,computed_optional"` + HostHeader types.String `tfsdk:"host_header" json:"host_header,optional"` + Origin customfield.NestedObject[RulesetRulesActionParametersOriginModel] `tfsdk:"origin" json:"origin,computed_optional"` + SNI customfield.NestedObject[RulesetRulesActionParametersSNIModel] `tfsdk:"sni" json:"sni,computed_optional"` + Increment types.Int64 `tfsdk:"increment" json:"increment,optional"` + Content types.String `tfsdk:"content" json:"content,optional"` + ContentType types.String `tfsdk:"content_type" json:"content_type,optional"` + StatusCode types.Float64 `tfsdk:"status_code" json:"status_code,optional"` + AutomaticHTTPSRewrites types.Bool `tfsdk:"automatic_https_rewrites" json:"automatic_https_rewrites,optional"` + Autominify customfield.NestedObject[RulesetRulesActionParametersAutominifyModel] `tfsdk:"autominify" json:"autominify,computed_optional"` + BIC types.Bool `tfsdk:"bic" json:"bic,optional"` + DisableApps types.Bool `tfsdk:"disable_apps" json:"disable_apps,optional"` + DisableRUM types.Bool `tfsdk:"disable_rum" json:"disable_rum,optional"` + DisableZaraz types.Bool `tfsdk:"disable_zaraz" json:"disable_zaraz,optional"` + EmailObfuscation types.Bool `tfsdk:"email_obfuscation" json:"email_obfuscation,optional"` + Fonts types.Bool `tfsdk:"fonts" json:"fonts,optional"` + HotlinkProtection types.Bool `tfsdk:"hotlink_protection" json:"hotlink_protection,optional"` + Mirage types.Bool `tfsdk:"mirage" json:"mirage,optional"` + OpportunisticEncryption types.Bool `tfsdk:"opportunistic_encryption" json:"opportunistic_encryption,optional"` + Polish types.String `tfsdk:"polish" json:"polish,optional"` + RocketLoader types.Bool `tfsdk:"rocket_loader" json:"rocket_loader,optional"` + SecurityLevel types.String `tfsdk:"security_level" json:"security_level,optional"` + ServerSideExcludes types.Bool `tfsdk:"server_side_excludes" json:"server_side_excludes,optional"` + SSL types.String `tfsdk:"ssl" json:"ssl,optional"` + SXG types.Bool `tfsdk:"sxg" json:"sxg,optional"` + Phases *[]types.String `tfsdk:"phases" json:"phases,optional"` + Products *[]types.String `tfsdk:"products" json:"products,optional"` + Rules *map[string]*[]types.String `tfsdk:"rules" json:"rules,optional"` + Ruleset types.String `tfsdk:"ruleset" json:"ruleset,optional"` + Rulesets *[]types.String `tfsdk:"rulesets" json:"rulesets,optional"` + AdditionalCacheablePorts *[]types.Int64 `tfsdk:"additional_cacheable_ports" json:"additional_cacheable_ports,optional"` + BrowserTTL customfield.NestedObject[RulesetRulesActionParametersBrowserTTLModel] `tfsdk:"browser_ttl" json:"browser_ttl,computed_optional"` + Cache types.Bool `tfsdk:"cache" json:"cache,optional"` + CacheKey customfield.NestedObject[RulesetRulesActionParametersCacheKeyModel] `tfsdk:"cache_key" json:"cache_key,computed_optional"` + CacheReserve customfield.NestedObject[RulesetRulesActionParametersCacheReserveModel] `tfsdk:"cache_reserve" json:"cache_reserve,computed_optional"` + EdgeTTL customfield.NestedObject[RulesetRulesActionParametersEdgeTTLModel] `tfsdk:"edge_ttl" json:"edge_ttl,computed_optional"` + OriginCacheControl types.Bool `tfsdk:"origin_cache_control" json:"origin_cache_control,optional"` + OriginErrorPagePassthru types.Bool `tfsdk:"origin_error_page_passthru" json:"origin_error_page_passthru,optional"` + ReadTimeout types.Int64 `tfsdk:"read_timeout" json:"read_timeout,optional"` + RespectStrongEtags types.Bool `tfsdk:"respect_strong_etags" json:"respect_strong_etags,optional"` + ServeStale customfield.NestedObject[RulesetRulesActionParametersServeStaleModel] `tfsdk:"serve_stale" json:"serve_stale,computed_optional"` + CookieFields customfield.NestedObjectList[RulesetRulesActionParametersCookieFieldsModel] `tfsdk:"cookie_fields" json:"cookie_fields,computed_optional"` + RawResponseFields customfield.NestedObjectList[RulesetRulesActionParametersRawResponseFieldsModel] `tfsdk:"raw_response_fields" json:"raw_response_fields,computed_optional"` + RequestFields customfield.NestedObjectList[RulesetRulesActionParametersRequestFieldsModel] `tfsdk:"request_fields" json:"request_fields,computed_optional"` + ResponseFields customfield.NestedObjectList[RulesetRulesActionParametersResponseFieldsModel] `tfsdk:"response_fields" json:"response_fields,computed_optional"` + TransformedRequestFields customfield.NestedObjectList[RulesetRulesActionParametersTransformedRequestFieldsModel] `tfsdk:"transformed_request_fields" json:"transformed_request_fields,computed_optional"` } type RulesetRulesActionParametersResponseModel struct { @@ -115,11 +117,11 @@ type RulesetRulesActionParametersMatchedDataModel struct { } type RulesetRulesActionParametersOverridesModel struct { - Action types.String `tfsdk:"action" json:"action,optional"` - Categories *[]*RulesetRulesActionParametersOverridesCategoriesModel `tfsdk:"categories" json:"categories,optional"` - Enabled types.Bool `tfsdk:"enabled" json:"enabled,optional"` - Rules *[]*RulesetRulesActionParametersOverridesRulesModel `tfsdk:"rules" json:"rules,optional"` - SensitivityLevel types.String `tfsdk:"sensitivity_level" json:"sensitivity_level,optional"` + Action types.String `tfsdk:"action" json:"action,optional"` + Categories customfield.NestedObjectList[RulesetRulesActionParametersOverridesCategoriesModel] `tfsdk:"categories" json:"categories,computed_optional"` + Enabled types.Bool `tfsdk:"enabled" json:"enabled,optional"` + Rules customfield.NestedObjectList[RulesetRulesActionParametersOverridesRulesModel] `tfsdk:"rules" json:"rules,computed_optional"` + SensitivityLevel types.String `tfsdk:"sensitivity_level" json:"sensitivity_level,optional"` } type RulesetRulesActionParametersOverridesCategoriesModel struct { @@ -143,9 +145,9 @@ type RulesetRulesActionParametersFromListModel struct { } type RulesetRulesActionParametersFromValueModel struct { - PreserveQueryString types.Bool `tfsdk:"preserve_query_string" json:"preserve_query_string,optional"` - StatusCode types.Float64 `tfsdk:"status_code" json:"status_code,optional"` - TargetURL *RulesetRulesActionParametersFromValueTargetURLModel `tfsdk:"target_url" json:"target_url,optional"` + PreserveQueryString types.Bool `tfsdk:"preserve_query_string" json:"preserve_query_string,optional"` + StatusCode types.Float64 `tfsdk:"status_code" json:"status_code,optional"` + TargetURL customfield.NestedObject[RulesetRulesActionParametersFromValueTargetURLModel] `tfsdk:"target_url" json:"target_url,computed_optional"` } type RulesetRulesActionParametersFromValueTargetURLModel struct { @@ -160,8 +162,8 @@ type RulesetRulesActionParametersHeadersModel struct { } type RulesetRulesActionParametersURIModel struct { - Path *RulesetRulesActionParametersURIPathModel `tfsdk:"path" json:"path,optional"` - Query *RulesetRulesActionParametersURIQueryModel `tfsdk:"query" json:"query,optional"` + Path customfield.NestedObject[RulesetRulesActionParametersURIPathModel] `tfsdk:"path" json:"path,computed_optional"` + Query customfield.NestedObject[RulesetRulesActionParametersURIQueryModel] `tfsdk:"query" json:"query,computed_optional"` } type RulesetRulesActionParametersURIPathModel struct { @@ -195,18 +197,18 @@ type RulesetRulesActionParametersBrowserTTLModel struct { } type RulesetRulesActionParametersCacheKeyModel struct { - CacheByDeviceType types.Bool `tfsdk:"cache_by_device_type" json:"cache_by_device_type,optional"` - CacheDeceptionArmor types.Bool `tfsdk:"cache_deception_armor" json:"cache_deception_armor,optional"` - CustomKey *RulesetRulesActionParametersCacheKeyCustomKeyModel `tfsdk:"custom_key" json:"custom_key,optional"` - IgnoreQueryStringsOrder types.Bool `tfsdk:"ignore_query_strings_order" json:"ignore_query_strings_order,optional"` + CacheByDeviceType types.Bool `tfsdk:"cache_by_device_type" json:"cache_by_device_type,optional"` + CacheDeceptionArmor types.Bool `tfsdk:"cache_deception_armor" json:"cache_deception_armor,optional"` + CustomKey customfield.NestedObject[RulesetRulesActionParametersCacheKeyCustomKeyModel] `tfsdk:"custom_key" json:"custom_key,computed_optional"` + IgnoreQueryStringsOrder types.Bool `tfsdk:"ignore_query_strings_order" json:"ignore_query_strings_order,optional"` } type RulesetRulesActionParametersCacheKeyCustomKeyModel struct { - Cookie *RulesetRulesActionParametersCacheKeyCustomKeyCookieModel `tfsdk:"cookie" json:"cookie,optional"` - Header *RulesetRulesActionParametersCacheKeyCustomKeyHeaderModel `tfsdk:"header" json:"header,optional"` - Host *RulesetRulesActionParametersCacheKeyCustomKeyHostModel `tfsdk:"host" json:"host,optional"` - QueryString *RulesetRulesActionParametersCacheKeyCustomKeyQueryStringModel `tfsdk:"query_string" json:"query_string,optional"` - User *RulesetRulesActionParametersCacheKeyCustomKeyUserModel `tfsdk:"user" json:"user,optional"` + Cookie customfield.NestedObject[RulesetRulesActionParametersCacheKeyCustomKeyCookieModel] `tfsdk:"cookie" json:"cookie,computed_optional"` + Header customfield.NestedObject[RulesetRulesActionParametersCacheKeyCustomKeyHeaderModel] `tfsdk:"header" json:"header,computed_optional"` + Host customfield.NestedObject[RulesetRulesActionParametersCacheKeyCustomKeyHostModel] `tfsdk:"host" json:"host,computed_optional"` + QueryString customfield.NestedObject[RulesetRulesActionParametersCacheKeyCustomKeyQueryStringModel] `tfsdk:"query_string" json:"query_string,computed_optional"` + User customfield.NestedObject[RulesetRulesActionParametersCacheKeyCustomKeyUserModel] `tfsdk:"user" json:"user,computed_optional"` } type RulesetRulesActionParametersCacheKeyCustomKeyCookieModel struct { @@ -226,8 +228,8 @@ type RulesetRulesActionParametersCacheKeyCustomKeyHostModel struct { } type RulesetRulesActionParametersCacheKeyCustomKeyQueryStringModel struct { - Include *RulesetRulesActionParametersCacheKeyCustomKeyQueryStringIncludeModel `tfsdk:"include" json:"include,optional"` - Exclude *RulesetRulesActionParametersCacheKeyCustomKeyQueryStringExcludeModel `tfsdk:"exclude" json:"exclude,optional"` + Include customfield.NestedObject[RulesetRulesActionParametersCacheKeyCustomKeyQueryStringIncludeModel] `tfsdk:"include" json:"include,computed_optional"` + Exclude customfield.NestedObject[RulesetRulesActionParametersCacheKeyCustomKeyQueryStringExcludeModel] `tfsdk:"exclude" json:"exclude,computed_optional"` } type RulesetRulesActionParametersCacheKeyCustomKeyQueryStringIncludeModel struct { @@ -276,11 +278,21 @@ type RulesetRulesActionParametersCookieFieldsModel struct { Name types.String `tfsdk:"name" json:"name,required"` } +type RulesetRulesActionParametersRawResponseFieldsModel struct { + Name types.String `tfsdk:"name" json:"name,required"` + PreserveDuplicates types.Bool `tfsdk:"preserve_duplicates" json:"preserve_duplicates,computed_optional"` +} + type RulesetRulesActionParametersRequestFieldsModel struct { Name types.String `tfsdk:"name" json:"name,required"` } type RulesetRulesActionParametersResponseFieldsModel struct { + Name types.String `tfsdk:"name" json:"name,required"` + PreserveDuplicates types.Bool `tfsdk:"preserve_duplicates" json:"preserve_duplicates,computed_optional"` +} + +type RulesetRulesActionParametersTransformedRequestFieldsModel struct { Name types.String `tfsdk:"name" json:"name,required"` } diff --git a/internal/services/ruleset/resource.go b/internal/services/ruleset/resource.go index 043e2d9b3b..728dbbe7e1 100644 --- a/internal/services/ruleset/resource.go +++ b/internal/services/ruleset/resource.go @@ -189,7 +189,7 @@ func (r *RulesetResource) Read(ctx context.Context, req resource.ReadRequest, re return } bytes, _ := io.ReadAll(res.Body) - err = apijson.UnmarshalComputed(bytes, &env) + err = apijson.Unmarshal(bytes, &env) if err != nil { resp.Diagnostics.AddError("failed to deserialize http request", err.Error()) return @@ -304,13 +304,28 @@ func (r *RulesetResource) ModifyPlan(ctx context.Context, req resource.ModifyPla } ruleIDsByRef := make(map[string]types.String) - for _, rule := range *state.Rules { + + stateElements := make([]RulesetRulesModel, 0, len(state.Rules.Elements())) + diags := state.Rules.ElementsAs(ctx, &stateElements, false) + if diags != nil { + resp.Diagnostics.Append(diags...) + return + } + + for _, rule := range stateElements { if ref := rule.Ref.ValueString(); ref != "" { ruleIDsByRef[ref] = rule.ID } } - for _, rule := range *plan.Rules { + planElements := make([]RulesetRulesModel, 0, len(state.Rules.Elements())) + diags = state.Rules.ElementsAs(ctx, &planElements, false) + if diags != nil { + resp.Diagnostics.Append(diags...) + return + } + + for _, rule := range planElements { // Do nothing if the rule's ID is a known planned value. if !rule.ID.IsUnknown() { continue diff --git a/internal/services/ruleset/schema.go b/internal/services/ruleset/schema.go index ed10d40404..1d82840670 100644 --- a/internal/services/ruleset/schema.go +++ b/internal/services/ruleset/schema.go @@ -42,7 +42,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "kind": schema.StringAttribute{ - Description: "The kind of the ruleset.", + Description: "The kind of the ruleset.\nAvailable values: \"managed\", \"custom\", \"root\", \"zone\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -58,7 +58,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "phase": schema.StringAttribute{ - Description: "The phase of the ruleset.", + Description: "The phase of the ruleset.\nAvailable values: \"ddos_l4\", \"ddos_l7\", \"http_config_settings\", \"http_custom_errors\", \"http_log_custom_fields\", \"http_ratelimit\", \"http_request_cache_settings\", \"http_request_dynamic_redirect\", \"http_request_firewall_custom\", \"http_request_firewall_managed\", \"http_request_late_transform\", \"http_request_origin\", \"http_request_redirect\", \"http_request_sanitize\", \"http_request_sbfm\", \"http_request_transform\", \"http_response_compression\", \"http_response_firewall_managed\", \"http_response_headers_transform\", \"magic_transit\", \"magic_transit_ids_managed\", \"magic_transit_managed\", \"magic_transit_ratelimit\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -88,9 +88,17 @@ func ResourceSchema(ctx context.Context) schema.Schema { ), }, }, + "description": schema.StringAttribute{ + Description: "An informative description of the ruleset.", + Computed: true, + Optional: true, + Default: stringdefault.StaticString(""), + }, "rules": schema.ListNestedAttribute{ Description: "The list of rules in the ruleset.", - Required: true, + Computed: true, + Optional: true, + CustomType: customfield.NewNestedObjectListType[RulesetRulesModel](ctx), NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -98,7 +106,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "action": schema.StringAttribute{ - Description: "The action to perform when the rule matches.", + Description: "The action to perform when the rule matches.\nAvailable values: \"block\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -125,11 +133,15 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "action_parameters": schema.SingleNestedAttribute{ Description: "The parameters configuring the rule's action.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersModel](ctx), Attributes: map[string]schema.Attribute{ "response": schema.SingleNestedAttribute{ Description: "The response to show when the block is applied.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersResponseModel](ctx), Attributes: map[string]schema.Attribute{ "content": schema.StringAttribute{ Description: "The content to return.", @@ -150,11 +162,13 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "algorithms": schema.ListNestedAttribute{ Description: "Custom order for compression algorithms.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectListType[RulesetRulesActionParametersAlgorithmsModel](ctx), NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "name": schema.StringAttribute{ - Description: "Name of compression algorithm to enable.", + Description: "Name of compression algorithm to enable.\nAvailable values: \"none\", \"auto\", \"default\", \"gzip\", \"brotli\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -175,7 +189,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "matched_data": schema.SingleNestedAttribute{ Description: "The configuration to use for matched data logging.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersMatchedDataModel](ctx), Attributes: map[string]schema.Attribute{ "public_key": schema.StringAttribute{ Description: "The public key to encrypt matched data logs with.", @@ -185,7 +201,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "overrides": schema.SingleNestedAttribute{ Description: "A set of overrides to apply to the target ruleset.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersOverridesModel](ctx), Attributes: map[string]schema.Attribute{ "action": schema.StringAttribute{ Description: "An action to override all rules with. This option has lower precedence than rule and category overrides.", @@ -193,7 +211,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "categories": schema.ListNestedAttribute{ Description: "A list of category-level overrides. This option has the second-highest precedence after rule-level overrides.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectListType[RulesetRulesActionParametersOverridesCategoriesModel](ctx), NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "category": schema.StringAttribute{ @@ -209,7 +229,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "sensitivity_level": schema.StringAttribute{ - Description: "The sensitivity level to use for rules in the category.", + Description: "The sensitivity level to use for rules in the category.\nAvailable values: \"default\", \"medium\", \"low\", \"eoff\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -229,7 +249,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "rules": schema.ListNestedAttribute{ Description: "A list of rule-level overrides. This option has the highest precedence.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectListType[RulesetRulesActionParametersOverridesRulesModel](ctx), NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -249,7 +271,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "sensitivity_level": schema.StringAttribute{ - Description: "The sensitivity level to use for the rule.", + Description: "The sensitivity level to use for the rule.\nAvailable values: \"default\", \"medium\", \"low\", \"eoff\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -264,7 +286,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "sensitivity_level": schema.StringAttribute{ - Description: "A sensitivity level to set for all rules. This option has lower precedence than rule and category overrides and is only applicable for DDoS phases.", + Description: "A sensitivity level to set for all rules. This option has lower precedence than rule and category overrides and is only applicable for DDoS phases.\nAvailable values: \"default\", \"medium\", \"low\", \"eoff\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -279,7 +301,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "from_list": schema.SingleNestedAttribute{ Description: "Serve a redirect based on a bulk list lookup.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersFromListModel](ctx), Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ Description: "Expression that evaluates to the list lookup key.", @@ -293,14 +317,16 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "from_value": schema.SingleNestedAttribute{ Description: "Serve a redirect based on the request properties.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersFromValueModel](ctx), Attributes: map[string]schema.Attribute{ "preserve_query_string": schema.BoolAttribute{ Description: "Keep the query string of the original request.", Optional: true, }, "status_code": schema.Float64Attribute{ - Description: "The status code to be used for the redirect.", + Description: "The status code to be used for the redirect.\nAvailable values: 301, 302, 303, 307, 308.", Optional: true, Validators: []validator.Float64{ float64validator.OneOf( @@ -314,7 +340,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "target_url": schema.SingleNestedAttribute{ Description: "The URL to redirect the request to.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersFromValueTargetURLModel](ctx), Attributes: map[string]schema.Attribute{ "value": schema.StringAttribute{ Description: "The URL to redirect the request to.", @@ -330,11 +358,14 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "headers": schema.MapNestedAttribute{ Description: "Map of request headers to modify.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectMapType[RulesetRulesActionParametersHeadersModel](ctx), NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "operation": schema.StringAttribute{ - Required: true, + Description: "Available values: \"remove\".", + Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("remove", "set"), }, @@ -352,11 +383,15 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "uri": schema.SingleNestedAttribute{ Description: "URI to rewrite the request to.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersURIModel](ctx), Attributes: map[string]schema.Attribute{ "path": schema.SingleNestedAttribute{ Description: "Path portion rewrite.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersURIPathModel](ctx), Attributes: map[string]schema.Attribute{ "value": schema.StringAttribute{ Description: "Predefined replacement value.", @@ -370,7 +405,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "query": schema.SingleNestedAttribute{ Description: "Query portion rewrite.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersURIQueryModel](ctx), Attributes: map[string]schema.Attribute{ "value": schema.StringAttribute{ Description: "Predefined replacement value.", @@ -390,7 +427,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "origin": schema.SingleNestedAttribute{ Description: "Override the IP/TCP destination.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersOriginModel](ctx), Attributes: map[string]schema.Attribute{ "host": schema.StringAttribute{ Description: "Override the resolved hostname.", @@ -407,7 +446,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "sni": schema.SingleNestedAttribute{ Description: "Override the Server Name Indication (SNI).", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersSNIModel](ctx), Attributes: map[string]schema.Attribute{ "value": schema.StringAttribute{ Description: "The SNI override.", @@ -424,7 +465,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "content_type": schema.StringAttribute{ - Description: "Content-type header to set with the response.", + Description: "Content-type header to set with the response.\nAvailable values: \"application/json\", \"text/xml\", \"text/plain\", \"text/html\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -448,7 +489,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "autominify": schema.SingleNestedAttribute{ Description: "Select which file extensions to minify automatically.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersAutominifyModel](ctx), Attributes: map[string]schema.Attribute{ "css": schema.BoolAttribute{ Description: "Minify CSS files.", @@ -501,7 +544,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "polish": schema.StringAttribute{ - Description: "Configure the Polish level.", + Description: "Configure the Polish level.\nAvailable values: \"off\", \"lossless\", \"lossy\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -516,7 +559,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "security_level": schema.StringAttribute{ - Description: "Configure the Security Level.", + Description: "Configure the Security Level.\nAvailable values: \"off\", \"essentially_off\", \"low\", \"medium\", \"high\", \"under_attack\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -534,7 +577,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "ssl": schema.StringAttribute{ - Description: "Configure the SSL level.", + Description: "Configure the SSL level.\nAvailable values: \"off\", \"flexible\", \"full\", \"strict\", \"origin_pull\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -611,7 +654,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "ruleset": schema.StringAttribute{ - Description: "A ruleset to skip the execution of. This option is incompatible with the rulesets, rules and phases options.", + Description: "A ruleset to skip the execution of. This option is incompatible with the rulesets, rules and phases options.\nAvailable values: \"current\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("current"), @@ -629,10 +672,12 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "browser_ttl": schema.SingleNestedAttribute{ Description: "Specify how long client browsers should cache the response. Cloudflare cache purge will not purge content cached on client browsers, so high browser TTLs may lead to stale content.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersBrowserTTLModel](ctx), Attributes: map[string]schema.Attribute{ "mode": schema.StringAttribute{ - Description: "Determines which browser ttl mode to use.", + Description: "Determines which browser ttl mode to use.\nAvailable values: \"respect_origin\", \"bypass_by_default\", \"override_origin\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -654,7 +699,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "cache_key": schema.SingleNestedAttribute{ Description: "Define which components of the request are included or excluded from the cache key Cloudflare uses to store the response in cache.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersCacheKeyModel](ctx), Attributes: map[string]schema.Attribute{ "cache_by_device_type": schema.BoolAttribute{ Description: "Separate cached content based on the visitor’s device type", @@ -666,11 +713,15 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "custom_key": schema.SingleNestedAttribute{ Description: "Customize which components of the request are included or excluded from the cache key.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersCacheKeyCustomKeyModel](ctx), Attributes: map[string]schema.Attribute{ "cookie": schema.SingleNestedAttribute{ Description: "The cookies to include in building the cache key.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersCacheKeyCustomKeyCookieModel](ctx), Attributes: map[string]schema.Attribute{ "check_presence": schema.ListAttribute{ Description: "Checks for the presence of these cookie names. The presence of these cookies is used in building the cache key.", @@ -686,7 +737,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "header": schema.SingleNestedAttribute{ Description: "The header names and values to include in building the cache key.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersCacheKeyCustomKeyHeaderModel](ctx), Attributes: map[string]schema.Attribute{ "check_presence": schema.ListAttribute{ Description: "Checks for the presence of these header names. The presence of these headers is used in building the cache key.", @@ -713,7 +766,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "host": schema.SingleNestedAttribute{ Description: "Whether to use the original host or the resolved host in the cache key.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersCacheKeyCustomKeyHostModel](ctx), Attributes: map[string]schema.Attribute{ "resolved": schema.BoolAttribute{ Description: "Use the resolved host in the cache key. A value of true will use the resolved host, while a value or false will use the original host.", @@ -723,11 +778,15 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "query_string": schema.SingleNestedAttribute{ Description: "Use the presence of parameters in the query string to build the cache key.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersCacheKeyCustomKeyQueryStringModel](ctx), Attributes: map[string]schema.Attribute{ "include": schema.SingleNestedAttribute{ Description: "A list of query string parameters used to build the cache key.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersCacheKeyCustomKeyQueryStringIncludeModel](ctx), Attributes: map[string]schema.Attribute{ "list": schema.ListAttribute{ Optional: true, @@ -741,7 +800,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "exclude": schema.SingleNestedAttribute{ Description: "A list of query string parameters NOT used to build the cache key. All parameters present in the request but missing in this list will be used to build the cache key.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersCacheKeyCustomKeyQueryStringExcludeModel](ctx), Attributes: map[string]schema.Attribute{ "list": schema.ListAttribute{ Optional: true, @@ -757,7 +818,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "user": schema.SingleNestedAttribute{ Description: "Characteristics of the request user agent used in building the cache key.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersCacheKeyCustomKeyUserModel](ctx), Attributes: map[string]schema.Attribute{ "device_type": schema.BoolAttribute{ Description: "Use the user agent's device type in the cache key.", @@ -783,7 +846,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "cache_reserve": schema.SingleNestedAttribute{ Description: "Mark whether the request's response from origin is eligible for Cache Reserve (requires a Cache Reserve add-on plan).", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersCacheReserveModel](ctx), Attributes: map[string]schema.Attribute{ "eligible": schema.BoolAttribute{ Description: "Determines whether cache reserve is enabled. If this is true and a request meets eligibility criteria, Cloudflare will write the resource to cache reserve.", @@ -797,7 +862,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "edge_ttl": schema.SingleNestedAttribute{ Description: "TTL (Time to Live) specifies the maximum time to cache a resource in the Cloudflare edge network.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersEdgeTTLModel](ctx), Attributes: map[string]schema.Attribute{ "default": schema.Int64Attribute{ Description: "The TTL (in seconds) if you choose override_origin mode.", @@ -807,7 +874,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "mode": schema.StringAttribute{ - Description: "edge ttl options", + Description: "edge ttl options\nAvailable values: \"respect_origin\", \"bypass_by_default\", \"override_origin\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -867,7 +934,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "serve_stale": schema.SingleNestedAttribute{ Description: "Define if Cloudflare should serve stale content while getting the latest content from the origin. If on, Cloudflare will not serve stale content while getting the latest content from the origin.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesActionParametersServeStaleModel](ctx), Attributes: map[string]schema.Attribute{ "disable_stale_while_updating": schema.BoolAttribute{ Description: "Defines whether Cloudflare should serve stale content while updating. If true, Cloudflare will not serve stale content while getting the latest content from the origin.", @@ -877,7 +946,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "cookie_fields": schema.ListNestedAttribute{ Description: "The cookie fields to log.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectListType[RulesetRulesActionParametersCookieFieldsModel](ctx), NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "name": schema.StringAttribute{ @@ -887,9 +958,31 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, }, + "raw_response_fields": schema.ListNestedAttribute{ + Description: "The raw response fields to log.", + Computed: true, + Optional: true, + CustomType: customfield.NewNestedObjectListType[RulesetRulesActionParametersRawResponseFieldsModel](ctx), + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "name": schema.StringAttribute{ + Description: "The name of the field.", + Required: true, + }, + "preserve_duplicates": schema.BoolAttribute{ + Description: "Whether to log duplicate values of the same header.", + Computed: true, + Optional: true, + Default: booldefault.StaticBool(false), + }, + }, + }, + }, "request_fields": schema.ListNestedAttribute{ - Description: "The request fields to log.", + Description: "The raw request fields to log.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectListType[RulesetRulesActionParametersRequestFieldsModel](ctx), NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "name": schema.StringAttribute{ @@ -900,8 +993,30 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "response_fields": schema.ListNestedAttribute{ - Description: "The response fields to log.", + Description: "The transformed response fields to log.", + Computed: true, + Optional: true, + CustomType: customfield.NewNestedObjectListType[RulesetRulesActionParametersResponseFieldsModel](ctx), + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "name": schema.StringAttribute{ + Description: "The name of the field.", + Required: true, + }, + "preserve_duplicates": schema.BoolAttribute{ + Description: "Whether to log duplicate values of the same header.", + Computed: true, + Optional: true, + Default: booldefault.StaticBool(false), + }, + }, + }, + }, + "transformed_request_fields": schema.ListNestedAttribute{ + Description: "The transformed request fields to log.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectListType[RulesetRulesActionParametersTransformedRequestFieldsModel](ctx), NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "name": schema.StringAttribute{ @@ -933,7 +1048,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "exposed_credential_check": schema.SingleNestedAttribute{ Description: "Configure checks for exposed credentials.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesExposedCredentialCheckModel](ctx), Attributes: map[string]schema.Attribute{ "password_expression": schema.StringAttribute{ Description: "Expression that selects the password used in the credentials check.", @@ -951,7 +1068,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "logging": schema.SingleNestedAttribute{ Description: "An object configuring the rule's logging behavior.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesLoggingModel](ctx), Attributes: map[string]schema.Attribute{ "enabled": schema.BoolAttribute{ Description: "Whether to generate a log when the rule matches.", @@ -961,7 +1080,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "ratelimit": schema.SingleNestedAttribute{ Description: "An object configuring the rule's ratelimit behavior.", + Computed: true, Optional: true, + CustomType: customfield.NewNestedObjectType[RulesetRulesRatelimitModel](ctx), Attributes: map[string]schema.Attribute{ "characteristics": schema.ListAttribute{ Description: "Characteristics of the request on which the ratelimiter counter will be incremented.", @@ -969,7 +1090,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "period": schema.Int64Attribute{ - Description: "Period in seconds over which the counter is being incremented.", + Description: "Period in seconds over which the counter is being incremented.\nAvailable values: 10, 60, 600, 3600.", Required: true, Validators: []validator.Int64{ int64validator.OneOf( @@ -1014,12 +1135,6 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, }, - "description": schema.StringAttribute{ - Description: "An informative description of the ruleset.", - Computed: true, - Optional: true, - Default: stringdefault.StaticString(""), - }, }, } } diff --git a/internal/services/snippets/data_source_model.go b/internal/services/snippets/data_source_model.go index 0c29e5bae5..9878d16819 100644 --- a/internal/services/snippets/data_source_model.go +++ b/internal/services/snippets/data_source_model.go @@ -16,8 +16,8 @@ type SnippetsResultDataSourceEnvelope struct { } type SnippetsDataSourceModel struct { + SnippetName types.String `tfsdk:"snippet_name" path:"snippet_name,required"` ZoneID types.String `tfsdk:"zone_id" path:"zone_id,required"` - SnippetName types.String `tfsdk:"snippet_name" path:"snippet_name,computed"` CreatedOn types.String `tfsdk:"created_on" json:"created_on,computed"` ModifiedOn types.String `tfsdk:"modified_on" json:"modified_on,computed"` } diff --git a/internal/services/snippets/data_source_schema.go b/internal/services/snippets/data_source_schema.go index 5070422385..1852934735 100644 --- a/internal/services/snippets/data_source_schema.go +++ b/internal/services/snippets/data_source_schema.go @@ -14,14 +14,14 @@ var _ datasource.DataSourceWithConfigValidators = (*SnippetsDataSource)(nil) func DataSourceSchema(ctx context.Context) schema.Schema { return schema.Schema{ Attributes: map[string]schema.Attribute{ + "snippet_name": schema.StringAttribute{ + Description: "Snippet identifying name", + Required: true, + }, "zone_id": schema.StringAttribute{ Description: "Identifier", Required: true, }, - "snippet_name": schema.StringAttribute{ - Description: "Snippet identifying name", - Computed: true, - }, "created_on": schema.StringAttribute{ Description: "Creation time of the snippet", Computed: true, diff --git a/internal/services/spectrum_application/data_source_schema.go b/internal/services/spectrum_application/data_source_schema.go index 1e1236adda..d661cd131c 100644 --- a/internal/services/spectrum_application/data_source_schema.go +++ b/internal/services/spectrum_application/data_source_schema.go @@ -57,7 +57,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "proxy_protocol": schema.StringAttribute{ - Description: "Enables Proxy Protocol to the origin. Refer to [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple Proxy Protocol.", + Description: "Enables Proxy Protocol to the origin. Refer to [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple Proxy Protocol.\nAvailable values: \"off\", \"v1\", \"v2\", \"simple\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -69,7 +69,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "tls": schema.StringAttribute{ - Description: "The type of TLS termination associated with the application.", + Description: "The type of TLS termination associated with the application.\nAvailable values: \"off\", \"flexible\", \"full\", \"strict\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -81,7 +81,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "traffic_type": schema.StringAttribute{ - Description: "Determines how data travels from the edge to your origin. When set to \"direct\", Spectrum will send traffic directly to your origin, and the application's type is derived from the `protocol`. When set to \"http\" or \"https\", Spectrum will apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and the application type matches this property exactly.", + Description: "Determines how data travels from the edge to your origin. When set to \"direct\", Spectrum will send traffic directly to your origin, and the application's type is derived from the `protocol`. When set to \"http\" or \"https\", Spectrum will apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and the application type matches this property exactly.\nAvailable values: \"direct\", \"http\", \"https\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -107,7 +107,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The type of DNS record associated with the application.", + Description: "The type of DNS record associated with the application.\nAvailable values: \"CNAME\", \"ADDRESS\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("CNAME", "ADDRESS"), @@ -121,7 +121,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[SpectrumApplicationEdgeIPsDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "connectivity": schema.StringAttribute{ - Description: "The IP versions supported for inbound connections on Spectrum anycast IPs.", + Description: "The IP versions supported for inbound connections on Spectrum anycast IPs.\nAvailable values: \"all\", \"ipv4\", \"ipv6\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -132,7 +132,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "The type of edge IP configuration specified. Dynamically allocated edge IPs use Spectrum anycast IPs in accordance with the connectivity you specify. Only valid with CNAME DNS names.", + Description: "The type of edge IP configuration specified. Dynamically allocated edge IPs use Spectrum anycast IPs in accordance with the connectivity you specify. Only valid with CNAME DNS names.\nAvailable values: \"dynamic\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("dynamic", "static"), @@ -163,7 +163,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "The type of DNS record associated with the origin. \"\" is used to specify a combination of A/AAAA records.", + Description: "The type of DNS record associated with the origin. \"\" is used to specify a combination of A/AAAA records.\nAvailable values: \"\", \"A\", \"AAAA\", \"SRV\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/spectrum_application/list_data_source_schema.go b/internal/services/spectrum_application/list_data_source_schema.go index d753687177..fb3c4d45c3 100644 --- a/internal/services/spectrum_application/list_data_source_schema.go +++ b/internal/services/spectrum_application/list_data_source_schema.go @@ -23,7 +23,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "direction": schema.StringAttribute{ - Description: "Sets the direction by which results are ordered.", + Description: "Sets the direction by which results are ordered.\nAvailable values: \"asc\", \"desc\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -31,7 +31,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "order": schema.StringAttribute{ - Description: "Application field by which results are ordered.", + Description: "Application field by which results are ordered.\nAvailable values: \"protocol\", \"app_id\", \"created_on\", \"modified_on\", \"dns\".", Computed: true, Optional: true, Validators: []validator.String{ diff --git a/internal/services/spectrum_application/schema.go b/internal/services/spectrum_application/schema.go index 4de10bded9..602d5e022e 100644 --- a/internal/services/spectrum_application/schema.go +++ b/internal/services/spectrum_application/schema.go @@ -49,7 +49,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "type": schema.StringAttribute{ - Description: "The type of DNS record associated with the application.", + Description: "The type of DNS record associated with the application.\nAvailable values: \"CNAME\", \"ADDRESS\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("CNAME", "ADDRESS"), @@ -62,7 +62,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "tls": schema.StringAttribute{ - Description: "The type of TLS termination associated with the application.", + Description: "The type of TLS termination associated with the application.\nAvailable values: \"off\", \"flexible\", \"full\", \"strict\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -92,7 +92,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: booldefault.StaticBool(false), }, "proxy_protocol": schema.StringAttribute{ - Description: "Enables Proxy Protocol to the origin. Refer to [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple Proxy Protocol.", + Description: "Enables Proxy Protocol to the origin. Refer to [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple Proxy Protocol.\nAvailable values: \"off\", \"v1\", \"v2\", \"simple\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -106,7 +106,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: stringdefault.StaticString("off"), }, "traffic_type": schema.StringAttribute{ - Description: "Determines how data travels from the edge to your origin. When set to \"direct\", Spectrum will send traffic directly to your origin, and the application's type is derived from the `protocol`. When set to \"http\" or \"https\", Spectrum will apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and the application type matches this property exactly.", + Description: "Determines how data travels from the edge to your origin. When set to \"direct\", Spectrum will send traffic directly to your origin, and the application's type is derived from the `protocol`. When set to \"http\" or \"https\", Spectrum will apply Cloudflare's HTTP/HTTPS features as it sends traffic to your origin, and the application type matches this property exactly.\nAvailable values: \"direct\", \"http\", \"https\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -125,7 +125,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[SpectrumApplicationEdgeIPsModel](ctx), Attributes: map[string]schema.Attribute{ "connectivity": schema.StringAttribute{ - Description: "The IP versions supported for inbound connections on Spectrum anycast IPs.", + Description: "The IP versions supported for inbound connections on Spectrum anycast IPs.\nAvailable values: \"all\", \"ipv4\", \"ipv6\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -136,7 +136,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "The type of edge IP configuration specified. Dynamically allocated edge IPs use Spectrum anycast IPs in accordance with the connectivity you specify. Only valid with CNAME DNS names.", + Description: "The type of edge IP configuration specified. Dynamically allocated edge IPs use Spectrum anycast IPs in accordance with the connectivity you specify. Only valid with CNAME DNS names.\nAvailable values: \"dynamic\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("dynamic", "static"), @@ -167,7 +167,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "The type of DNS record associated with the origin. \"\" is used to specify a combination of A/AAAA records.", + Description: "The type of DNS record associated with the origin. \"\" is used to specify a combination of A/AAAA records.\nAvailable values: \"\", \"A\", \"AAAA\", \"SRV\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/stream/data_source_schema.go b/internal/services/stream/data_source_schema.go index 1c1559ecae..d5c5e10f17 100644 --- a/internal/services/stream/data_source_schema.go +++ b/internal/services/stream/data_source_schema.go @@ -162,7 +162,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "state": schema.StringAttribute{ - Description: "Specifies the processing status for all quality levels for a video.", + Description: "Specifies the processing status for all quality levels for a video.\nAvailable values: \"pendingupload\", \"downloading\", \"queued\", \"inprogress\", \"ready\", \"error\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/stream/list_data_source_schema.go b/internal/services/stream/list_data_source_schema.go index dae4630ca5..d45d3f86bc 100644 --- a/internal/services/stream/list_data_source_schema.go +++ b/internal/services/stream/list_data_source_schema.go @@ -45,7 +45,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "status": schema.StringAttribute{ - Description: "Specifies the processing status for all quality levels for a video.", + Description: "Specifies the processing status for all quality levels for a video.\nAvailable values: \"pendingupload\", \"downloading\", \"queued\", \"inprogress\", \"ready\", \"error\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -197,7 +197,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "state": schema.StringAttribute{ - Description: "Specifies the processing status for all quality levels for a video.", + Description: "Specifies the processing status for all quality levels for a video.\nAvailable values: \"pendingupload\", \"downloading\", \"queued\", \"inprogress\", \"ready\", \"error\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/stream/schema.go b/internal/services/stream/schema.go index ccea68577b..2b50f9919e 100644 --- a/internal/services/stream/schema.go +++ b/internal/services/stream/schema.go @@ -177,7 +177,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "state": schema.StringAttribute{ - Description: "Specifies the processing status for all quality levels for a video.", + Description: "Specifies the processing status for all quality levels for a video.\nAvailable values: \"pendingupload\", \"downloading\", \"queued\", \"inprogress\", \"ready\", \"error\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/stream_audio_track/data_source_schema.go b/internal/services/stream_audio_track/data_source_schema.go index 60e377f287..45e783a79e 100644 --- a/internal/services/stream_audio_track/data_source_schema.go +++ b/internal/services/stream_audio_track/data_source_schema.go @@ -33,7 +33,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Specifies the processing status of the video.", + Description: "Specifies the processing status of the video.\nAvailable values: \"queued\", \"ready\", \"error\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/stream_audio_track/schema.go b/internal/services/stream_audio_track/schema.go index 899c614a41..708c0c3c80 100644 --- a/internal/services/stream_audio_track/schema.go +++ b/internal/services/stream_audio_track/schema.go @@ -48,7 +48,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: booldefault.StaticBool(false), }, "status": schema.StringAttribute{ - Description: "Specifies the processing status of the video.", + Description: "Specifies the processing status of the video.\nAvailable values: \"queued\", \"ready\", \"error\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/stream_caption_language/data_source_model.go b/internal/services/stream_caption_language/data_source_model.go index 62f1dadac6..26d211ed82 100644 --- a/internal/services/stream_caption_language/data_source_model.go +++ b/internal/services/stream_caption_language/data_source_model.go @@ -18,7 +18,7 @@ type StreamCaptionLanguageResultDataSourceEnvelope struct { type StreamCaptionLanguageDataSourceModel struct { AccountID types.String `tfsdk:"account_id" path:"account_id,required"` Identifier types.String `tfsdk:"identifier" path:"identifier,required"` - Language types.String `tfsdk:"language" path:"language,computed"` + Language types.String `tfsdk:"language" path:"language,required"` Generated types.Bool `tfsdk:"generated" json:"generated,computed"` Label types.String `tfsdk:"label" json:"label,computed"` Status types.String `tfsdk:"status" json:"status,computed"` diff --git a/internal/services/stream_caption_language/data_source_schema.go b/internal/services/stream_caption_language/data_source_schema.go index 8f4f465fb3..9bfd1d8bcb 100644 --- a/internal/services/stream_caption_language/data_source_schema.go +++ b/internal/services/stream_caption_language/data_source_schema.go @@ -26,7 +26,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, "language": schema.StringAttribute{ Description: "The language tag in BCP 47 format.", - Computed: true, + Required: true, }, "generated": schema.BoolAttribute{ Description: "Whether the caption was generated via AI.", @@ -37,7 +37,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "The status of a generated caption.", + Description: "The status of a generated caption.\nAvailable values: \"ready\", \"inprogress\", \"error\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/stream_caption_language/schema.go b/internal/services/stream_caption_language/schema.go index 0887445dbd..1d626563dd 100644 --- a/internal/services/stream_caption_language/schema.go +++ b/internal/services/stream_caption_language/schema.go @@ -46,7 +46,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "The status of a generated caption.", + Description: "The status of a generated caption.\nAvailable values: \"ready\", \"inprogress\", \"error\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/stream_live_input/data_source_schema.go b/internal/services/stream_live_input/data_source_schema.go index f612a3b3b7..eec1bf8dc1 100644 --- a/internal/services/stream_live_input/data_source_schema.go +++ b/internal/services/stream_live_input/data_source_schema.go @@ -47,7 +47,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "status": schema.StringAttribute{ - Description: "The connection status of a live input.", + Description: "The connection status of a live input.\nAvailable values: \"connected\", \"reconnected\", \"reconnecting\", \"client_disconnect\", \"ttl_exceeded\", \"failed_to_connect\", \"failed_to_reconnect\", \"new_configuration_accepted\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -82,7 +82,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "mode": schema.StringAttribute{ - Description: "Specifies the recording behavior for the live input. Set this value to `off` to prevent a recording. Set the value to `automatic` to begin a recording and transition to on-demand after Stream Live stops receiving input.", + Description: "Specifies the recording behavior for the live input. Set this value to `off` to prevent a recording. Set the value to `automatic` to begin a recording and transition to on-demand after Stream Live stops receiving input.\nAvailable values: \"off\", \"automatic\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("off", "automatic"), diff --git a/internal/services/stream_live_input/schema.go b/internal/services/stream_live_input/schema.go index 5939fec599..c2720b0c0a 100644 --- a/internal/services/stream_live_input/schema.go +++ b/internal/services/stream_live_input/schema.go @@ -70,7 +70,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: booldefault.StaticBool(false), }, "mode": schema.StringAttribute{ - Description: "Specifies the recording behavior for the live input. Set this value to `off` to prevent a recording. Set the value to `automatic` to begin a recording and transition to on-demand after Stream Live stops receiving input.", + Description: "Specifies the recording behavior for the live input. Set this value to `off` to prevent a recording. Set the value to `automatic` to begin a recording and transition to on-demand after Stream Live stops receiving input.\nAvailable values: \"off\", \"automatic\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -103,7 +103,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "status": schema.StringAttribute{ - Description: "The connection status of a live input.", + Description: "The connection status of a live input.\nAvailable values: \"connected\", \"reconnected\", \"reconnecting\", \"client_disconnect\", \"ttl_exceeded\", \"failed_to_connect\", \"failed_to_reconnect\", \"new_configuration_accepted\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/tiered_cache/data_source_schema.go b/internal/services/tiered_cache/data_source_schema.go index 316e7c06f7..677056e970 100644 --- a/internal/services/tiered_cache/data_source_schema.go +++ b/internal/services/tiered_cache/data_source_schema.go @@ -26,7 +26,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "id": schema.StringAttribute{ - Description: "ID of the zone setting.", + Description: "ID of the zone setting.\nAvailable values: \"tiered_cache_smart_topology_enable\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("tiered_cache_smart_topology_enable"), @@ -38,7 +38,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "value": schema.StringAttribute{ - Description: "The value of the feature", + Description: "The value of the feature\nAvailable values: \"on\", \"off\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("on", "off"), diff --git a/internal/services/tiered_cache/schema.go b/internal/services/tiered_cache/schema.go index d0d32f5675..7eb239daef 100644 --- a/internal/services/tiered_cache/schema.go +++ b/internal/services/tiered_cache/schema.go @@ -30,7 +30,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown(), stringplanmodifier.RequiresReplace()}, }, "value": schema.StringAttribute{ - Description: "Enable or disable the Smart Tiered Cache", + Description: "Enable or disable the Smart Tiered Cache\nAvailable values: \"on\", \"off\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("on", "off"), diff --git a/internal/services/total_tls/data_source_schema.go b/internal/services/total_tls/data_source_schema.go index b32812f9e6..582a3138aa 100644 --- a/internal/services/total_tls/data_source_schema.go +++ b/internal/services/total_tls/data_source_schema.go @@ -22,7 +22,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "certificate_authority": schema.StringAttribute{ - Description: "The Certificate Authority that Total TLS certificates will be issued through.", + Description: "The Certificate Authority that Total TLS certificates will be issued through.\nAvailable values: \"google\", \"lets_encrypt\", \"ssl_com\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -37,7 +37,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "validity_period": schema.Int64Attribute{ - Description: "The validity period in days for the certificates ordered via Total TLS.", + Description: "The validity period in days for the certificates ordered via Total TLS.\nAvailable values: 90.", Computed: true, Validators: []validator.Int64{ int64validator.OneOf(90), diff --git a/internal/services/total_tls/schema.go b/internal/services/total_tls/schema.go index 9bfa04ae89..7a541b4944 100644 --- a/internal/services/total_tls/schema.go +++ b/internal/services/total_tls/schema.go @@ -34,7 +34,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "certificate_authority": schema.StringAttribute{ - Description: "The Certificate Authority that Total TLS certificates will be issued through.", + Description: "The Certificate Authority that Total TLS certificates will be issued through.\nAvailable values: \"google\", \"lets_encrypt\", \"ssl_com\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -45,7 +45,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "validity_period": schema.Int64Attribute{ - Description: "The validity period in days for the certificates ordered via Total TLS.", + Description: "The validity period in days for the certificates ordered via Total TLS.\nAvailable values: 90.", Computed: true, Validators: []validator.Int64{ int64validator.OneOf(90), diff --git a/internal/services/turnstile_widget/data_source_schema.go b/internal/services/turnstile_widget/data_source_schema.go index 89a7d36125..20e42027eb 100644 --- a/internal/services/turnstile_widget/data_source_schema.go +++ b/internal/services/turnstile_widget/data_source_schema.go @@ -35,11 +35,11 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "bot_fight_mode": schema.BoolAttribute{ - Description: "If bot_fight_mode is set to `true`, Cloudflare issues computationally\nexpensive challenges in response to malicious bots (ENT only).\n", + Description: "If bot_fight_mode is set to `true`, Cloudflare issues computationally\nexpensive challenges in response to malicious bots (ENT only).", Computed: true, }, "clearance_level": schema.StringAttribute{ - Description: "If Turnstile is embedded on a Cloudflare site and the widget should grant challenge clearance,\nthis setting can determine the clearance level to be set\n", + Description: "If Turnstile is embedded on a Cloudflare site and the widget should grant challenge clearance,\nthis setting can determine the clearance level to be set\nAvailable values: \"no_clearance\", \"jschallenge\", \"managed\", \"interactive\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -56,11 +56,11 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "ephemeral_id": schema.BoolAttribute{ - Description: "Return the Ephemeral ID in /siteverify (ENT only).\n", + Description: "Return the Ephemeral ID in /siteverify (ENT only).", Computed: true, }, "mode": schema.StringAttribute{ - Description: "Widget Mode", + Description: "Widget Mode\nAvailable values: \"non-interactive\", \"invisible\", \"managed\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -76,15 +76,15 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "name": schema.StringAttribute{ - Description: "Human readable widget name. Not unique. Cloudflare suggests that you\nset this to a meaningful string to make it easier to identify your\nwidget, and where it is used.\n", + Description: "Human readable widget name. Not unique. Cloudflare suggests that you\nset this to a meaningful string to make it easier to identify your\nwidget, and where it is used.", Computed: true, }, "offlabel": schema.BoolAttribute{ - Description: "Do not show any Cloudflare branding on the widget (ENT only).\n", + Description: "Do not show any Cloudflare branding on the widget (ENT only).", Computed: true, }, "region": schema.StringAttribute{ - Description: "Region where this widget can be used.", + Description: "Region where this widget can be used.\nAvailable values: \"world\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("world"), @@ -103,14 +103,14 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "Direction to order widgets.", + Description: "Direction to order widgets.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), }, }, "order": schema.StringAttribute{ - Description: "Field to order widgets by.", + Description: "Field to order widgets by.\nAvailable values: \"id\", \"sitekey\", \"name\", \"created_on\", \"modified_on\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/turnstile_widget/list_data_source_schema.go b/internal/services/turnstile_widget/list_data_source_schema.go index 9354a109b6..2dee06861e 100644 --- a/internal/services/turnstile_widget/list_data_source_schema.go +++ b/internal/services/turnstile_widget/list_data_source_schema.go @@ -25,14 +25,14 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "direction": schema.StringAttribute{ - Description: "Direction to order widgets.", + Description: "Direction to order widgets.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), }, }, "order": schema.StringAttribute{ - Description: "Field to order widgets by.", + Description: "Field to order widgets by.\nAvailable values: \"id\", \"sitekey\", \"name\", \"created_on\", \"modified_on\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -58,11 +58,11 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "bot_fight_mode": schema.BoolAttribute{ - Description: "If bot_fight_mode is set to `true`, Cloudflare issues computationally\nexpensive challenges in response to malicious bots (ENT only).\n", + Description: "If bot_fight_mode is set to `true`, Cloudflare issues computationally\nexpensive challenges in response to malicious bots (ENT only).", Computed: true, }, "clearance_level": schema.StringAttribute{ - Description: "If Turnstile is embedded on a Cloudflare site and the widget should grant challenge clearance,\nthis setting can determine the clearance level to be set\n", + Description: "If Turnstile is embedded on a Cloudflare site and the widget should grant challenge clearance,\nthis setting can determine the clearance level to be set\nAvailable values: \"no_clearance\", \"jschallenge\", \"managed\", \"interactive\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -84,11 +84,11 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "ephemeral_id": schema.BoolAttribute{ - Description: "Return the Ephemeral ID in /siteverify (ENT only).\n", + Description: "Return the Ephemeral ID in /siteverify (ENT only).", Computed: true, }, "mode": schema.StringAttribute{ - Description: "Widget Mode", + Description: "Widget Mode\nAvailable values: \"non-interactive\", \"invisible\", \"managed\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -104,15 +104,15 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "name": schema.StringAttribute{ - Description: "Human readable widget name. Not unique. Cloudflare suggests that you\nset this to a meaningful string to make it easier to identify your\nwidget, and where it is used.\n", + Description: "Human readable widget name. Not unique. Cloudflare suggests that you\nset this to a meaningful string to make it easier to identify your\nwidget, and where it is used.", Computed: true, }, "offlabel": schema.BoolAttribute{ - Description: "Do not show any Cloudflare branding on the widget (ENT only).\n", + Description: "Do not show any Cloudflare branding on the widget (ENT only).", Computed: true, }, "region": schema.StringAttribute{ - Description: "Region where this widget can be used.", + Description: "Region where this widget can be used.\nAvailable values: \"world\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("world"), diff --git a/internal/services/turnstile_widget/schema.go b/internal/services/turnstile_widget/schema.go index 912fa6f598..cf740ca2b3 100644 --- a/internal/services/turnstile_widget/schema.go +++ b/internal/services/turnstile_widget/schema.go @@ -36,7 +36,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "region": schema.StringAttribute{ - Description: "Region where this widget can be used.", + Description: "Region where this widget can be used.\nAvailable values: \"world\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -46,7 +46,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: stringdefault.StaticString("world"), }, "mode": schema.StringAttribute{ - Description: "Widget Mode", + Description: "Widget Mode\nAvailable values: \"non-interactive\", \"invisible\", \"managed\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -57,7 +57,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "name": schema.StringAttribute{ - Description: "Human readable widget name. Not unique. Cloudflare suggests that you\nset this to a meaningful string to make it easier to identify your\nwidget, and where it is used.\n", + Description: "Human readable widget name. Not unique. Cloudflare suggests that you\nset this to a meaningful string to make it easier to identify your\nwidget, and where it is used.", Required: true, }, "domains": schema.ListAttribute{ @@ -65,12 +65,12 @@ func ResourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "bot_fight_mode": schema.BoolAttribute{ - Description: "If bot_fight_mode is set to `true`, Cloudflare issues computationally\nexpensive challenges in response to malicious bots (ENT only).\n", + Description: "If bot_fight_mode is set to `true`, Cloudflare issues computationally\nexpensive challenges in response to malicious bots (ENT only).", Optional: true, Computed: true, }, "clearance_level": schema.StringAttribute{ - Description: "If Turnstile is embedded on a Cloudflare site and the widget should grant challenge clearance,\nthis setting can determine the clearance level to be set\n", + Description: "If Turnstile is embedded on a Cloudflare site and the widget should grant challenge clearance,\nthis setting can determine the clearance level to be set\nAvailable values: \"no_clearance\", \"jschallenge\", \"managed\", \"interactive\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -82,11 +82,11 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "ephemeral_id": schema.BoolAttribute{ - Description: "Return the Ephemeral ID in /siteverify (ENT only).\n", + Description: "Return the Ephemeral ID in /siteverify (ENT only).", Optional: true, }, "offlabel": schema.BoolAttribute{ - Description: "Do not show any Cloudflare branding on the widget (ENT only).\n", + Description: "Do not show any Cloudflare branding on the widget (ENT only).", Optional: true, Computed: true, }, diff --git a/internal/services/url_normalization_settings/data_source_schema.go b/internal/services/url_normalization_settings/data_source_schema.go index 12256875f0..70599aa25d 100644 --- a/internal/services/url_normalization_settings/data_source_schema.go +++ b/internal/services/url_normalization_settings/data_source_schema.go @@ -21,14 +21,14 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "scope": schema.StringAttribute{ - Description: "The scope of the URL normalization.", + Description: "The scope of the URL normalization.\nAvailable values: \"incoming\", \"both\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("incoming", "both"), }, }, "type": schema.StringAttribute{ - Description: "The type of URL normalization performed by Cloudflare.", + Description: "The type of URL normalization performed by Cloudflare.\nAvailable values: \"cloudflare\", \"rfc3986\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("cloudflare", "rfc3986"), diff --git a/internal/services/url_normalization_settings/schema.go b/internal/services/url_normalization_settings/schema.go index 4ef2ba4cd6..b680e9aad3 100644 --- a/internal/services/url_normalization_settings/schema.go +++ b/internal/services/url_normalization_settings/schema.go @@ -29,14 +29,14 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown(), stringplanmodifier.RequiresReplace()}, }, "scope": schema.StringAttribute{ - Description: "The scope of the URL normalization.", + Description: "The scope of the URL normalization.\nAvailable values: \"incoming\", \"both\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("incoming", "both"), }, }, "type": schema.StringAttribute{ - Description: "The type of URL normalization performed by Cloudflare.", + Description: "The type of URL normalization performed by Cloudflare.\nAvailable values: \"cloudflare\", \"rfc3986\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("cloudflare", "rfc3986"), diff --git a/internal/services/user_agent_blocking_rule/list_data_source_schema.go b/internal/services/user_agent_blocking_rule/list_data_source_schema.go index 4cc0937f96..df95cbfe9c 100644 --- a/internal/services/user_agent_blocking_rule/list_data_source_schema.go +++ b/internal/services/user_agent_blocking_rule/list_data_source_schema.go @@ -71,7 +71,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "mode": schema.StringAttribute{ - Description: "The action to apply to a matched request.", + Description: "The action to apply to a matched request.\nAvailable values: \"block\", \"challenge\", \"js_challenge\", \"managed_challenge\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/user_agent_blocking_rule/schema.go b/internal/services/user_agent_blocking_rule/schema.go index 45cb1f1aa0..ef0bacad36 100644 --- a/internal/services/user_agent_blocking_rule/schema.go +++ b/internal/services/user_agent_blocking_rule/schema.go @@ -29,7 +29,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "mode": schema.StringAttribute{ - Description: "The action to apply to a matched request.", + Description: "The action to apply to a matched request.\nAvailable values: \"block\", \"challenge\", \"whitelist\", \"js_challenge\", \"managed_challenge\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -46,7 +46,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, Attributes: map[string]schema.Attribute{ "target": schema.StringAttribute{ - Description: "The configuration target. You must set the target to `ip` when specifying an IP address in the rule.", + Description: "The configuration target. You must set the target to `ip` when specifying an IP address in the rule.\nAvailable values: \"ip\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/waiting_room/data_source_schema.go b/internal/services/waiting_room/data_source_schema.go index c155b91566..a5db89477c 100644 --- a/internal/services/waiting_room/data_source_schema.go +++ b/internal/services/waiting_room/data_source_schema.go @@ -44,7 +44,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "default_template_language": schema.StringAttribute{ - Description: "The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used.", + Description: "The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used.\nAvailable values: \"en-US\", \"es-ES\", \"de-DE\", \"fr-FR\", \"it-IT\", \"ja-JP\", \"ko-KR\", \"pt-BR\", \"zh-CN\", \"zh-TW\", \"nl-NL\", \"pl-PL\", \"id-ID\", \"tr-TR\", \"ar-EG\", \"ru-RU\", \"fa-IR\", \"bg-BG\", \"hr-HR\", \"cs-CZ\", \"da-DK\", \"fi-FI\", \"lt-LT\", \"ms-MY\", \"nb-NO\", \"ro-RO\", \"el-GR\", \"he-IL\", \"hi-IN\", \"hu-HU\", \"sr-BA\", \"sk-SK\", \"sl-SI\", \"sv-SE\", \"tl-PH\", \"th-TH\", \"uk-UA\", \"vi-VN\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -137,7 +137,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "queueing_method": schema.StringAttribute{ - Description: "Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are:\n1. `fifo` **(default)**: First-In-First-Out queue where customers gain access in the order they arrived.\n2. `random`: Random queue where customers gain access randomly, regardless of arrival time.\n3. `passthrough`: Users will pass directly through the waiting room and into the origin website. As a result, any configured limits will not be respected while this is enabled. This method can be used as an alternative to disabling a waiting room (with `suspended`) so that analytics are still reported. This can be used if you wish to allow all traffic normally, but want to restrict traffic during a waiting room event, or vice versa.\n4. `reject`: Users will be immediately rejected from the waiting room. As a result, no users will reach the origin website while this is enabled. This can be used if you wish to reject all traffic while performing maintenance, block traffic during a specified period of time (an event), or block traffic while events are not occurring. Consider a waiting room used for vaccine distribution that only allows traffic during sign-up events, and otherwise blocks all traffic. For this case, the waiting room uses `reject`, and its events override this with `fifo`, `random`, or `passthrough`. When this queueing method is enabled and neither `queueAll` is enabled nor an event is prequeueing, the waiting room page **will not refresh automatically**.", + Description: "Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are:\n1. `fifo` **(default)**: First-In-First-Out queue where customers gain access in the order they arrived.\n2. `random`: Random queue where customers gain access randomly, regardless of arrival time.\n3. `passthrough`: Users will pass directly through the waiting room and into the origin website. As a result, any configured limits will not be respected while this is enabled. This method can be used as an alternative to disabling a waiting room (with `suspended`) so that analytics are still reported. This can be used if you wish to allow all traffic normally, but want to restrict traffic during a waiting room event, or vice versa.\n4. `reject`: Users will be immediately rejected from the waiting room. As a result, no users will reach the origin website while this is enabled. This can be used if you wish to reject all traffic while performing maintenance, block traffic during a specified period of time (an event), or block traffic while events are not occurring. Consider a waiting room used for vaccine distribution that only allows traffic during sign-up events, and otherwise blocks all traffic. For this case, the waiting room uses `reject`, and its events override this with `fifo`, `random`, or `passthrough`. When this queueing method is enabled and neither `queueAll` is enabled nor an event is prequeueing, the waiting room page **will not refresh automatically**.\nAvailable values: \"fifo\", \"random\", \"passthrough\", \"reject\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -149,7 +149,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "queueing_status_code": schema.Int64Attribute{ - Description: "HTTP status code returned to a user while in the queue.", + Description: "HTTP status code returned to a user while in the queue.\nAvailable values: 200, 202, 429.", Computed: true, Validators: []validator.Int64{ int64validator.OneOf( @@ -178,14 +178,14 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "turnstile_action": schema.StringAttribute{ - Description: "Which action to take when a bot is detected using Turnstile. `log` will\nhave no impact on queueing behavior, simply keeping track of how many\nbots are detected in Waiting Room Analytics. `infinite_queue` will send\nbots to a false queueing state, where they will never reach your\norigin. `infinite_queue` requires Advanced Waiting Room.\n", + Description: "Which action to take when a bot is detected using Turnstile. `log` will\nhave no impact on queueing behavior, simply keeping track of how many\nbots are detected in Waiting Room Analytics. `infinite_queue` will send\nbots to a false queueing state, where they will never reach your\norigin. `infinite_queue` requires Advanced Waiting Room.\nAvailable values: \"log\", \"infinite_queue\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("log", "infinite_queue"), }, }, "turnstile_mode": schema.StringAttribute{ - Description: "Which Turnstile widget type to use for detecting bot traffic. See\n[the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types)\nfor the definitions of these widget types. Set to `off` to disable the\nTurnstile integration entirely. Setting this to anything other than\n`off` or `invisible` requires Advanced Waiting Room.\n", + Description: "Which Turnstile widget type to use for detecting bot traffic. See\n[the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types)\nfor the definitions of these widget types. Set to `off` to disable the\nTurnstile integration entirely. Setting this to anything other than\n`off` or `invisible` requires Advanced Waiting Room.\nAvailable values: \"off\", \"invisible\", \"visible_non_interactive\", \"visible_managed\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -230,7 +230,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[WaitingRoomCookieAttributesDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "samesite": schema.StringAttribute{ - Description: "Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`.", + Description: "Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`.\nAvailable values: \"auto\", \"lax\", \"none\", \"strict\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -242,7 +242,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "secure": schema.StringAttribute{ - Description: "Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled.", + Description: "Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled.\nAvailable values: \"auto\", \"always\", \"never\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/waiting_room/list_data_source_schema.go b/internal/services/waiting_room/list_data_source_schema.go index 235608d6d6..269b55cc79 100644 --- a/internal/services/waiting_room/list_data_source_schema.go +++ b/internal/services/waiting_room/list_data_source_schema.go @@ -64,7 +64,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[WaitingRoomsCookieAttributesDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "samesite": schema.StringAttribute{ - Description: "Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`.", + Description: "Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`.\nAvailable values: \"auto\", \"lax\", \"none\", \"strict\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -76,7 +76,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "secure": schema.StringAttribute{ - Description: "Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled.", + Description: "Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled.\nAvailable values: \"auto\", \"always\", \"never\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -101,7 +101,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "default_template_language": schema.StringAttribute{ - Description: "The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used.", + Description: "The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used.\nAvailable values: \"en-US\", \"es-ES\", \"de-DE\", \"fr-FR\", \"it-IT\", \"ja-JP\", \"ko-KR\", \"pt-BR\", \"zh-CN\", \"zh-TW\", \"nl-NL\", \"pl-PL\", \"id-ID\", \"tr-TR\", \"ar-EG\", \"ru-RU\", \"fa-IR\", \"bg-BG\", \"hr-HR\", \"cs-CZ\", \"da-DK\", \"fi-FI\", \"lt-LT\", \"ms-MY\", \"nb-NO\", \"ro-RO\", \"el-GR\", \"he-IL\", \"hi-IN\", \"hu-HU\", \"sr-BA\", \"sk-SK\", \"sl-SI\", \"sv-SE\", \"tl-PH\", \"th-TH\", \"uk-UA\", \"vi-VN\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -205,7 +205,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "queueing_method": schema.StringAttribute{ - Description: "Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are:\n1. `fifo` **(default)**: First-In-First-Out queue where customers gain access in the order they arrived.\n2. `random`: Random queue where customers gain access randomly, regardless of arrival time.\n3. `passthrough`: Users will pass directly through the waiting room and into the origin website. As a result, any configured limits will not be respected while this is enabled. This method can be used as an alternative to disabling a waiting room (with `suspended`) so that analytics are still reported. This can be used if you wish to allow all traffic normally, but want to restrict traffic during a waiting room event, or vice versa.\n4. `reject`: Users will be immediately rejected from the waiting room. As a result, no users will reach the origin website while this is enabled. This can be used if you wish to reject all traffic while performing maintenance, block traffic during a specified period of time (an event), or block traffic while events are not occurring. Consider a waiting room used for vaccine distribution that only allows traffic during sign-up events, and otherwise blocks all traffic. For this case, the waiting room uses `reject`, and its events override this with `fifo`, `random`, or `passthrough`. When this queueing method is enabled and neither `queueAll` is enabled nor an event is prequeueing, the waiting room page **will not refresh automatically**.", + Description: "Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are:\n1. `fifo` **(default)**: First-In-First-Out queue where customers gain access in the order they arrived.\n2. `random`: Random queue where customers gain access randomly, regardless of arrival time.\n3. `passthrough`: Users will pass directly through the waiting room and into the origin website. As a result, any configured limits will not be respected while this is enabled. This method can be used as an alternative to disabling a waiting room (with `suspended`) so that analytics are still reported. This can be used if you wish to allow all traffic normally, but want to restrict traffic during a waiting room event, or vice versa.\n4. `reject`: Users will be immediately rejected from the waiting room. As a result, no users will reach the origin website while this is enabled. This can be used if you wish to reject all traffic while performing maintenance, block traffic during a specified period of time (an event), or block traffic while events are not occurring. Consider a waiting room used for vaccine distribution that only allows traffic during sign-up events, and otherwise blocks all traffic. For this case, the waiting room uses `reject`, and its events override this with `fifo`, `random`, or `passthrough`. When this queueing method is enabled and neither `queueAll` is enabled nor an event is prequeueing, the waiting room page **will not refresh automatically**.\nAvailable values: \"fifo\", \"random\", \"passthrough\", \"reject\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -217,7 +217,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "queueing_status_code": schema.Int64Attribute{ - Description: "HTTP status code returned to a user while in the queue.", + Description: "HTTP status code returned to a user while in the queue.\nAvailable values: 200, 202, 429.", Computed: true, Validators: []validator.Int64{ int64validator.OneOf( @@ -246,14 +246,14 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "turnstile_action": schema.StringAttribute{ - Description: "Which action to take when a bot is detected using Turnstile. `log` will\nhave no impact on queueing behavior, simply keeping track of how many\nbots are detected in Waiting Room Analytics. `infinite_queue` will send\nbots to a false queueing state, where they will never reach your\norigin. `infinite_queue` requires Advanced Waiting Room.\n", + Description: "Which action to take when a bot is detected using Turnstile. `log` will\nhave no impact on queueing behavior, simply keeping track of how many\nbots are detected in Waiting Room Analytics. `infinite_queue` will send\nbots to a false queueing state, where they will never reach your\norigin. `infinite_queue` requires Advanced Waiting Room.\nAvailable values: \"log\", \"infinite_queue\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("log", "infinite_queue"), }, }, "turnstile_mode": schema.StringAttribute{ - Description: "Which Turnstile widget type to use for detecting bot traffic. See\n[the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types)\nfor the definitions of these widget types. Set to `off` to disable the\nTurnstile integration entirely. Setting this to anything other than\n`off` or `invisible` requires Advanced Waiting Room.\n", + Description: "Which Turnstile widget type to use for detecting bot traffic. See\n[the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types)\nfor the definitions of these widget types. Set to `off` to disable the\nTurnstile integration entirely. Setting this to anything other than\n`off` or `invisible` requires Advanced Waiting Room.\nAvailable values: \"off\", \"invisible\", \"visible_non_interactive\", \"visible_managed\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/waiting_room/schema.go b/internal/services/waiting_room/schema.go index a827cce216..d4e8c6a992 100644 --- a/internal/services/waiting_room/schema.go +++ b/internal/services/waiting_room/schema.go @@ -68,7 +68,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: stringdefault.StaticString(""), }, "default_template_language": schema.StringAttribute{ - Description: "The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used.", + Description: "The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used.\nAvailable values: \"en-US\", \"es-ES\", \"de-DE\", \"fr-FR\", \"it-IT\", \"ja-JP\", \"ko-KR\", \"pt-BR\", \"zh-CN\", \"zh-TW\", \"nl-NL\", \"pl-PL\", \"id-ID\", \"tr-TR\", \"ar-EG\", \"ru-RU\", \"fa-IR\", \"bg-BG\", \"hr-HR\", \"cs-CZ\", \"da-DK\", \"fi-FI\", \"lt-LT\", \"ms-MY\", \"nb-NO\", \"ro-RO\", \"el-GR\", \"he-IL\", \"hi-IN\", \"hu-HU\", \"sr-BA\", \"sk-SK\", \"sl-SI\", \"sv-SE\", \"tl-PH\", \"th-TH\", \"uk-UA\", \"vi-VN\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -146,7 +146,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: booldefault.StaticBool(false), }, "queueing_method": schema.StringAttribute{ - Description: "Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are:\n1. `fifo` **(default)**: First-In-First-Out queue where customers gain access in the order they arrived.\n2. `random`: Random queue where customers gain access randomly, regardless of arrival time.\n3. `passthrough`: Users will pass directly through the waiting room and into the origin website. As a result, any configured limits will not be respected while this is enabled. This method can be used as an alternative to disabling a waiting room (with `suspended`) so that analytics are still reported. This can be used if you wish to allow all traffic normally, but want to restrict traffic during a waiting room event, or vice versa.\n4. `reject`: Users will be immediately rejected from the waiting room. As a result, no users will reach the origin website while this is enabled. This can be used if you wish to reject all traffic while performing maintenance, block traffic during a specified period of time (an event), or block traffic while events are not occurring. Consider a waiting room used for vaccine distribution that only allows traffic during sign-up events, and otherwise blocks all traffic. For this case, the waiting room uses `reject`, and its events override this with `fifo`, `random`, or `passthrough`. When this queueing method is enabled and neither `queueAll` is enabled nor an event is prequeueing, the waiting room page **will not refresh automatically**.", + Description: "Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are:\n1. `fifo` **(default)**: First-In-First-Out queue where customers gain access in the order they arrived.\n2. `random`: Random queue where customers gain access randomly, regardless of arrival time.\n3. `passthrough`: Users will pass directly through the waiting room and into the origin website. As a result, any configured limits will not be respected while this is enabled. This method can be used as an alternative to disabling a waiting room (with `suspended`) so that analytics are still reported. This can be used if you wish to allow all traffic normally, but want to restrict traffic during a waiting room event, or vice versa.\n4. `reject`: Users will be immediately rejected from the waiting room. As a result, no users will reach the origin website while this is enabled. This can be used if you wish to reject all traffic while performing maintenance, block traffic during a specified period of time (an event), or block traffic while events are not occurring. Consider a waiting room used for vaccine distribution that only allows traffic during sign-up events, and otherwise blocks all traffic. For this case, the waiting room uses `reject`, and its events override this with `fifo`, `random`, or `passthrough`. When this queueing method is enabled and neither `queueAll` is enabled nor an event is prequeueing, the waiting room page **will not refresh automatically**.\nAvailable values: \"fifo\", \"random\", \"passthrough\", \"reject\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -160,7 +160,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: stringdefault.StaticString("fifo"), }, "queueing_status_code": schema.Int64Attribute{ - Description: "HTTP status code returned to a user while in the queue.", + Description: "HTTP status code returned to a user while in the queue.\nAvailable values: 200, 202, 429.", Computed: true, Optional: true, Validators: []validator.Int64{ @@ -188,7 +188,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: booldefault.StaticBool(false), }, "turnstile_action": schema.StringAttribute{ - Description: "Which action to take when a bot is detected using Turnstile. `log` will\nhave no impact on queueing behavior, simply keeping track of how many\nbots are detected in Waiting Room Analytics. `infinite_queue` will send\nbots to a false queueing state, where they will never reach your\norigin. `infinite_queue` requires Advanced Waiting Room.\n", + Description: "Which action to take when a bot is detected using Turnstile. `log` will\nhave no impact on queueing behavior, simply keeping track of how many\nbots are detected in Waiting Room Analytics. `infinite_queue` will send\nbots to a false queueing state, where they will never reach your\norigin. `infinite_queue` requires Advanced Waiting Room.\nAvailable values: \"log\", \"infinite_queue\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -197,7 +197,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: stringdefault.StaticString("log"), }, "turnstile_mode": schema.StringAttribute{ - Description: "Which Turnstile widget type to use for detecting bot traffic. See\n[the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types)\nfor the definitions of these widget types. Set to `off` to disable the\nTurnstile integration entirely. Setting this to anything other than\n`off` or `invisible` requires Advanced Waiting Room.\n", + Description: "Which Turnstile widget type to use for detecting bot traffic. See\n[the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types)\nfor the definitions of these widget types. Set to `off` to disable the\nTurnstile integration entirely. Setting this to anything other than\n`off` or `invisible` requires Advanced Waiting Room.\nAvailable values: \"off\", \"invisible\", \"visible_non_interactive\", \"visible_managed\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -249,7 +249,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[WaitingRoomCookieAttributesModel](ctx), Attributes: map[string]schema.Attribute{ "samesite": schema.StringAttribute{ - Description: "Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`.", + Description: "Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`.\nAvailable values: \"auto\", \"lax\", \"none\", \"strict\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -263,7 +263,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: stringdefault.StaticString("auto"), }, "secure": schema.StringAttribute{ - Description: "Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled.", + Description: "Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled.\nAvailable values: \"auto\", \"always\", \"never\".", Computed: true, Optional: true, Validators: []validator.String{ diff --git a/internal/services/waiting_room_rules/data_source_schema.go b/internal/services/waiting_room_rules/data_source_schema.go index 7cb592fa0f..068fc1a343 100644 --- a/internal/services/waiting_room_rules/data_source_schema.go +++ b/internal/services/waiting_room_rules/data_source_schema.go @@ -25,7 +25,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "action": schema.StringAttribute{ - Description: "The action to take when the expression matches.", + Description: "The action to take when the expression matches.\nAvailable values: \"bypass_waiting_room\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("bypass_waiting_room"), diff --git a/internal/services/waiting_room_rules/schema.go b/internal/services/waiting_room_rules/schema.go index 183d61bae1..c23fa131a9 100644 --- a/internal/services/waiting_room_rules/schema.go +++ b/internal/services/waiting_room_rules/schema.go @@ -41,7 +41,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "action": schema.StringAttribute{ - Description: "The action to take when the expression matches.", + Description: "The action to take when the expression matches.\nAvailable values: \"bypass_waiting_room\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("bypass_waiting_room"), @@ -68,7 +68,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.List{listplanmodifier.RequiresReplace()}, }, "action": schema.StringAttribute{ - Description: "The action to take when the expression matches.", + Description: "The action to take when the expression matches.\nAvailable values: \"bypass_waiting_room\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("bypass_waiting_room"), diff --git a/internal/services/waiting_room_settings/data_source_schema.go b/internal/services/waiting_room_settings/data_source_schema.go index dc7e9f3470..307176cd30 100644 --- a/internal/services/waiting_room_settings/data_source_schema.go +++ b/internal/services/waiting_room_settings/data_source_schema.go @@ -19,7 +19,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "search_engine_crawler_bypass": schema.BoolAttribute{ - Description: "Whether to allow verified search engine crawlers to bypass all waiting rooms on this zone.\nVerified search engine crawlers will not be tracked or counted by the waiting room system,\nand will not appear in waiting room analytics.\n", + Description: "Whether to allow verified search engine crawlers to bypass all waiting rooms on this zone.\nVerified search engine crawlers will not be tracked or counted by the waiting room system,\nand will not appear in waiting room analytics.", Computed: true, }, }, diff --git a/internal/services/waiting_room_settings/schema.go b/internal/services/waiting_room_settings/schema.go index 046c003440..9639319af2 100644 --- a/internal/services/waiting_room_settings/schema.go +++ b/internal/services/waiting_room_settings/schema.go @@ -28,7 +28,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown(), stringplanmodifier.RequiresReplace()}, }, "search_engine_crawler_bypass": schema.BoolAttribute{ - Description: "Whether to allow verified search engine crawlers to bypass all waiting rooms on this zone.\nVerified search engine crawlers will not be tracked or counted by the waiting room system,\nand will not appear in waiting room analytics.\n", + Description: "Whether to allow verified search engine crawlers to bypass all waiting rooms on this zone.\nVerified search engine crawlers will not be tracked or counted by the waiting room system,\nand will not appear in waiting room analytics.", Computed: true, Optional: true, Default: booldefault.StaticBool(false), diff --git a/internal/services/web3_hostname/data_source_schema.go b/internal/services/web3_hostname/data_source_schema.go index 4c384075e9..4471899ac6 100644 --- a/internal/services/web3_hostname/data_source_schema.go +++ b/internal/services/web3_hostname/data_source_schema.go @@ -50,7 +50,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Status of the hostname's activation.", + Description: "Status of the hostname's activation.\nAvailable values: \"active\", \"pending\", \"deleting\", \"error\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -62,7 +62,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "target": schema.StringAttribute{ - Description: "Target gateway of the hostname.", + Description: "Target gateway of the hostname.\nAvailable values: \"ethereum\", \"ipfs\", \"ipfs_universal_path\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/web3_hostname/list_data_source_schema.go b/internal/services/web3_hostname/list_data_source_schema.go index a8cef415d8..707c6a5109 100644 --- a/internal/services/web3_hostname/list_data_source_schema.go +++ b/internal/services/web3_hostname/list_data_source_schema.go @@ -61,7 +61,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Status of the hostname's activation.", + Description: "Status of the hostname's activation.\nAvailable values: \"active\", \"pending\", \"deleting\", \"error\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -73,7 +73,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "target": schema.StringAttribute{ - Description: "Target gateway of the hostname.", + Description: "Target gateway of the hostname.\nAvailable values: \"ethereum\", \"ipfs\", \"ipfs_universal_path\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/web3_hostname/schema.go b/internal/services/web3_hostname/schema.go index e5e3d79a0f..3625fb40a7 100644 --- a/internal/services/web3_hostname/schema.go +++ b/internal/services/web3_hostname/schema.go @@ -35,7 +35,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "target": schema.StringAttribute{ - Description: "Target gateway of the hostname.", + Description: "Target gateway of the hostname.\nAvailable values: \"ethereum\", \"ipfs\", \"ipfs_universal_path\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -63,7 +63,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "status": schema.StringAttribute{ - Description: "Status of the hostname's activation.", + Description: "Status of the hostname's activation.\nAvailable values: \"active\", \"pending\", \"deleting\", \"error\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/web_analytics_site/data_source_schema.go b/internal/services/web_analytics_site/data_source_schema.go index 09198967dc..ab374cf512 100644 --- a/internal/services/web_analytics_site/data_source_schema.go +++ b/internal/services/web_analytics_site/data_source_schema.go @@ -116,7 +116,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "order_by": schema.StringAttribute{ - Description: "The property used to sort the list of results.", + Description: "The property used to sort the list of results.\nAvailable values: \"host\", \"created\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("host", "created"), diff --git a/internal/services/web_analytics_site/list_data_source_schema.go b/internal/services/web_analytics_site/list_data_source_schema.go index 5ccce53da1..83dbde41c1 100644 --- a/internal/services/web_analytics_site/list_data_source_schema.go +++ b/internal/services/web_analytics_site/list_data_source_schema.go @@ -25,7 +25,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "order_by": schema.StringAttribute{ - Description: "The property used to sort the list of results.", + Description: "The property used to sort the list of results.\nAvailable values: \"host\", \"created\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("host", "created"), diff --git a/internal/services/web_analytics_site/model.go b/internal/services/web_analytics_site/model.go index 82ef1f48db..b71e9e1d17 100644 --- a/internal/services/web_analytics_site/model.go +++ b/internal/services/web_analytics_site/model.go @@ -18,7 +18,9 @@ type WebAnalyticsSiteModel struct { SiteTag types.String `tfsdk:"site_tag" json:"site_tag,computed"` AccountID types.String `tfsdk:"account_id" path:"account_id,required"` AutoInstall types.Bool `tfsdk:"auto_install" json:"auto_install,optional"` + Enabled types.Bool `tfsdk:"enabled" json:"enabled,optional"` Host types.String `tfsdk:"host" json:"host,optional"` + Lite types.Bool `tfsdk:"lite" json:"lite,optional"` ZoneTag types.String `tfsdk:"zone_tag" json:"zone_tag,optional"` Created timetypes.RFC3339 `tfsdk:"created" json:"created,computed" format:"date-time"` SiteToken types.String `tfsdk:"site_token" json:"site_token,computed"` diff --git a/internal/services/web_analytics_site/schema.go b/internal/services/web_analytics_site/schema.go index 60a60d1f45..b7675146d0 100644 --- a/internal/services/web_analytics_site/schema.go +++ b/internal/services/web_analytics_site/schema.go @@ -37,10 +37,18 @@ func ResourceSchema(ctx context.Context) schema.Schema { Description: "If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.", Optional: true, }, + "enabled": schema.BoolAttribute{ + Description: "Enables or disables RUM. This option can be used only when auto_install is set to true.", + Optional: true, + }, "host": schema.StringAttribute{ Description: "The hostname to use for gray-clouded sites.", Optional: true, }, + "lite": schema.BoolAttribute{ + Description: "If enabled, the JavaScript snippet will not be injected for visitors from the EU.", + Optional: true, + }, "zone_tag": schema.StringAttribute{ Description: "The zone identifier.", Optional: true, diff --git a/internal/services/workers_deployment/data_source_schema.go b/internal/services/workers_deployment/data_source_schema.go index 0e707292e0..5f850769d5 100644 --- a/internal/services/workers_deployment/data_source_schema.go +++ b/internal/services/workers_deployment/data_source_schema.go @@ -32,7 +32,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "strategy": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"percentage\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("percentage"), }, diff --git a/internal/services/workers_deployment/schema.go b/internal/services/workers_deployment/schema.go index d4969fd876..4cd9b9f062 100644 --- a/internal/services/workers_deployment/schema.go +++ b/internal/services/workers_deployment/schema.go @@ -37,7 +37,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "strategy": schema.StringAttribute{ - Required: true, + Description: "Available values: \"percentage\".", + Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("percentage"), }, @@ -87,7 +88,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "strategy": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"percentage\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("percentage"), }, diff --git a/internal/services/workers_kv_namespace/data_source_schema.go b/internal/services/workers_kv_namespace/data_source_schema.go index 93a05c0bbc..7f3ed4ee21 100644 --- a/internal/services/workers_kv_namespace/data_source_schema.go +++ b/internal/services/workers_kv_namespace/data_source_schema.go @@ -42,14 +42,14 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "Direction to order namespaces.", + Description: "Direction to order namespaces.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), }, }, "order": schema.StringAttribute{ - Description: "Field to order results by.", + Description: "Field to order results by.\nAvailable values: \"id\", \"title\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("id", "title"), diff --git a/internal/services/workers_kv_namespace/list_data_source_schema.go b/internal/services/workers_kv_namespace/list_data_source_schema.go index f52f5f28b5..24abf4b1a9 100644 --- a/internal/services/workers_kv_namespace/list_data_source_schema.go +++ b/internal/services/workers_kv_namespace/list_data_source_schema.go @@ -23,14 +23,14 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "direction": schema.StringAttribute{ - Description: "Direction to order namespaces.", + Description: "Direction to order namespaces.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), }, }, "order": schema.StringAttribute{ - Description: "Field to order results by.", + Description: "Field to order results by.\nAvailable values: \"id\", \"title\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("id", "title"), diff --git a/internal/services/workers_script/list_data_source_schema.go b/internal/services/workers_script/list_data_source_schema.go index 211681c37b..d82ee06bc7 100644 --- a/internal/services/workers_script/list_data_source_schema.go +++ b/internal/services/workers_script/list_data_source_schema.go @@ -72,14 +72,14 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[WorkersScriptsPlacementDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "mode": schema.StringAttribute{ - Description: "Enables [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).", + Description: "Enables [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).\nAvailable values: \"smart\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("smart"), }, }, "status": schema.StringAttribute{ - Description: "Status of [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).", + Description: "Status of [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).\nAvailable values: \"SUCCESS\", \"UNSUPPORTED_APPLICATION\", \"INSUFFICIENT_INVOCATIONS\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -92,14 +92,14 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "placement_mode": schema.StringAttribute{ - Description: "Enables [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).", + Description: "Enables [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).\nAvailable values: \"smart\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("smart"), }, }, "placement_status": schema.StringAttribute{ - Description: "Status of [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).", + Description: "Status of [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).\nAvailable values: \"SUCCESS\", \"UNSUPPORTED_APPLICATION\", \"INSUFFICIENT_INVOCATIONS\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -131,7 +131,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "usage_model": schema.StringAttribute{ - Description: "Usage model for the Worker invocations.", + Description: "Usage model for the Worker invocations.\nAvailable values: \"standard\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("standard"), diff --git a/internal/services/workers_script/schema.go b/internal/services/workers_script/schema.go index 70163d71a0..bffb057dff 100644 --- a/internal/services/workers_script/schema.go +++ b/internal/services/workers_script/schema.go @@ -37,319 +37,379 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, - "content": schema.StringAttribute{ - Description: "Module or Service Worker contents of the Worker.", + "metadata": schema.SingleNestedAttribute{ + Description: "JSON encoded metadata about the uploaded parts and Worker configuration.", Required: true, - }, - "assets": schema.SingleNestedAttribute{ - Description: "Configuration for assets within a Worker", - Optional: true, - CustomType: customfield.NewNestedObjectType[WorkersScriptMetadataAssetsModel](ctx), Attributes: map[string]schema.Attribute{ - "config": schema.SingleNestedAttribute{ - Description: "Configuration for assets within a Worker.", + "assets": schema.SingleNestedAttribute{ + Description: "Configuration for assets within a Worker", Optional: true, Attributes: map[string]schema.Attribute{ - "html_handling": schema.StringAttribute{ - Description: "Determines the redirects and rewrites of requests for HTML content.", - Optional: true, - Validators: []validator.String{ - stringvalidator.OneOfCaseInsensitive( - "auto-trailing-slash", - "force-trailing-slash", - "drop-trailing-slash", - "none", - ), - }, - }, - "not_found_handling": schema.StringAttribute{ - Description: "Determines the response when a request does not match a static asset, and there is no Worker script.", + "config": schema.SingleNestedAttribute{ + Description: "Configuration for assets within a Worker.", Optional: true, - Validators: []validator.String{ - stringvalidator.OneOfCaseInsensitive( - "none", - "404-page", - "single-page-application", - ), + Attributes: map[string]schema.Attribute{ + "html_handling": schema.StringAttribute{ + Description: "Determines the redirects and rewrites of requests for HTML content.\nAvailable values: \"auto-trailing-slash\", \"force-trailing-slash\", \"drop-trailing-slash\", \"none\".", + Optional: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "auto-trailing-slash", + "force-trailing-slash", + "drop-trailing-slash", + "none", + ), + }, + }, + "not_found_handling": schema.StringAttribute{ + Description: "Determines the response when a request does not match a static asset, and there is no Worker script.\nAvailable values: \"none\", \"404-page\", \"single-page-application\".", + Optional: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "none", + "404-page", + "single-page-application", + ), + }, + }, + "run_worker_first": schema.BoolAttribute{ + Description: "When true, requests will always invoke the Worker script. Otherwise, attempt to serve an asset matching the request, falling back to the Worker script.", + Computed: true, + Optional: true, + Default: booldefault.StaticBool(false), + }, + "serve_directly": schema.BoolAttribute{ + Description: "When true and the incoming request matches an asset, that will be served instead of invoking the Worker script. When false, requests will always invoke the Worker script.", + Computed: true, + Optional: true, + Default: booldefault.StaticBool(true), + }, }, }, - "run_worker_first": schema.BoolAttribute{ - Description: "When true, requests will always invoke the Worker script. Otherwise, attempt to serve an asset matching the request, falling back to the Worker script.", - Computed: true, - Optional: true, - Default: booldefault.StaticBool(false), - }, - "serve_directly": schema.BoolAttribute{ - Description: "When true and the incoming request matches an asset, that will be served instead of invoking the Worker script. When false, requests will always invoke the Worker script.", - Computed: true, + "jwt": schema.StringAttribute{ + Description: "Token provided upon successful upload of all files from a registered manifest.", Optional: true, - Default: booldefault.StaticBool(true), }, }, }, - "jwt": schema.StringAttribute{ - Description: "Token provided upon successful upload of all files from a registered manifest.", + "bindings": schema.ListNestedAttribute{ + Description: "List of bindings attached to a Worker. You can find more about bindings on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings.", Optional: true, - }, - }, - }, - "bindings": schema.ListNestedAttribute{ - Description: "List of bindings attached to a Worker. You can find more about bindings on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings.", - Optional: true, - Computed: true, - CustomType: customfield.NewNestedObjectListType[WorkersScriptMetadataBindingsModel](ctx), - NestedObject: schema.NestedAttributeObject{ - Attributes: map[string]schema.Attribute{ - "name": schema.StringAttribute{ - Description: "A JavaScript variable name for the binding.", - Required: true, - }, - "type": schema.StringAttribute{ - Description: "The kind of resource that the binding provides.", - Required: true, - }, - "dataset": schema.StringAttribute{ - Description: "The dataset name to bind to.", - Optional: true, - }, - "id": schema.StringAttribute{ - Description: "Identifier of the D1 database to bind to.", - Optional: true, - }, - "namespace": schema.StringAttribute{ - Description: "Namespace to bind to.", - Optional: true, - }, - "outbound": schema.SingleNestedAttribute{ - Description: "Outbound worker.", - Optional: true, + NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ - "params": schema.ListAttribute{ - Description: "Pass information from the Dispatch Worker to the Outbound Worker through the parameters.", + "name": schema.StringAttribute{ + Description: "A JavaScript variable name for the binding.", + Required: true, + }, + "type": schema.StringAttribute{ + Description: "The kind of resource that the binding provides.", + Required: true, + }, + "dataset": schema.StringAttribute{ + Description: "The name of the dataset to bind to.", + Optional: true, + }, + "id": schema.StringAttribute{ + Description: "Identifier of the D1 database to bind to.", Optional: true, - ElementType: types.StringType, }, - "worker": schema.SingleNestedAttribute{ + "namespace": schema.StringAttribute{ + Description: "Namespace to bind to.", + Optional: true, + }, + "outbound": schema.SingleNestedAttribute{ Description: "Outbound worker.", Optional: true, Attributes: map[string]schema.Attribute{ - "environment": schema.StringAttribute{ - Description: "Environment of the outbound worker.", + "params": schema.ListAttribute{ + Description: "Pass information from the Dispatch Worker to the Outbound Worker through the parameters.", Optional: true, + ElementType: types.StringType, }, - "service": schema.StringAttribute{ - Description: "Name of the outbound worker.", + "worker": schema.SingleNestedAttribute{ + Description: "Outbound worker.", Optional: true, + Attributes: map[string]schema.Attribute{ + "environment": schema.StringAttribute{ + Description: "Environment of the outbound worker.", + Optional: true, + }, + "service": schema.StringAttribute{ + Description: "Name of the outbound worker.", + Optional: true, + }, + }, }, }, }, + "class_name": schema.StringAttribute{ + Description: "The exported class name of the Durable Object.", + Optional: true, + }, + "environment": schema.StringAttribute{ + Description: "The environment of the script_name to bind to.", + Optional: true, + }, + "namespace_id": schema.StringAttribute{ + Description: "Namespace identifier tag.", + Optional: true, + }, + "script_name": schema.StringAttribute{ + Description: "The script where the Durable Object is defined, if it is external to this Worker.", + Optional: true, + }, + "json": schema.StringAttribute{ + Description: "JSON data to use.", + Optional: true, + }, + "certificate_id": schema.StringAttribute{ + Description: "Identifier of the certificate to bind to.", + Optional: true, + }, + "text": schema.StringAttribute{ + Description: "The text value to use.", + Optional: true, + }, + "queue_name": schema.StringAttribute{ + Description: "Name of the Queue to bind to.", + Optional: true, + }, + "bucket_name": schema.StringAttribute{ + Description: "R2 bucket to bind to.", + Optional: true, + }, + "service": schema.StringAttribute{ + Description: "Name of Worker to bind to.", + Optional: true, + }, + "index_name": schema.StringAttribute{ + Description: "Name of the Vectorize index to bind to.", + Optional: true, + }, }, }, - "class_name": schema.StringAttribute{ - Description: "The exported class name of the Durable Object.", - Optional: true, - }, - "environment": schema.StringAttribute{ - Description: "The environment of the script_name to bind to.", - Optional: true, - }, - "namespace_id": schema.StringAttribute{ - Description: "Namespace identifier tag.", - Optional: true, - }, - "script_name": schema.StringAttribute{ - Description: "The script where the Durable Object is defined, if it is external to this Worker.", - Optional: true, - }, - "json": schema.StringAttribute{ - Description: "JSON data to use.", - Optional: true, - }, - "certificate_id": schema.StringAttribute{ - Description: "Identifier of the certificate to bind to.", - Optional: true, - }, - "text": schema.StringAttribute{ - Description: "The text value to use.", - Optional: true, - }, - "queue_name": schema.StringAttribute{ - Description: "Name of the Queue to bind to.", - Optional: true, - }, - "bucket_name": schema.StringAttribute{ - Description: "R2 bucket to bind to.", - Optional: true, - }, - "service": schema.StringAttribute{ - Description: "Name of Worker to bind to.", - Optional: true, - }, - "index_name": schema.StringAttribute{ - Description: "Name of the Vectorize index to bind to.", - Optional: true, - }, }, - }, - }, - "body_part": schema.StringAttribute{ - Description: "Name of the part in the multipart request that contains the script (e.g. the file adding a listener to the `fetch` event). Indicates a `service worker syntax` Worker.", - Optional: true, - }, - "compatibility_date": schema.StringAttribute{ - Description: "Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.", - Optional: true, - }, - "compatibility_flags": schema.ListAttribute{ - Description: "Flags that enable or disable certain features in the Workers runtime. Used to enable upcoming features or opt in or out of specific changes not included in a `compatibility_date`.", - Optional: true, - ElementType: types.StringType, - }, - "keep_assets": schema.BoolAttribute{ - Description: "Retain assets which exist for a previously uploaded Worker version; used in lieu of providing a completion token.", - Optional: true, - }, - "keep_bindings": schema.ListAttribute{ - Description: "List of binding types to keep from previous_upload.", - Optional: true, - ElementType: types.StringType, - }, - "main_module": schema.StringAttribute{ - Description: "Name of the part in the multipart request that contains the main module (e.g. the file exporting a `fetch` handler). Indicates a `module syntax` Worker.", - Optional: true, - }, - "migrations": schema.SingleNestedAttribute{ - Description: "Migrations to apply for Durable Objects associated with this Worker.", - Optional: true, - Computed: true, - CustomType: customfield.NewNestedObjectType[WorkersScriptMetadataMigrationsModel](ctx), - Attributes: map[string]schema.Attribute{ - "deleted_classes": schema.ListAttribute{ - Description: "A list of classes to delete Durable Object namespaces from.", + "body_part": schema.StringAttribute{ + Description: "Name of the part in the multipart request that contains the script (e.g. the file adding a listener to the `fetch` event). Indicates a `service worker syntax` Worker.", + Optional: true, + }, + "compatibility_date": schema.StringAttribute{ + Description: "Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.", Optional: true, - ElementType: types.StringType, }, - "new_classes": schema.ListAttribute{ - Description: "A list of classes to create Durable Object namespaces from.", + "compatibility_flags": schema.ListAttribute{ + Description: "Flags that enable or disable certain features in the Workers runtime. Used to enable upcoming features or opt in or out of specific changes not included in a `compatibility_date`.", Optional: true, ElementType: types.StringType, }, - "new_sqlite_classes": schema.ListAttribute{ - Description: "A list of classes to create Durable Object namespaces with SQLite from.", + "keep_assets": schema.BoolAttribute{ + Description: "Retain assets which exist for a previously uploaded Worker version; used in lieu of providing a completion token.", + Optional: true, + }, + "keep_bindings": schema.ListAttribute{ + Description: "List of binding types to keep from previous_upload.", Optional: true, ElementType: types.StringType, }, - "new_tag": schema.StringAttribute{ - Description: "Tag to set as the latest migration tag.", + "logpush": schema.BoolAttribute{ + Description: "Whether Logpush is turned on for the Worker.", Optional: true, }, - "old_tag": schema.StringAttribute{ - Description: "Tag used to verify against the latest migration tag for this Worker. If they don't match, the upload is rejected.", + "main_module": schema.StringAttribute{ + Description: "Name of the part in the multipart request that contains the main module (e.g. the file exporting a `fetch` handler). Indicates a `module syntax` Worker.", Optional: true, }, - "renamed_classes": schema.ListNestedAttribute{ - Description: "A list of classes with Durable Object namespaces that were renamed.", + "migrations": schema.SingleNestedAttribute{ + Description: "Migrations to apply for Durable Objects associated with this Worker.", Optional: true, - NestedObject: schema.NestedAttributeObject{ - Attributes: map[string]schema.Attribute{ - "from": schema.StringAttribute{ - Optional: true, + Attributes: map[string]schema.Attribute{ + "deleted_classes": schema.ListAttribute{ + Description: "A list of classes to delete Durable Object namespaces from.", + Optional: true, + ElementType: types.StringType, + }, + "new_classes": schema.ListAttribute{ + Description: "A list of classes to create Durable Object namespaces from.", + Optional: true, + ElementType: types.StringType, + }, + "new_sqlite_classes": schema.ListAttribute{ + Description: "A list of classes to create Durable Object namespaces with SQLite from.", + Optional: true, + ElementType: types.StringType, + }, + "new_tag": schema.StringAttribute{ + Description: "Tag to set as the latest migration tag.", + Optional: true, + }, + "old_tag": schema.StringAttribute{ + Description: "Tag used to verify against the latest migration tag for this Worker. If they don't match, the upload is rejected.", + Optional: true, + }, + "renamed_classes": schema.ListNestedAttribute{ + Description: "A list of classes with Durable Object namespaces that were renamed.", + Optional: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "from": schema.StringAttribute{ + Optional: true, + }, + "to": schema.StringAttribute{ + Optional: true, + }, + }, + }, + }, + "transferred_classes": schema.ListNestedAttribute{ + Description: "A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.", + Optional: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "from": schema.StringAttribute{ + Optional: true, + }, + "from_script": schema.StringAttribute{ + Optional: true, + }, + "to": schema.StringAttribute{ + Optional: true, + }, + }, }, - "to": schema.StringAttribute{ - Optional: true, + }, + "steps": schema.ListNestedAttribute{ + Description: "Migrations to apply in order.", + Optional: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "deleted_classes": schema.ListAttribute{ + Description: "A list of classes to delete Durable Object namespaces from.", + Optional: true, + ElementType: types.StringType, + }, + "new_classes": schema.ListAttribute{ + Description: "A list of classes to create Durable Object namespaces from.", + Optional: true, + ElementType: types.StringType, + }, + "new_sqlite_classes": schema.ListAttribute{ + Description: "A list of classes to create Durable Object namespaces with SQLite from.", + Optional: true, + ElementType: types.StringType, + }, + "renamed_classes": schema.ListNestedAttribute{ + Description: "A list of classes with Durable Object namespaces that were renamed.", + Optional: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "from": schema.StringAttribute{ + Optional: true, + }, + "to": schema.StringAttribute{ + Optional: true, + }, + }, + }, + }, + "transferred_classes": schema.ListNestedAttribute{ + Description: "A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.", + Optional: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "from": schema.StringAttribute{ + Optional: true, + }, + "from_script": schema.StringAttribute{ + Optional: true, + }, + "to": schema.StringAttribute{ + Optional: true, + }, + }, + }, + }, + }, }, }, }, }, - "transferred_classes": schema.ListNestedAttribute{ - Description: "A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.", + "observability": schema.SingleNestedAttribute{ + Description: "Observability settings for the Worker.", Optional: true, - NestedObject: schema.NestedAttributeObject{ - Attributes: map[string]schema.Attribute{ - "from": schema.StringAttribute{ - Optional: true, - }, - "from_script": schema.StringAttribute{ - Optional: true, + Attributes: map[string]schema.Attribute{ + "enabled": schema.BoolAttribute{ + Description: "Whether observability is enabled for the Worker.", + Required: true, + }, + "head_sampling_rate": schema.Float64Attribute{ + Description: "The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.", + Optional: true, + }, + }, + }, + "placement": schema.SingleNestedAttribute{ + Description: "Configuration for [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).", + Optional: true, + Attributes: map[string]schema.Attribute{ + "mode": schema.StringAttribute{ + Description: "Enables [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).\nAvailable values: \"smart\".", + Optional: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive("smart"), }, - "to": schema.StringAttribute{ - Optional: true, + }, + "status": schema.StringAttribute{ + Description: "Status of [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).\nAvailable values: \"SUCCESS\", \"UNSUPPORTED_APPLICATION\", \"INSUFFICIENT_INVOCATIONS\".", + Computed: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "SUCCESS", + "UNSUPPORTED_APPLICATION", + "INSUFFICIENT_INVOCATIONS", + ), }, }, }, }, - "steps": schema.ListNestedAttribute{ - Description: "Migrations to apply in order.", + "tags": schema.ListAttribute{ + Description: "List of strings to use as tags for this Worker.", + Optional: true, + ElementType: types.StringType, + }, + "tail_consumers": schema.ListNestedAttribute{ + Description: "List of Workers that will consume logs from the attached Worker.", Optional: true, NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ - "deleted_classes": schema.ListAttribute{ - Description: "A list of classes to delete Durable Object namespaces from.", - Optional: true, - ElementType: types.StringType, - }, - "new_classes": schema.ListAttribute{ - Description: "A list of classes to create Durable Object namespaces from.", - Optional: true, - ElementType: types.StringType, - }, - "new_sqlite_classes": schema.ListAttribute{ - Description: "A list of classes to create Durable Object namespaces with SQLite from.", - Optional: true, - ElementType: types.StringType, + "service": schema.StringAttribute{ + Description: "Name of Worker that is to be the consumer.", + Required: true, }, - "renamed_classes": schema.ListNestedAttribute{ - Description: "A list of classes with Durable Object namespaces that were renamed.", + "environment": schema.StringAttribute{ + Description: "Optional environment if the Worker utilizes one.", Optional: true, - NestedObject: schema.NestedAttributeObject{ - Attributes: map[string]schema.Attribute{ - "from": schema.StringAttribute{ - Optional: true, - }, - "to": schema.StringAttribute{ - Optional: true, - }, - }, - }, }, - "transferred_classes": schema.ListNestedAttribute{ - Description: "A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.", + "namespace": schema.StringAttribute{ + Description: "Optional dispatch namespace the script belongs to.", Optional: true, - NestedObject: schema.NestedAttributeObject{ - Attributes: map[string]schema.Attribute{ - "from": schema.StringAttribute{ - Optional: true, - }, - "from_script": schema.StringAttribute{ - Optional: true, - }, - "to": schema.StringAttribute{ - Optional: true, - }, - }, - }, }, }, }, }, - }, - }, - "observability": schema.SingleNestedAttribute{ - Description: "Observability settings for the Worker.", - Optional: true, - Computed: true, - CustomType: customfield.NewNestedObjectType[WorkersScriptMetadataObservabilityModel](ctx), - Attributes: map[string]schema.Attribute{ - "enabled": schema.BoolAttribute{ - Description: "Whether observability is enabled for the Worker.", - Required: true, - }, - "head_sampling_rate": schema.Float64Attribute{ - Description: "The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.", + "usage_model": schema.StringAttribute{ + Description: "Usage model for the Worker invocations.\nAvailable values: \"standard\".", Optional: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive("standard"), + }, }, }, }, + "created_on": schema.StringAttribute{ + Description: "When the script was created.", + Computed: true, + CustomType: timetypes.RFC3339Type{}, + }, "etag": schema.StringAttribute{ Description: "Hashed script content, can be used in a If-None-Match header when updating.", Computed: true, @@ -371,16 +431,29 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, CustomType: timetypes.RFC3339Type{}, }, - "created_on": schema.StringAttribute{ - Description: "When the script was created.", + "placement_mode": schema.StringAttribute{ + Description: "Enables [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).\nAvailable values: \"smart\".", Computed: true, - CustomType: timetypes.RFC3339Type{}, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive("smart"), + }, + }, + "placement_status": schema.StringAttribute{ + Description: "Status of [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).\nAvailable values: \"SUCCESS\", \"UNSUPPORTED_APPLICATION\", \"INSUFFICIENT_INVOCATIONS\".", + Computed: true, + Validators: []validator.String{ + stringvalidator.OneOfCaseInsensitive( + "SUCCESS", + "UNSUPPORTED_APPLICATION", + "INSUFFICIENT_INVOCATIONS", + ), + }, }, "startup_time_ms": schema.Int64Attribute{ Computed: true, }, "usage_model": schema.StringAttribute{ - Description: "Usage model for the Worker invocations.", + Description: "Usage model for the Worker invocations.\nAvailable values: \"standard\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("standard"), @@ -388,21 +461,18 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "placement": schema.SingleNestedAttribute{ Description: "Configuration for [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).", - Optional: true, Computed: true, - CustomType: customfield.NewNestedObjectType[WorkersScriptMetadataPlacementModel](ctx), + CustomType: customfield.NewNestedObjectType[WorkersScriptPlacementModel](ctx), Attributes: map[string]schema.Attribute{ "mode": schema.StringAttribute{ - Description: "Enables [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).", - Optional: true, + Description: "Enables [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).\nAvailable values: \"smart\".", + Computed: true, Validators: []validator.String{ - stringvalidator.OneOfCaseInsensitive( - "smart", - ), + stringvalidator.OneOfCaseInsensitive("smart"), }, }, "status": schema.StringAttribute{ - Description: "Status of [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).", + Description: "Status of [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).\nAvailable values: \"SUCCESS\", \"UNSUPPORTED_APPLICATION\", \"INSUFFICIENT_INVOCATIONS\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -416,22 +486,21 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "tail_consumers": schema.ListNestedAttribute{ Description: "List of Workers that will consume logs from the attached Worker.", - Optional: true, Computed: true, - CustomType: customfield.NewNestedObjectListType[WorkersScriptMetadataTailConsumersModel](ctx), + CustomType: customfield.NewNestedObjectListType[WorkersScriptTailConsumersModel](ctx), NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "service": schema.StringAttribute{ Description: "Name of Worker that is to be the consumer.", - Required: true, + Computed: true, }, "environment": schema.StringAttribute{ Description: "Optional environment if the Worker utilizes one.", - Optional: true, + Computed: true, }, "namespace": schema.StringAttribute{ Description: "Optional dispatch namespace the script belongs to.", - Optional: true, + Computed: true, }, }, }, @@ -446,4 +515,4 @@ func (r *WorkersScriptResource) Schema(ctx context.Context, req resource.SchemaR func (r *WorkersScriptResource) ConfigValidators(_ context.Context) []resource.ConfigValidator { return []resource.ConfigValidator{} -} +} \ No newline at end of file diff --git a/internal/services/workers_secret/data_source_schema.go b/internal/services/workers_secret/data_source_schema.go index d7e288fd6e..9155ae304d 100644 --- a/internal/services/workers_secret/data_source_schema.go +++ b/internal/services/workers_secret/data_source_schema.go @@ -41,7 +41,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The type of secret.", + Description: "The type of secret.\nAvailable values: \"secret_text\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("secret_text"), diff --git a/internal/services/workers_secret/list_data_source_schema.go b/internal/services/workers_secret/list_data_source_schema.go index 4659ef6d71..ff5f25def3 100644 --- a/internal/services/workers_secret/list_data_source_schema.go +++ b/internal/services/workers_secret/list_data_source_schema.go @@ -48,7 +48,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The type of secret.", + Description: "The type of secret.\nAvailable values: \"secret_text\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("secret_text"), diff --git a/internal/services/workers_secret/schema.go b/internal/services/workers_secret/schema.go index 0a01fbb1ce..f1fa95af06 100644 --- a/internal/services/workers_secret/schema.go +++ b/internal/services/workers_secret/schema.go @@ -48,7 +48,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "type": schema.StringAttribute{ - Description: "The type of secret to put.", + Description: "The type of secret to put.\nAvailable values: \"secret_text\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("secret_text"), diff --git a/internal/services/zero_trust_access_application/data_source_schema.go b/internal/services/zero_trust_access_application/data_source_schema.go index 155ce0253c..5975541f28 100644 --- a/internal/services/zero_trust_access_application/data_source_schema.go +++ b/internal/services/zero_trust_access_application/data_source_schema.go @@ -152,7 +152,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "self_hosted_domains": schema.ListAttribute{ - Description: "List of public domains that Access will secure. This field is deprecated in favor of `destinations` and will be supported until **November 21, 2025.** If `destinations` are provided, then `self_hosted_domains` will be ignored.\n", + Description: "List of public domains that Access will secure. This field is deprecated in favor of `destinations` and will be supported until **November 21, 2025.** If `destinations` are provided, then `self_hosted_domains` will be ignored.", Computed: true, CustomType: customfield.NewListType[types.String](ctx), ElementType: types.StringType, @@ -226,19 +226,20 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "destinations": schema.ListNestedAttribute{ - Description: "List of destinations secured by Access. This supersedes `self_hosted_domains` to allow for more flexibility in defining different types of domains. If `destinations` are provided, then `self_hosted_domains` will be ignored.\n", + Description: "List of destinations secured by Access. This supersedes `self_hosted_domains` to allow for more flexibility in defining different types of domains. If `destinations` are provided, then `self_hosted_domains` will be ignored.", Computed: true, CustomType: customfield.NewNestedObjectListType[ZeroTrustAccessApplicationDestinationsDataSourceModel](ctx), NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"public\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("public", "private"), }, }, "uri": schema.StringAttribute{ - Description: "The URI of the destination. Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/).\n", + Description: "The URI of the destination. Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/).", Computed: true, }, "cidr": schema.StringAttribute{ @@ -250,14 +251,14 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "l4_protocol": schema.StringAttribute{ - Description: "The L4 protocol of the destination. When omitted, both UDP and TCP traffic will match.", + Description: "The L4 protocol of the destination. When omitted, both UDP and TCP traffic will match.\nAvailable values: \"tcp\", \"udp\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("tcp", "udp"), }, }, "port_range": schema.StringAttribute{ - Description: "The port range of the destination. Can be a single port or a range of ports. When omitted, all ports will match.\n", + Description: "The port range of the destination. Can be a single port or a range of ports. When omitted, all ports will match.", Computed: true, }, "vnet_id": schema.StringAttribute{ @@ -355,7 +356,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "decision": schema.StringAttribute{ - Description: "The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.", + Description: "The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.\nAvailable values: \"allow\", \"deny\", \"non_identity\", \"bypass\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -1194,7 +1195,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustAccessApplicationSaaSAppDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "auth_type": schema.StringAttribute{ - Description: "Optional identifier indicating the authentication protocol used for the saas app. Required for OIDC. Default if unset is \"saml\"", + Description: "Optional identifier indicating the authentication protocol used for the saas app. Required for OIDC. Default if unset is \"saml\"\nAvailable values: \"saml\", \"oidc\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("saml", "oidc"), @@ -1222,7 +1223,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "name_format": schema.StringAttribute{ - Description: "A globally unique name for an identity or service provider.", + Description: "A globally unique name for an identity or service provider.\nAvailable values: \"urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified\", \"urn:oasis:names:tc:SAML:2.0:attrname-format:basic\", \"urn:oasis:names:tc:SAML:2.0:attrname-format:uri\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -1275,14 +1276,14 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "name_id_format": schema.StringAttribute{ - Description: "The format of the name identifier sent to the SaaS application.", + Description: "The format of the name identifier sent to the SaaS application.\nAvailable values: \"id\", \"email\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("id", "email"), }, }, "name_id_transform_jsonata": schema.StringAttribute{ - Description: "A [JSONata](https://jsonata.org/) expression that transforms an application's user identities into a NameID value for its SAML assertion. This expression should evaluate to a singular string. The output of this expression can override the `name_id_format` setting.\n", + Description: "A [JSONata](https://jsonata.org/) expression that transforms an application's user identities into a NameID value for its SAML assertion. This expression should evaluate to a singular string. The output of this expression can override the `name_id_format` setting.", Computed: true, }, "public_key": schema.StringAttribute{ @@ -1290,7 +1291,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "saml_attribute_transform_jsonata": schema.StringAttribute{ - Description: "A [JSONata] (https://jsonata.org/) expression that transforms an application's user identities into attribute assertions in the SAML response. The expression can transform id, email, name, and groups values. It can also transform fields listed in the saml_attributes or oidc_fields of the identity provider used to authenticate. The output of this expression must be a JSON object.\n", + Description: "A [JSONata] (https://jsonata.org/) expression that transforms an application's user identities into attribute assertions in the SAML response. The expression can transform id, email, name, and groups values. It can also transform fields listed in the saml_attributes or oidc_fields of the identity provider used to authenticate. The output of this expression must be a JSON object.", Computed: true, }, "sp_entity_id": schema.StringAttribute{ @@ -1339,7 +1340,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "scope": schema.StringAttribute{ - Description: "The scope of the claim.", + Description: "The scope of the claim.\nAvailable values: \"groups\", \"profile\", \"email\", \"openid\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -1461,7 +1462,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "scheme": schema.StringAttribute{ - Description: "The authentication scheme to use when making SCIM requests to this application.", + Description: "The authentication scheme to use when making SCIM requests to this application.\nAvailable values: \"httpbasic\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -1550,7 +1551,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "strictness": schema.StringAttribute{ - Description: "The level of adherence to outbound resource schemas when provisioning to this mapping. ‘Strict’ removes unknown values, while ‘passthrough’ passes unknown values to the target.", + Description: "The level of adherence to outbound resource schemas when provisioning to this mapping. ‘Strict’ removes unknown values, while ‘passthrough’ passes unknown values to the target.\nAvailable values: \"strict\", \"passthrough\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("strict", "passthrough"), @@ -1575,7 +1576,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "protocol": schema.StringAttribute{ - Description: "The communication protocol your application secures.", + Description: "The communication protocol your application secures.\nAvailable values: \"ssh\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("ssh"), diff --git a/internal/services/zero_trust_access_application/list_data_source_schema.go b/internal/services/zero_trust_access_application/list_data_source_schema.go index 6f1cba7ae3..94d9b74239 100644 --- a/internal/services/zero_trust_access_application/list_data_source_schema.go +++ b/internal/services/zero_trust_access_application/list_data_source_schema.go @@ -180,19 +180,20 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "destinations": schema.ListNestedAttribute{ - Description: "List of destinations secured by Access. This supersedes `self_hosted_domains` to allow for more flexibility in defining different types of domains. If `destinations` are provided, then `self_hosted_domains` will be ignored.\n", + Description: "List of destinations secured by Access. This supersedes `self_hosted_domains` to allow for more flexibility in defining different types of domains. If `destinations` are provided, then `self_hosted_domains` will be ignored.", Computed: true, CustomType: customfield.NewNestedObjectListType[ZeroTrustAccessApplicationsDestinationsDataSourceModel](ctx), NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"public\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("public", "private"), }, }, "uri": schema.StringAttribute{ - Description: "The URI of the destination. Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/).\n", + Description: "The URI of the destination. Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/).", Computed: true, }, "cidr": schema.StringAttribute{ @@ -204,14 +205,14 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "l4_protocol": schema.StringAttribute{ - Description: "The L4 protocol of the destination. When omitted, both UDP and TCP traffic will match.", + Description: "The L4 protocol of the destination. When omitted, both UDP and TCP traffic will match.\nAvailable values: \"tcp\", \"udp\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("tcp", "udp"), }, }, "port_range": schema.StringAttribute{ - Description: "The port range of the destination. Can be a single port or a range of ports. When omitted, all ports will match.\n", + Description: "The port range of the destination. Can be a single port or a range of ports. When omitted, all ports will match.", Computed: true, }, "vnet_id": schema.StringAttribute{ @@ -289,7 +290,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "decision": schema.StringAttribute{ - Description: "The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.", + Description: "The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.\nAvailable values: \"allow\", \"deny\", \"non_identity\", \"bypass\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -1150,7 +1151,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "scheme": schema.StringAttribute{ - Description: "The authentication scheme to use when making SCIM requests to this application.", + Description: "The authentication scheme to use when making SCIM requests to this application.\nAvailable values: \"httpbasic\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -1239,7 +1240,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "strictness": schema.StringAttribute{ - Description: "The level of adherence to outbound resource schemas when provisioning to this mapping. ‘Strict’ removes unknown values, while ‘passthrough’ passes unknown values to the target.", + Description: "The level of adherence to outbound resource schemas when provisioning to this mapping. ‘Strict’ removes unknown values, while ‘passthrough’ passes unknown values to the target.\nAvailable values: \"strict\", \"passthrough\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("strict", "passthrough"), @@ -1255,7 +1256,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "self_hosted_domains": schema.ListAttribute{ - Description: "List of public domains that Access will secure. This field is deprecated in favor of `destinations` and will be supported until **November 21, 2025.** If `destinations` are provided, then `self_hosted_domains` will be ignored.\n", + Description: "List of public domains that Access will secure. This field is deprecated in favor of `destinations` and will be supported until **November 21, 2025.** If `destinations` are provided, then `self_hosted_domains` will be ignored.", Computed: true, CustomType: customfield.NewListType[types.String](ctx), ElementType: types.StringType, @@ -1287,7 +1288,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustAccessApplicationsSaaSAppDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "auth_type": schema.StringAttribute{ - Description: "Optional identifier indicating the authentication protocol used for the saas app. Required for OIDC. Default if unset is \"saml\"", + Description: "Optional identifier indicating the authentication protocol used for the saas app. Required for OIDC. Default if unset is \"saml\"\nAvailable values: \"saml\", \"oidc\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("saml", "oidc"), @@ -1315,7 +1316,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "name_format": schema.StringAttribute{ - Description: "A globally unique name for an identity or service provider.", + Description: "A globally unique name for an identity or service provider.\nAvailable values: \"urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified\", \"urn:oasis:names:tc:SAML:2.0:attrname-format:basic\", \"urn:oasis:names:tc:SAML:2.0:attrname-format:uri\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -1368,14 +1369,14 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "name_id_format": schema.StringAttribute{ - Description: "The format of the name identifier sent to the SaaS application.", + Description: "The format of the name identifier sent to the SaaS application.\nAvailable values: \"id\", \"email\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("id", "email"), }, }, "name_id_transform_jsonata": schema.StringAttribute{ - Description: "A [JSONata](https://jsonata.org/) expression that transforms an application's user identities into a NameID value for its SAML assertion. This expression should evaluate to a singular string. The output of this expression can override the `name_id_format` setting.\n", + Description: "A [JSONata](https://jsonata.org/) expression that transforms an application's user identities into a NameID value for its SAML assertion. This expression should evaluate to a singular string. The output of this expression can override the `name_id_format` setting.", Computed: true, }, "public_key": schema.StringAttribute{ @@ -1383,7 +1384,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "saml_attribute_transform_jsonata": schema.StringAttribute{ - Description: "A [JSONata] (https://jsonata.org/) expression that transforms an application's user identities into attribute assertions in the SAML response. The expression can transform id, email, name, and groups values. It can also transform fields listed in the saml_attributes or oidc_fields of the identity provider used to authenticate. The output of this expression must be a JSON object.\n", + Description: "A [JSONata] (https://jsonata.org/) expression that transforms an application's user identities into attribute assertions in the SAML response. The expression can transform id, email, name, and groups values. It can also transform fields listed in the saml_attributes or oidc_fields of the identity provider used to authenticate. The output of this expression must be a JSON object.", Computed: true, }, "sp_entity_id": schema.StringAttribute{ @@ -1432,7 +1433,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "scope": schema.StringAttribute{ - Description: "The scope of the claim.", + Description: "The scope of the claim.\nAvailable values: \"groups\", \"profile\", \"email\", \"openid\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -1601,7 +1602,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "protocol": schema.StringAttribute{ - Description: "The communication protocol your application secures.", + Description: "The communication protocol your application secures.\nAvailable values: \"ssh\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("ssh"), diff --git a/internal/services/zero_trust_access_application/schema.go b/internal/services/zero_trust_access_application/schema.go index c554dc2364..8b8d57300c 100644 --- a/internal/services/zero_trust_access_application/schema.go +++ b/internal/services/zero_trust_access_application/schema.go @@ -111,7 +111,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "self_hosted_domains": schema.ListAttribute{ - Description: "List of public domains that Access will secure. This field is deprecated in favor of `destinations` and will be supported until **November 21, 2025.** If `destinations` are provided, then `self_hosted_domains` will be ignored.\n", + Description: "List of public domains that Access will secure. This field is deprecated in favor of `destinations` and will be supported until **November 21, 2025.** If `destinations` are provided, then `self_hosted_domains` will be ignored.", Optional: true, ElementType: types.StringType, }, @@ -223,20 +223,21 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "destinations": schema.ListNestedAttribute{ - Description: "List of destinations secured by Access. This supersedes `self_hosted_domains` to allow for more flexibility in defining different types of domains. If `destinations` are provided, then `self_hosted_domains` will be ignored.\n", + Description: "List of destinations secured by Access. This supersedes `self_hosted_domains` to allow for more flexibility in defining different types of domains. If `destinations` are provided, then `self_hosted_domains` will be ignored.", Computed: true, Optional: true, CustomType: customfield.NewNestedObjectListType[ZeroTrustAccessApplicationDestinationsModel](ctx), NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "type": schema.StringAttribute{ - Optional: true, + Description: "Available values: \"public\".", + Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("public", "private"), }, }, "uri": schema.StringAttribute{ - Description: "The URI of the destination. Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/).\n", + Description: "The URI of the destination. Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/).", Optional: true, }, "cidr": schema.StringAttribute{ @@ -248,14 +249,14 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "l4_protocol": schema.StringAttribute{ - Description: "The L4 protocol of the destination. When omitted, both UDP and TCP traffic will match.", + Description: "The L4 protocol of the destination. When omitted, both UDP and TCP traffic will match.\nAvailable values: \"tcp\", \"udp\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("tcp", "udp"), }, }, "port_range": schema.StringAttribute{ - Description: "The port range of the destination. Can be a single port or a range of ports. When omitted, all ports will match.\n", + Description: "The port range of the destination. Can be a single port or a range of ports. When omitted, all ports will match.", Optional: true, }, "vnet_id": schema.StringAttribute{ @@ -329,7 +330,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "decision": schema.StringAttribute{ - Description: "The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.", + Description: "The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.\nAvailable values: \"allow\", \"deny\", \"non_identity\", \"bypass\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -1197,8 +1198,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustAccessApplicationSaaSAppModel](ctx), Attributes: map[string]schema.Attribute{ "auth_type": schema.StringAttribute{ - Description: "Optional identifier indicating the authentication protocol used for the saas app. Required for OIDC. Default if unset is \"saml\"", Computed: true, + Description: "Optional identifier indicating the authentication protocol used for the saas app. Required for OIDC. Default if unset is \"saml\"\nAvailable values: \"saml\", \"oidc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("saml", "oidc"), @@ -1227,7 +1228,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "name_format": schema.StringAttribute{ - Description: "A globally unique name for an identity or service provider.", + Description: "A globally unique name for an identity or service provider.\nAvailable values: \"urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified\", \"urn:oasis:names:tc:SAML:2.0:attrname-format:basic\", \"urn:oasis:names:tc:SAML:2.0:attrname-format:uri\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -1283,14 +1284,14 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "name_id_format": schema.StringAttribute{ - Description: "The format of the name identifier sent to the SaaS application.", + Description: "The format of the name identifier sent to the SaaS application.\nAvailable values: \"id\", \"email\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("id", "email"), }, }, "name_id_transform_jsonata": schema.StringAttribute{ - Description: "A [JSONata](https://jsonata.org/) expression that transforms an application's user identities into a NameID value for its SAML assertion. This expression should evaluate to a singular string. The output of this expression can override the `name_id_format` setting.\n", + Description: "A [JSONata](https://jsonata.org/) expression that transforms an application's user identities into a NameID value for its SAML assertion. This expression should evaluate to a singular string. The output of this expression can override the `name_id_format` setting.", Optional: true, }, "public_key": schema.StringAttribute{ @@ -1299,7 +1300,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "saml_attribute_transform_jsonata": schema.StringAttribute{ - Description: "A [JSONata] (https://jsonata.org/) expression that transforms an application's user identities into attribute assertions in the SAML response. The expression can transform id, email, name, and groups values. It can also transform fields listed in the saml_attributes or oidc_fields of the identity provider used to authenticate. The output of this expression must be a JSON object.\n", + Description: "A [JSONata] (https://jsonata.org/) expression that transforms an application's user identities into attribute assertions in the SAML response. The expression can transform id, email, name, and groups values. It can also transform fields listed in the saml_attributes or oidc_fields of the identity provider used to authenticate. The output of this expression must be a JSON object.", Optional: true, }, "sp_entity_id": schema.StringAttribute{ @@ -1352,7 +1353,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "scope": schema.StringAttribute{ - Description: "The scope of the claim.", + Description: "The scope of the claim.\nAvailable values: \"groups\", \"profile\", \"email\", \"openid\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -1475,7 +1476,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "scheme": schema.StringAttribute{ - Description: "The authentication scheme to use when making SCIM requests to this application.", + Description: "The authentication scheme to use when making SCIM requests to this application.\nAvailable values: \"httpbasic\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -1565,7 +1566,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "strictness": schema.StringAttribute{ - Description: "The level of adherence to outbound resource schemas when provisioning to this mapping. ‘Strict’ removes unknown values, while ‘passthrough’ passes unknown values to the target.", + Description: "The level of adherence to outbound resource schemas when provisioning to this mapping. ‘Strict’ removes unknown values, while ‘passthrough’ passes unknown values to the target.\nAvailable values: \"strict\", \"passthrough\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("strict", "passthrough"), @@ -1591,7 +1592,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "protocol": schema.StringAttribute{ - Description: "The communication protocol your application secures.", + Description: "The communication protocol your application secures.\nAvailable values: \"ssh\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("ssh"), diff --git a/internal/services/zero_trust_access_custom_page/data_source_schema.go b/internal/services/zero_trust_access_custom_page/data_source_schema.go index 08d0383bdc..a653d9399c 100644 --- a/internal/services/zero_trust_access_custom_page/data_source_schema.go +++ b/internal/services/zero_trust_access_custom_page/data_source_schema.go @@ -46,7 +46,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "Custom page type.", + Description: "Custom page type.\nAvailable values: \"identity_denied\", \"forbidden\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("identity_denied", "forbidden"), diff --git a/internal/services/zero_trust_access_custom_page/list_data_source_schema.go b/internal/services/zero_trust_access_custom_page/list_data_source_schema.go index 97862e1fdd..612406a8cd 100644 --- a/internal/services/zero_trust_access_custom_page/list_data_source_schema.go +++ b/internal/services/zero_trust_access_custom_page/list_data_source_schema.go @@ -41,7 +41,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "Custom page type.", + Description: "Custom page type.\nAvailable values: \"identity_denied\", \"forbidden\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("identity_denied", "forbidden"), diff --git a/internal/services/zero_trust_access_custom_page/schema.go b/internal/services/zero_trust_access_custom_page/schema.go index dcfa60fc71..8c7250d32e 100644 --- a/internal/services/zero_trust_access_custom_page/schema.go +++ b/internal/services/zero_trust_access_custom_page/schema.go @@ -42,7 +42,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "type": schema.StringAttribute{ - Description: "Custom page type.", + Description: "Custom page type.\nAvailable values: \"identity_denied\", \"forbidden\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("identity_denied", "forbidden"), diff --git a/internal/services/zero_trust_access_identity_provider/data_source_schema.go b/internal/services/zero_trust_access_identity_provider/data_source_schema.go index 6848cef0d0..21698b4109 100644 --- a/internal/services/zero_trust_access_identity_provider/data_source_schema.go +++ b/internal/services/zero_trust_access_identity_provider/data_source_schema.go @@ -41,7 +41,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The type of identity provider. To determine the value for a specific provider, refer to our [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).", + Description: "The type of identity provider. To determine the value for a specific provider, refer to our [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).\nAvailable values: \"onetimepin\", \"azureAD\", \"saml\", \"centrify\", \"facebook\", \"github\", \"google-apps\", \"google\", \"linkedin\", \"oidc\", \"okta\", \"onelogin\", \"pingone\", \"yandex\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -94,7 +94,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "prompt": schema.StringAttribute{ - Description: "Indicates the type of user interaction that is required. prompt=login forces the user to enter their credentials on that request, negating single-sign on. prompt=none is the opposite. It ensures that the user isn't presented with any interactive prompt. If the request can't be completed silently by using single-sign on, the Microsoft identity platform returns an interaction_required error. prompt=select_account interrupts single sign-on providing account selection experience listing all the accounts either in session or any remembered account or an option to choose to use a different account altogether.", + Description: "Indicates the type of user interaction that is required. prompt=login forces the user to enter their credentials on that request, negating single-sign on. prompt=none is the opposite. It ensures that the user isn't presented with any interactive prompt. If the request can't be completed silently by using single-sign on, the Microsoft identity platform returns an interaction_required error. prompt=select_account interrupts single sign-on providing account selection experience listing all the accounts either in session or any remembered account or an option to choose to use a different account altogether.\nAvailable values: \"login\", \"select_account\", \"none\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -218,7 +218,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "identity_update_behavior": schema.StringAttribute{ - Description: "Indicates how a SCIM event updates a user identity used for policy evaluation. Use \"automatic\" to automatically update a user's identity and augment it with fields from the SCIM user resource. Use \"reauth\" to force re-authentication on group membership updates, user identity update will only occur after successful re-authentication. With \"reauth\" identities will not contain fields from the SCIM user resource. With \"no_action\" identities will not be changed by SCIM updates in any way and users will not be prompted to reauthenticate.", + Description: "Indicates how a SCIM event updates a user identity used for policy evaluation. Use \"automatic\" to automatically update a user's identity and augment it with fields from the SCIM user resource. Use \"reauth\" to force re-authentication on group membership updates, user identity update will only occur after successful re-authentication. With \"reauth\" identities will not contain fields from the SCIM user resource. With \"no_action\" identities will not be changed by SCIM updates in any way and users will not be prompted to reauthenticate.\nAvailable values: \"automatic\", \"reauth\", \"no_action\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_access_identity_provider/list_data_source_schema.go b/internal/services/zero_trust_access_identity_provider/list_data_source_schema.go index cba957a534..0bcb837978 100644 --- a/internal/services/zero_trust_access_identity_provider/list_data_source_schema.go +++ b/internal/services/zero_trust_access_identity_provider/list_data_source_schema.go @@ -78,7 +78,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "prompt": schema.StringAttribute{ - Description: "Indicates the type of user interaction that is required. prompt=login forces the user to enter their credentials on that request, negating single-sign on. prompt=none is the opposite. It ensures that the user isn't presented with any interactive prompt. If the request can't be completed silently by using single-sign on, the Microsoft identity platform returns an interaction_required error. prompt=select_account interrupts single sign-on providing account selection experience listing all the accounts either in session or any remembered account or an option to choose to use a different account altogether.", + Description: "Indicates the type of user interaction that is required. prompt=login forces the user to enter their credentials on that request, negating single-sign on. prompt=none is the opposite. It ensures that the user isn't presented with any interactive prompt. If the request can't be completed silently by using single-sign on, the Microsoft identity platform returns an interaction_required error. prompt=select_account interrupts single sign-on providing account selection experience listing all the accounts either in session or any remembered account or an option to choose to use a different account altogether.\nAvailable values: \"login\", \"select_account\", \"none\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -194,7 +194,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The type of identity provider. To determine the value for a specific provider, refer to our [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).", + Description: "The type of identity provider. To determine the value for a specific provider, refer to our [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).\nAvailable values: \"onetimepin\", \"azureAD\", \"saml\", \"centrify\", \"facebook\", \"github\", \"google-apps\", \"google\", \"linkedin\", \"oidc\", \"okta\", \"onelogin\", \"pingone\", \"yandex\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -229,7 +229,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "identity_update_behavior": schema.StringAttribute{ - Description: "Indicates how a SCIM event updates a user identity used for policy evaluation. Use \"automatic\" to automatically update a user's identity and augment it with fields from the SCIM user resource. Use \"reauth\" to force re-authentication on group membership updates, user identity update will only occur after successful re-authentication. With \"reauth\" identities will not contain fields from the SCIM user resource. With \"no_action\" identities will not be changed by SCIM updates in any way and users will not be prompted to reauthenticate.", + Description: "Indicates how a SCIM event updates a user identity used for policy evaluation. Use \"automatic\" to automatically update a user's identity and augment it with fields from the SCIM user resource. Use \"reauth\" to force re-authentication on group membership updates, user identity update will only occur after successful re-authentication. With \"reauth\" identities will not contain fields from the SCIM user resource. With \"no_action\" identities will not be changed by SCIM updates in any way and users will not be prompted to reauthenticate.\nAvailable values: \"automatic\", \"reauth\", \"no_action\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_access_identity_provider/schema.go b/internal/services/zero_trust_access_identity_provider/schema.go index e59bdf5595..ff3f752668 100644 --- a/internal/services/zero_trust_access_identity_provider/schema.go +++ b/internal/services/zero_trust_access_identity_provider/schema.go @@ -40,7 +40,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "type": schema.StringAttribute{ - Description: "The type of identity provider. To determine the value for a specific provider, refer to our [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).", + Description: "The type of identity provider. To determine the value for a specific provider, refer to our [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).\nAvailable values: \"onetimepin\", \"azureAD\", \"saml\", \"centrify\", \"facebook\", \"github\", \"google-apps\", \"google\", \"linkedin\", \"oidc\", \"okta\", \"onelogin\", \"pingone\", \"yandex\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -91,7 +91,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "prompt": schema.StringAttribute{ - Description: "Indicates the type of user interaction that is required. prompt=login forces the user to enter their credentials on that request, negating single-sign on. prompt=none is the opposite. It ensures that the user isn't presented with any interactive prompt. If the request can't be completed silently by using single-sign on, the Microsoft identity platform returns an interaction_required error. prompt=select_account interrupts single sign-on providing account selection experience listing all the accounts either in session or any remembered account or an option to choose to use a different account altogether.", + Description: "Indicates the type of user interaction that is required. prompt=login forces the user to enter their credentials on that request, negating single-sign on. prompt=none is the opposite. It ensures that the user isn't presented with any interactive prompt. If the request can't be completed silently by using single-sign on, the Microsoft identity platform returns an interaction_required error. prompt=select_account interrupts single sign-on providing account selection experience listing all the accounts either in session or any remembered account or an option to choose to use a different account altogether.\nAvailable values: \"login\", \"select_account\", \"none\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -212,7 +212,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "identity_update_behavior": schema.StringAttribute{ - Description: "Indicates how a SCIM event updates a user identity used for policy evaluation. Use \"automatic\" to automatically update a user's identity and augment it with fields from the SCIM user resource. Use \"reauth\" to force re-authentication on group membership updates, user identity update will only occur after successful re-authentication. With \"reauth\" identities will not contain fields from the SCIM user resource. With \"no_action\" identities will not be changed by SCIM updates in any way and users will not be prompted to reauthenticate.", + Description: "Indicates how a SCIM event updates a user identity used for policy evaluation. Use \"automatic\" to automatically update a user's identity and augment it with fields from the SCIM user resource. Use \"reauth\" to force re-authentication on group membership updates, user identity update will only occur after successful re-authentication. With \"reauth\" identities will not contain fields from the SCIM user resource. With \"no_action\" identities will not be changed by SCIM updates in any way and users will not be prompted to reauthenticate.\nAvailable values: \"automatic\", \"reauth\", \"no_action\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_access_infrastructure_target/data_source_schema.go b/internal/services/zero_trust_access_infrastructure_target/data_source_schema.go index 728b2532be..d39dc4f41f 100644 --- a/internal/services/zero_trust_access_infrastructure_target/data_source_schema.go +++ b/internal/services/zero_trust_access_infrastructure_target/data_source_schema.go @@ -98,7 +98,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "direction": schema.StringAttribute{ - Description: "The sorting direction.", + Description: "The sorting direction.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), @@ -156,7 +156,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "order": schema.StringAttribute{ - Description: "The field to sort by.", + Description: "The field to sort by.\nAvailable values: \"hostname\", \"created_at\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("hostname", "created_at"), diff --git a/internal/services/zero_trust_access_infrastructure_target/list_data_source_schema.go b/internal/services/zero_trust_access_infrastructure_target/list_data_source_schema.go index 172d2b455a..b762d82379 100644 --- a/internal/services/zero_trust_access_infrastructure_target/list_data_source_schema.go +++ b/internal/services/zero_trust_access_infrastructure_target/list_data_source_schema.go @@ -35,7 +35,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "direction": schema.StringAttribute{ - Description: "The sorting direction.", + Description: "The sorting direction.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), @@ -88,7 +88,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "order": schema.StringAttribute{ - Description: "The field to sort by.", + Description: "The field to sort by.\nAvailable values: \"hostname\", \"created_at\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("hostname", "created_at"), diff --git a/internal/services/zero_trust_access_policy/data_source_schema.go b/internal/services/zero_trust_access_policy/data_source_schema.go index 4bc6240f4c..714be70c7e 100644 --- a/internal/services/zero_trust_access_policy/data_source_schema.go +++ b/internal/services/zero_trust_access_policy/data_source_schema.go @@ -45,7 +45,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "decision": schema.StringAttribute{ - Description: "The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.", + Description: "The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.\nAvailable values: \"allow\", \"deny\", \"non_identity\", \"bypass\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_access_policy/list_data_source_schema.go b/internal/services/zero_trust_access_policy/list_data_source_schema.go index 56b2255b86..102cfaa736 100644 --- a/internal/services/zero_trust_access_policy/list_data_source_schema.go +++ b/internal/services/zero_trust_access_policy/list_data_source_schema.go @@ -81,7 +81,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "decision": schema.StringAttribute{ - Description: "The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.", + Description: "The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.\nAvailable values: \"allow\", \"deny\", \"non_identity\", \"bypass\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_access_policy/schema.go b/internal/services/zero_trust_access_policy/schema.go index 6c5b747157..b7dc2b0cf8 100644 --- a/internal/services/zero_trust_access_policy/schema.go +++ b/internal/services/zero_trust_access_policy/schema.go @@ -35,7 +35,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "decision": schema.StringAttribute{ - Description: "The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.", + Description: "The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.\nAvailable values: \"allow\", \"deny\", \"non_identity\", \"bypass\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_device_custom_profile/data_source_model.go b/internal/services/zero_trust_device_custom_profile/data_source_model.go index ddb7097214..4abf1f7ee3 100644 --- a/internal/services/zero_trust_device_custom_profile/data_source_model.go +++ b/internal/services/zero_trust_device_custom_profile/data_source_model.go @@ -17,33 +17,35 @@ type ZeroTrustDeviceCustomProfileResultDataSourceEnvelope struct { } type ZeroTrustDeviceCustomProfileDataSourceModel struct { - ID types.String `tfsdk:"id" json:"-,computed"` - PolicyID types.String `tfsdk:"policy_id" path:"policy_id,computed_optional"` - AccountID types.String `tfsdk:"account_id" path:"account_id,required"` - AllowModeSwitch types.Bool `tfsdk:"allow_mode_switch" json:"allow_mode_switch,computed"` - AllowUpdates types.Bool `tfsdk:"allow_updates" json:"allow_updates,computed"` - AllowedToLeave types.Bool `tfsdk:"allowed_to_leave" json:"allowed_to_leave,computed"` - AutoConnect types.Float64 `tfsdk:"auto_connect" json:"auto_connect,computed"` - CaptivePortal types.Float64 `tfsdk:"captive_portal" json:"captive_portal,computed"` - Default types.Bool `tfsdk:"default" json:"default,computed"` - Description types.String `tfsdk:"description" json:"description,computed"` - DisableAutoFallback types.Bool `tfsdk:"disable_auto_fallback" json:"disable_auto_fallback,computed"` - Enabled types.Bool `tfsdk:"enabled" json:"enabled,computed"` - ExcludeOfficeIPs types.Bool `tfsdk:"exclude_office_ips" json:"exclude_office_ips,computed"` - GatewayUniqueID types.String `tfsdk:"gateway_unique_id" json:"gateway_unique_id,computed"` - LANAllowMinutes types.Float64 `tfsdk:"lan_allow_minutes" json:"lan_allow_minutes,computed"` - LANAllowSubnetSize types.Float64 `tfsdk:"lan_allow_subnet_size" json:"lan_allow_subnet_size,computed"` - Match types.String `tfsdk:"match" json:"match,computed"` - Name types.String `tfsdk:"name" json:"name,computed"` - Precedence types.Float64 `tfsdk:"precedence" json:"precedence,computed"` - SupportURL types.String `tfsdk:"support_url" json:"support_url,computed"` - SwitchLocked types.Bool `tfsdk:"switch_locked" json:"switch_locked,computed"` - TunnelProtocol types.String `tfsdk:"tunnel_protocol" json:"tunnel_protocol,computed"` - Exclude customfield.NestedObjectList[ZeroTrustDeviceCustomProfileExcludeDataSourceModel] `tfsdk:"exclude" json:"exclude,computed"` - FallbackDomains customfield.NestedObjectList[ZeroTrustDeviceCustomProfileFallbackDomainsDataSourceModel] `tfsdk:"fallback_domains" json:"fallback_domains,computed"` - Include customfield.NestedObjectList[ZeroTrustDeviceCustomProfileIncludeDataSourceModel] `tfsdk:"include" json:"include,computed"` - ServiceModeV2 customfield.NestedObject[ZeroTrustDeviceCustomProfileServiceModeV2DataSourceModel] `tfsdk:"service_mode_v2" json:"service_mode_v2,computed"` - TargetTests customfield.NestedObjectList[ZeroTrustDeviceCustomProfileTargetTestsDataSourceModel] `tfsdk:"target_tests" json:"target_tests,computed"` + ID types.String `tfsdk:"id" json:"-,computed"` + PolicyID types.String `tfsdk:"policy_id" path:"policy_id,computed_optional"` + AccountID types.String `tfsdk:"account_id" path:"account_id,required"` + AllowModeSwitch types.Bool `tfsdk:"allow_mode_switch" json:"allow_mode_switch,computed"` + AllowUpdates types.Bool `tfsdk:"allow_updates" json:"allow_updates,computed"` + AllowedToLeave types.Bool `tfsdk:"allowed_to_leave" json:"allowed_to_leave,computed"` + AutoConnect types.Float64 `tfsdk:"auto_connect" json:"auto_connect,computed"` + CaptivePortal types.Float64 `tfsdk:"captive_portal" json:"captive_portal,computed"` + Default types.Bool `tfsdk:"default" json:"default,computed"` + Description types.String `tfsdk:"description" json:"description,computed"` + DisableAutoFallback types.Bool `tfsdk:"disable_auto_fallback" json:"disable_auto_fallback,computed"` + DOHInTunnel types.Bool `tfsdk:"doh_in_tunnel" json:"doh_in_tunnel,computed"` + Enabled types.Bool `tfsdk:"enabled" json:"enabled,computed"` + ExcludeOfficeIPs types.Bool `tfsdk:"exclude_office_ips" json:"exclude_office_ips,computed"` + GatewayUniqueID types.String `tfsdk:"gateway_unique_id" json:"gateway_unique_id,computed"` + LANAllowMinutes types.Float64 `tfsdk:"lan_allow_minutes" json:"lan_allow_minutes,computed"` + LANAllowSubnetSize types.Float64 `tfsdk:"lan_allow_subnet_size" json:"lan_allow_subnet_size,computed"` + Match types.String `tfsdk:"match" json:"match,computed"` + Name types.String `tfsdk:"name" json:"name,computed"` + Precedence types.Float64 `tfsdk:"precedence" json:"precedence,computed"` + RegisterInterfaceIPWithDNS types.Bool `tfsdk:"register_interface_ip_with_dns" json:"register_interface_ip_with_dns,computed"` + SupportURL types.String `tfsdk:"support_url" json:"support_url,computed"` + SwitchLocked types.Bool `tfsdk:"switch_locked" json:"switch_locked,computed"` + TunnelProtocol types.String `tfsdk:"tunnel_protocol" json:"tunnel_protocol,computed"` + Exclude customfield.NestedObjectList[ZeroTrustDeviceCustomProfileExcludeDataSourceModel] `tfsdk:"exclude" json:"exclude,computed"` + FallbackDomains customfield.NestedObjectList[ZeroTrustDeviceCustomProfileFallbackDomainsDataSourceModel] `tfsdk:"fallback_domains" json:"fallback_domains,computed"` + Include customfield.NestedObjectList[ZeroTrustDeviceCustomProfileIncludeDataSourceModel] `tfsdk:"include" json:"include,computed"` + ServiceModeV2 customfield.NestedObject[ZeroTrustDeviceCustomProfileServiceModeV2DataSourceModel] `tfsdk:"service_mode_v2" json:"service_mode_v2,computed"` + TargetTests customfield.NestedObjectList[ZeroTrustDeviceCustomProfileTargetTestsDataSourceModel] `tfsdk:"target_tests" json:"target_tests,computed"` } func (m *ZeroTrustDeviceCustomProfileDataSourceModel) toReadParams(_ context.Context) (params zero_trust.DevicePolicyCustomGetParams, diags diag.Diagnostics) { diff --git a/internal/services/zero_trust_device_custom_profile/data_source_schema.go b/internal/services/zero_trust_device_custom_profile/data_source_schema.go index bdfecb3053..63a87ac082 100644 --- a/internal/services/zero_trust_device_custom_profile/data_source_schema.go +++ b/internal/services/zero_trust_device_custom_profile/data_source_schema.go @@ -60,6 +60,10 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Description: "If the `dns_server` field of a fallback domain is not present, the client will fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`.", Computed: true, }, + "doh_in_tunnel": schema.BoolAttribute{ + Description: "Determines how the WARP client sends DNS requests to Cloudflare Gateway. When `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, the DoH connection operates outside of the WARP tunnel.", + Computed: true, + }, "enabled": schema.BoolAttribute{ Description: "Whether the policy will be applied to matching devices.", Computed: true, @@ -91,6 +95,10 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Description: "The precedence of the policy. Lower values indicate higher precedence. Policies will be evaluated in ascending order of this field.", Computed: true, }, + "register_interface_ip_with_dns": schema.BoolAttribute{ + Description: "Determines if the operating system will register WARP's local interface IP with your on-premises DNS server.", + Computed: true, + }, "support_url": schema.StringAttribute{ Description: "The URL to launch when the Send Feedback button is clicked.", Computed: true, diff --git a/internal/services/zero_trust_device_custom_profile/list_data_source_model.go b/internal/services/zero_trust_device_custom_profile/list_data_source_model.go index 21f256a0cc..dbb5e88825 100644 --- a/internal/services/zero_trust_device_custom_profile/list_data_source_model.go +++ b/internal/services/zero_trust_device_custom_profile/list_data_source_model.go @@ -31,31 +31,33 @@ func (m *ZeroTrustDeviceCustomProfilesDataSourceModel) toListParams(_ context.Co } type ZeroTrustDeviceCustomProfilesResultDataSourceModel struct { - AllowModeSwitch types.Bool `tfsdk:"allow_mode_switch" json:"allow_mode_switch,computed"` - AllowUpdates types.Bool `tfsdk:"allow_updates" json:"allow_updates,computed"` - AllowedToLeave types.Bool `tfsdk:"allowed_to_leave" json:"allowed_to_leave,computed"` - AutoConnect types.Float64 `tfsdk:"auto_connect" json:"auto_connect,computed"` - CaptivePortal types.Float64 `tfsdk:"captive_portal" json:"captive_portal,computed"` - Default types.Bool `tfsdk:"default" json:"default,computed"` - Description types.String `tfsdk:"description" json:"description,computed"` - DisableAutoFallback types.Bool `tfsdk:"disable_auto_fallback" json:"disable_auto_fallback,computed"` - Enabled types.Bool `tfsdk:"enabled" json:"enabled,computed"` - Exclude customfield.NestedObjectList[ZeroTrustDeviceCustomProfilesExcludeDataSourceModel] `tfsdk:"exclude" json:"exclude,computed"` - ExcludeOfficeIPs types.Bool `tfsdk:"exclude_office_ips" json:"exclude_office_ips,computed"` - FallbackDomains customfield.NestedObjectList[ZeroTrustDeviceCustomProfilesFallbackDomainsDataSourceModel] `tfsdk:"fallback_domains" json:"fallback_domains,computed"` - GatewayUniqueID types.String `tfsdk:"gateway_unique_id" json:"gateway_unique_id,computed"` - Include customfield.NestedObjectList[ZeroTrustDeviceCustomProfilesIncludeDataSourceModel] `tfsdk:"include" json:"include,computed"` - LANAllowMinutes types.Float64 `tfsdk:"lan_allow_minutes" json:"lan_allow_minutes,computed"` - LANAllowSubnetSize types.Float64 `tfsdk:"lan_allow_subnet_size" json:"lan_allow_subnet_size,computed"` - Match types.String `tfsdk:"match" json:"match,computed"` - Name types.String `tfsdk:"name" json:"name,computed"` - PolicyID types.String `tfsdk:"policy_id" json:"policy_id,computed"` - Precedence types.Float64 `tfsdk:"precedence" json:"precedence,computed"` - ServiceModeV2 customfield.NestedObject[ZeroTrustDeviceCustomProfilesServiceModeV2DataSourceModel] `tfsdk:"service_mode_v2" json:"service_mode_v2,computed"` - SupportURL types.String `tfsdk:"support_url" json:"support_url,computed"` - SwitchLocked types.Bool `tfsdk:"switch_locked" json:"switch_locked,computed"` - TargetTests customfield.NestedObjectList[ZeroTrustDeviceCustomProfilesTargetTestsDataSourceModel] `tfsdk:"target_tests" json:"target_tests,computed"` - TunnelProtocol types.String `tfsdk:"tunnel_protocol" json:"tunnel_protocol,computed"` + AllowModeSwitch types.Bool `tfsdk:"allow_mode_switch" json:"allow_mode_switch,computed"` + AllowUpdates types.Bool `tfsdk:"allow_updates" json:"allow_updates,computed"` + AllowedToLeave types.Bool `tfsdk:"allowed_to_leave" json:"allowed_to_leave,computed"` + AutoConnect types.Float64 `tfsdk:"auto_connect" json:"auto_connect,computed"` + CaptivePortal types.Float64 `tfsdk:"captive_portal" json:"captive_portal,computed"` + Default types.Bool `tfsdk:"default" json:"default,computed"` + Description types.String `tfsdk:"description" json:"description,computed"` + DisableAutoFallback types.Bool `tfsdk:"disable_auto_fallback" json:"disable_auto_fallback,computed"` + DOHInTunnel types.Bool `tfsdk:"doh_in_tunnel" json:"doh_in_tunnel,computed"` + Enabled types.Bool `tfsdk:"enabled" json:"enabled,computed"` + Exclude customfield.NestedObjectList[ZeroTrustDeviceCustomProfilesExcludeDataSourceModel] `tfsdk:"exclude" json:"exclude,computed"` + ExcludeOfficeIPs types.Bool `tfsdk:"exclude_office_ips" json:"exclude_office_ips,computed"` + FallbackDomains customfield.NestedObjectList[ZeroTrustDeviceCustomProfilesFallbackDomainsDataSourceModel] `tfsdk:"fallback_domains" json:"fallback_domains,computed"` + GatewayUniqueID types.String `tfsdk:"gateway_unique_id" json:"gateway_unique_id,computed"` + Include customfield.NestedObjectList[ZeroTrustDeviceCustomProfilesIncludeDataSourceModel] `tfsdk:"include" json:"include,computed"` + LANAllowMinutes types.Float64 `tfsdk:"lan_allow_minutes" json:"lan_allow_minutes,computed"` + LANAllowSubnetSize types.Float64 `tfsdk:"lan_allow_subnet_size" json:"lan_allow_subnet_size,computed"` + Match types.String `tfsdk:"match" json:"match,computed"` + Name types.String `tfsdk:"name" json:"name,computed"` + PolicyID types.String `tfsdk:"policy_id" json:"policy_id,computed"` + Precedence types.Float64 `tfsdk:"precedence" json:"precedence,computed"` + RegisterInterfaceIPWithDNS types.Bool `tfsdk:"register_interface_ip_with_dns" json:"register_interface_ip_with_dns,computed"` + ServiceModeV2 customfield.NestedObject[ZeroTrustDeviceCustomProfilesServiceModeV2DataSourceModel] `tfsdk:"service_mode_v2" json:"service_mode_v2,computed"` + SupportURL types.String `tfsdk:"support_url" json:"support_url,computed"` + SwitchLocked types.Bool `tfsdk:"switch_locked" json:"switch_locked,computed"` + TargetTests customfield.NestedObjectList[ZeroTrustDeviceCustomProfilesTargetTestsDataSourceModel] `tfsdk:"target_tests" json:"target_tests,computed"` + TunnelProtocol types.String `tfsdk:"tunnel_protocol" json:"tunnel_protocol,computed"` } type ZeroTrustDeviceCustomProfilesExcludeDataSourceModel struct { diff --git a/internal/services/zero_trust_device_custom_profile/list_data_source_schema.go b/internal/services/zero_trust_device_custom_profile/list_data_source_schema.go index 8883853bee..4dc4f72a67 100644 --- a/internal/services/zero_trust_device_custom_profile/list_data_source_schema.go +++ b/internal/services/zero_trust_device_custom_profile/list_data_source_schema.go @@ -66,6 +66,10 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Description: "If the `dns_server` field of a fallback domain is not present, the client will fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`.", Computed: true, }, + "doh_in_tunnel": schema.BoolAttribute{ + Description: "Determines how the WARP client sends DNS requests to Cloudflare Gateway. When `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, the DoH connection operates outside of the WARP tunnel.", + Computed: true, + }, "enabled": schema.BoolAttribute{ Description: "Whether the policy will be applied to matching devices.", Computed: true, @@ -163,6 +167,10 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Description: "The precedence of the policy. Lower values indicate higher precedence. Policies will be evaluated in ascending order of this field.", Computed: true, }, + "register_interface_ip_with_dns": schema.BoolAttribute{ + Description: "Determines if the operating system will register WARP's local interface IP with your on-premises DNS server.", + Computed: true, + }, "service_mode_v2": schema.SingleNestedAttribute{ Computed: true, CustomType: customfield.NewNestedObjectType[ZeroTrustDeviceCustomProfilesServiceModeV2DataSourceModel](ctx), diff --git a/internal/services/zero_trust_device_custom_profile/model.go b/internal/services/zero_trust_device_custom_profile/model.go index 5244a0d28f..cf386a77f2 100644 --- a/internal/services/zero_trust_device_custom_profile/model.go +++ b/internal/services/zero_trust_device_custom_profile/model.go @@ -13,33 +13,35 @@ type ZeroTrustDeviceCustomProfileResultEnvelope struct { } type ZeroTrustDeviceCustomProfileModel struct { - ID types.String `tfsdk:"id" json:"-,computed"` - PolicyID types.String `tfsdk:"policy_id" json:"policy_id,computed"` - AccountID types.String `tfsdk:"account_id" path:"account_id,required"` - LANAllowMinutes types.Float64 `tfsdk:"lan_allow_minutes" json:"lan_allow_minutes,optional"` - LANAllowSubnetSize types.Float64 `tfsdk:"lan_allow_subnet_size" json:"lan_allow_subnet_size,optional"` - Match types.String `tfsdk:"match" json:"match,required"` - Name types.String `tfsdk:"name" json:"name,required"` - Precedence types.Float64 `tfsdk:"precedence" json:"precedence,required"` - AllowModeSwitch types.Bool `tfsdk:"allow_mode_switch" json:"allow_mode_switch,optional"` - AllowUpdates types.Bool `tfsdk:"allow_updates" json:"allow_updates,optional"` - AllowedToLeave types.Bool `tfsdk:"allowed_to_leave" json:"allowed_to_leave,optional"` - AutoConnect types.Float64 `tfsdk:"auto_connect" json:"auto_connect,optional"` - CaptivePortal types.Float64 `tfsdk:"captive_portal" json:"captive_portal,optional"` - Description types.String `tfsdk:"description" json:"description,optional"` - DisableAutoFallback types.Bool `tfsdk:"disable_auto_fallback" json:"disable_auto_fallback,optional"` - Enabled types.Bool `tfsdk:"enabled" json:"enabled,optional"` - ExcludeOfficeIPs types.Bool `tfsdk:"exclude_office_ips" json:"exclude_office_ips,optional"` - SupportURL types.String `tfsdk:"support_url" json:"support_url,optional"` - SwitchLocked types.Bool `tfsdk:"switch_locked" json:"switch_locked,optional"` - TunnelProtocol types.String `tfsdk:"tunnel_protocol" json:"tunnel_protocol,optional"` - ServiceModeV2 customfield.NestedObject[ZeroTrustDeviceCustomProfileServiceModeV2Model] `tfsdk:"service_mode_v2" json:"service_mode_v2,computed_optional"` - Default types.Bool `tfsdk:"default" json:"default,computed"` - GatewayUniqueID types.String `tfsdk:"gateway_unique_id" json:"gateway_unique_id,computed"` - Exclude customfield.NestedObjectList[ZeroTrustDeviceCustomProfileExcludeModel] `tfsdk:"exclude" json:"exclude,computed"` - FallbackDomains customfield.NestedObjectList[ZeroTrustDeviceCustomProfileFallbackDomainsModel] `tfsdk:"fallback_domains" json:"fallback_domains,computed"` - Include customfield.NestedObjectList[ZeroTrustDeviceCustomProfileIncludeModel] `tfsdk:"include" json:"include,computed"` - TargetTests customfield.NestedObjectList[ZeroTrustDeviceCustomProfileTargetTestsModel] `tfsdk:"target_tests" json:"target_tests,computed"` + ID types.String `tfsdk:"id" json:"-,computed"` + PolicyID types.String `tfsdk:"policy_id" json:"policy_id,computed"` + AccountID types.String `tfsdk:"account_id" path:"account_id,required"` + LANAllowMinutes types.Float64 `tfsdk:"lan_allow_minutes" json:"lan_allow_minutes,optional"` + LANAllowSubnetSize types.Float64 `tfsdk:"lan_allow_subnet_size" json:"lan_allow_subnet_size,optional"` + Match types.String `tfsdk:"match" json:"match,required"` + Name types.String `tfsdk:"name" json:"name,required"` + Precedence types.Float64 `tfsdk:"precedence" json:"precedence,required"` + AllowModeSwitch types.Bool `tfsdk:"allow_mode_switch" json:"allow_mode_switch,optional"` + AllowUpdates types.Bool `tfsdk:"allow_updates" json:"allow_updates,optional"` + AllowedToLeave types.Bool `tfsdk:"allowed_to_leave" json:"allowed_to_leave,optional"` + AutoConnect types.Float64 `tfsdk:"auto_connect" json:"auto_connect,optional"` + CaptivePortal types.Float64 `tfsdk:"captive_portal" json:"captive_portal,optional"` + Description types.String `tfsdk:"description" json:"description,optional"` + DisableAutoFallback types.Bool `tfsdk:"disable_auto_fallback" json:"disable_auto_fallback,optional"` + DOHInTunnel types.Bool `tfsdk:"doh_in_tunnel" json:"doh_in_tunnel,optional"` + Enabled types.Bool `tfsdk:"enabled" json:"enabled,optional"` + ExcludeOfficeIPs types.Bool `tfsdk:"exclude_office_ips" json:"exclude_office_ips,optional"` + RegisterInterfaceIPWithDNS types.Bool `tfsdk:"register_interface_ip_with_dns" json:"register_interface_ip_with_dns,optional"` + SupportURL types.String `tfsdk:"support_url" json:"support_url,optional"` + SwitchLocked types.Bool `tfsdk:"switch_locked" json:"switch_locked,optional"` + TunnelProtocol types.String `tfsdk:"tunnel_protocol" json:"tunnel_protocol,optional"` + ServiceModeV2 customfield.NestedObject[ZeroTrustDeviceCustomProfileServiceModeV2Model] `tfsdk:"service_mode_v2" json:"service_mode_v2,computed_optional"` + Default types.Bool `tfsdk:"default" json:"default,computed"` + GatewayUniqueID types.String `tfsdk:"gateway_unique_id" json:"gateway_unique_id,computed"` + Exclude customfield.NestedObjectList[ZeroTrustDeviceCustomProfileExcludeModel] `tfsdk:"exclude" json:"exclude,computed"` + FallbackDomains customfield.NestedObjectList[ZeroTrustDeviceCustomProfileFallbackDomainsModel] `tfsdk:"fallback_domains" json:"fallback_domains,computed"` + Include customfield.NestedObjectList[ZeroTrustDeviceCustomProfileIncludeModel] `tfsdk:"include" json:"include,computed"` + TargetTests customfield.NestedObjectList[ZeroTrustDeviceCustomProfileTargetTestsModel] `tfsdk:"target_tests" json:"target_tests,computed"` } func (m ZeroTrustDeviceCustomProfileModel) MarshalJSON() (data []byte, err error) { diff --git a/internal/services/zero_trust_device_custom_profile/schema.go b/internal/services/zero_trust_device_custom_profile/schema.go index ed7d691d70..50855c82e6 100644 --- a/internal/services/zero_trust_device_custom_profile/schema.go +++ b/internal/services/zero_trust_device_custom_profile/schema.go @@ -82,6 +82,10 @@ func ResourceSchema(ctx context.Context) schema.Schema { Description: "If the `dns_server` field of a fallback domain is not present, the client will fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`.", Optional: true, }, + "doh_in_tunnel": schema.BoolAttribute{ + Description: "Determines how the WARP client sends DNS requests to Cloudflare Gateway. When `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, the DoH connection operates outside of the WARP tunnel.", + Optional: true, + }, "enabled": schema.BoolAttribute{ Description: "Whether the policy will be applied to matching devices.", Optional: true, @@ -90,6 +94,10 @@ func ResourceSchema(ctx context.Context) schema.Schema { Description: "Whether to add Microsoft IPs to Split Tunnel exclusions.", Optional: true, }, + "register_interface_ip_with_dns": schema.BoolAttribute{ + Description: "Determines if the operating system will register WARP's local interface IP with your on-premises DNS server.", + Optional: true, + }, "support_url": schema.StringAttribute{ Description: "The URL to launch when the Send Feedback button is clicked.", Optional: true, diff --git a/internal/services/zero_trust_device_default_profile/data_source_model.go b/internal/services/zero_trust_device_default_profile/data_source_model.go index adca8b1198..656f4f1eb8 100644 --- a/internal/services/zero_trust_device_default_profile/data_source_model.go +++ b/internal/services/zero_trust_device_default_profile/data_source_model.go @@ -17,24 +17,26 @@ type ZeroTrustDeviceDefaultProfileResultDataSourceEnvelope struct { } type ZeroTrustDeviceDefaultProfileDataSourceModel struct { - AccountID types.String `tfsdk:"account_id" path:"account_id,required"` - AllowModeSwitch types.Bool `tfsdk:"allow_mode_switch" json:"allow_mode_switch,computed"` - AllowUpdates types.Bool `tfsdk:"allow_updates" json:"allow_updates,computed"` - AllowedToLeave types.Bool `tfsdk:"allowed_to_leave" json:"allowed_to_leave,computed"` - AutoConnect types.Float64 `tfsdk:"auto_connect" json:"auto_connect,computed"` - CaptivePortal types.Float64 `tfsdk:"captive_portal" json:"captive_portal,computed"` - Default types.Bool `tfsdk:"default" json:"default,computed"` - DisableAutoFallback types.Bool `tfsdk:"disable_auto_fallback" json:"disable_auto_fallback,computed"` - Enabled types.Bool `tfsdk:"enabled" json:"enabled,computed"` - ExcludeOfficeIPs types.Bool `tfsdk:"exclude_office_ips" json:"exclude_office_ips,computed"` - GatewayUniqueID types.String `tfsdk:"gateway_unique_id" json:"gateway_unique_id,computed"` - SupportURL types.String `tfsdk:"support_url" json:"support_url,computed"` - SwitchLocked types.Bool `tfsdk:"switch_locked" json:"switch_locked,computed"` - TunnelProtocol types.String `tfsdk:"tunnel_protocol" json:"tunnel_protocol,computed"` - Exclude customfield.NestedObjectList[ZeroTrustDeviceDefaultProfileExcludeDataSourceModel] `tfsdk:"exclude" json:"exclude,computed"` - FallbackDomains customfield.NestedObjectList[ZeroTrustDeviceDefaultProfileFallbackDomainsDataSourceModel] `tfsdk:"fallback_domains" json:"fallback_domains,computed"` - Include customfield.NestedObjectList[ZeroTrustDeviceDefaultProfileIncludeDataSourceModel] `tfsdk:"include" json:"include,computed"` - ServiceModeV2 customfield.NestedObject[ZeroTrustDeviceDefaultProfileServiceModeV2DataSourceModel] `tfsdk:"service_mode_v2" json:"service_mode_v2,computed"` + AccountID types.String `tfsdk:"account_id" path:"account_id,required"` + AllowModeSwitch types.Bool `tfsdk:"allow_mode_switch" json:"allow_mode_switch,computed"` + AllowUpdates types.Bool `tfsdk:"allow_updates" json:"allow_updates,computed"` + AllowedToLeave types.Bool `tfsdk:"allowed_to_leave" json:"allowed_to_leave,computed"` + AutoConnect types.Float64 `tfsdk:"auto_connect" json:"auto_connect,computed"` + CaptivePortal types.Float64 `tfsdk:"captive_portal" json:"captive_portal,computed"` + Default types.Bool `tfsdk:"default" json:"default,computed"` + DisableAutoFallback types.Bool `tfsdk:"disable_auto_fallback" json:"disable_auto_fallback,computed"` + DOHInTunnel types.Bool `tfsdk:"doh_in_tunnel" json:"doh_in_tunnel,computed"` + Enabled types.Bool `tfsdk:"enabled" json:"enabled,computed"` + ExcludeOfficeIPs types.Bool `tfsdk:"exclude_office_ips" json:"exclude_office_ips,computed"` + GatewayUniqueID types.String `tfsdk:"gateway_unique_id" json:"gateway_unique_id,computed"` + RegisterInterfaceIPWithDNS types.Bool `tfsdk:"register_interface_ip_with_dns" json:"register_interface_ip_with_dns,computed"` + SupportURL types.String `tfsdk:"support_url" json:"support_url,computed"` + SwitchLocked types.Bool `tfsdk:"switch_locked" json:"switch_locked,computed"` + TunnelProtocol types.String `tfsdk:"tunnel_protocol" json:"tunnel_protocol,computed"` + Exclude customfield.NestedObjectList[ZeroTrustDeviceDefaultProfileExcludeDataSourceModel] `tfsdk:"exclude" json:"exclude,computed"` + FallbackDomains customfield.NestedObjectList[ZeroTrustDeviceDefaultProfileFallbackDomainsDataSourceModel] `tfsdk:"fallback_domains" json:"fallback_domains,computed"` + Include customfield.NestedObjectList[ZeroTrustDeviceDefaultProfileIncludeDataSourceModel] `tfsdk:"include" json:"include,computed"` + ServiceModeV2 customfield.NestedObject[ZeroTrustDeviceDefaultProfileServiceModeV2DataSourceModel] `tfsdk:"service_mode_v2" json:"service_mode_v2,computed"` } func (m *ZeroTrustDeviceDefaultProfileDataSourceModel) toReadParams(_ context.Context) (params zero_trust.DevicePolicyDefaultGetParams, diags diag.Diagnostics) { diff --git a/internal/services/zero_trust_device_default_profile/data_source_schema.go b/internal/services/zero_trust_device_default_profile/data_source_schema.go index befaecc082..0c3a7923d9 100644 --- a/internal/services/zero_trust_device_default_profile/data_source_schema.go +++ b/internal/services/zero_trust_device_default_profile/data_source_schema.go @@ -47,6 +47,10 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Description: "If the `dns_server` field of a fallback domain is not present, the client will fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`.", Computed: true, }, + "doh_in_tunnel": schema.BoolAttribute{ + Description: "Determines how the WARP client sends DNS requests to Cloudflare Gateway. When `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, the DoH connection operates outside of the WARP tunnel.", + Computed: true, + }, "enabled": schema.BoolAttribute{ Description: "Whether the policy will be applied to matching devices.", Computed: true, @@ -58,6 +62,10 @@ func DataSourceSchema(ctx context.Context) schema.Schema { "gateway_unique_id": schema.StringAttribute{ Computed: true, }, + "register_interface_ip_with_dns": schema.BoolAttribute{ + Description: "Determines if the operating system will register WARP's local interface IP with your on-premises DNS server.", + Computed: true, + }, "support_url": schema.StringAttribute{ Description: "The URL to launch when the Send Feedback button is clicked.", Computed: true, diff --git a/internal/services/zero_trust_device_default_profile/model.go b/internal/services/zero_trust_device_default_profile/model.go index 4b06d7ec66..6d3a03c5c0 100644 --- a/internal/services/zero_trust_device_default_profile/model.go +++ b/internal/services/zero_trust_device_default_profile/model.go @@ -13,25 +13,27 @@ type ZeroTrustDeviceDefaultProfileResultEnvelope struct { } type ZeroTrustDeviceDefaultProfileModel struct { - ID types.String `tfsdk:"id" json:"-,computed"` - AccountID types.String `tfsdk:"account_id" path:"account_id,required"` - AllowModeSwitch types.Bool `tfsdk:"allow_mode_switch" json:"allow_mode_switch,optional"` - AllowUpdates types.Bool `tfsdk:"allow_updates" json:"allow_updates,optional"` - AllowedToLeave types.Bool `tfsdk:"allowed_to_leave" json:"allowed_to_leave,optional"` - AutoConnect types.Float64 `tfsdk:"auto_connect" json:"auto_connect,optional"` - CaptivePortal types.Float64 `tfsdk:"captive_portal" json:"captive_portal,optional"` - DisableAutoFallback types.Bool `tfsdk:"disable_auto_fallback" json:"disable_auto_fallback,optional"` - ExcludeOfficeIPs types.Bool `tfsdk:"exclude_office_ips" json:"exclude_office_ips,optional"` - SupportURL types.String `tfsdk:"support_url" json:"support_url,optional"` - SwitchLocked types.Bool `tfsdk:"switch_locked" json:"switch_locked,optional"` - TunnelProtocol types.String `tfsdk:"tunnel_protocol" json:"tunnel_protocol,optional"` - ServiceModeV2 customfield.NestedObject[ZeroTrustDeviceDefaultProfileServiceModeV2Model] `tfsdk:"service_mode_v2" json:"service_mode_v2,computed_optional"` - Default types.Bool `tfsdk:"default" json:"default,computed"` - Enabled types.Bool `tfsdk:"enabled" json:"enabled,computed"` - GatewayUniqueID types.String `tfsdk:"gateway_unique_id" json:"gateway_unique_id,computed"` - Exclude customfield.NestedObjectList[ZeroTrustDeviceDefaultProfileExcludeModel] `tfsdk:"exclude" json:"exclude,computed"` - FallbackDomains customfield.NestedObjectList[ZeroTrustDeviceDefaultProfileFallbackDomainsModel] `tfsdk:"fallback_domains" json:"fallback_domains,computed"` - Include customfield.NestedObjectList[ZeroTrustDeviceDefaultProfileIncludeModel] `tfsdk:"include" json:"include,computed"` + ID types.String `tfsdk:"id" json:"-,computed"` + AccountID types.String `tfsdk:"account_id" path:"account_id,required"` + AllowModeSwitch types.Bool `tfsdk:"allow_mode_switch" json:"allow_mode_switch,optional"` + AllowUpdates types.Bool `tfsdk:"allow_updates" json:"allow_updates,optional"` + AllowedToLeave types.Bool `tfsdk:"allowed_to_leave" json:"allowed_to_leave,optional"` + AutoConnect types.Float64 `tfsdk:"auto_connect" json:"auto_connect,optional"` + CaptivePortal types.Float64 `tfsdk:"captive_portal" json:"captive_portal,optional"` + DisableAutoFallback types.Bool `tfsdk:"disable_auto_fallback" json:"disable_auto_fallback,optional"` + DOHInTunnel types.Bool `tfsdk:"doh_in_tunnel" json:"doh_in_tunnel,optional"` + ExcludeOfficeIPs types.Bool `tfsdk:"exclude_office_ips" json:"exclude_office_ips,optional"` + RegisterInterfaceIPWithDNS types.Bool `tfsdk:"register_interface_ip_with_dns" json:"register_interface_ip_with_dns,optional"` + SupportURL types.String `tfsdk:"support_url" json:"support_url,optional"` + SwitchLocked types.Bool `tfsdk:"switch_locked" json:"switch_locked,optional"` + TunnelProtocol types.String `tfsdk:"tunnel_protocol" json:"tunnel_protocol,optional"` + ServiceModeV2 customfield.NestedObject[ZeroTrustDeviceDefaultProfileServiceModeV2Model] `tfsdk:"service_mode_v2" json:"service_mode_v2,computed_optional"` + Default types.Bool `tfsdk:"default" json:"default,computed"` + Enabled types.Bool `tfsdk:"enabled" json:"enabled,computed"` + GatewayUniqueID types.String `tfsdk:"gateway_unique_id" json:"gateway_unique_id,computed"` + Exclude customfield.NestedObjectList[ZeroTrustDeviceDefaultProfileExcludeModel] `tfsdk:"exclude" json:"exclude,computed"` + FallbackDomains customfield.NestedObjectList[ZeroTrustDeviceDefaultProfileFallbackDomainsModel] `tfsdk:"fallback_domains" json:"fallback_domains,computed"` + Include customfield.NestedObjectList[ZeroTrustDeviceDefaultProfileIncludeModel] `tfsdk:"include" json:"include,computed"` } func (m ZeroTrustDeviceDefaultProfileModel) MarshalJSON() (data []byte, err error) { diff --git a/internal/services/zero_trust_device_default_profile/schema.go b/internal/services/zero_trust_device_default_profile/schema.go index e36e45cfb5..bdcaa12193 100644 --- a/internal/services/zero_trust_device_default_profile/schema.go +++ b/internal/services/zero_trust_device_default_profile/schema.go @@ -50,10 +50,18 @@ func ResourceSchema(ctx context.Context) schema.Schema { Description: "If the `dns_server` field of a fallback domain is not present, the client will fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`.", Optional: true, }, + "doh_in_tunnel": schema.BoolAttribute{ + Description: "Determines how the WARP client sends DNS requests to Cloudflare Gateway. When `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, the DoH connection operates outside of the WARP tunnel.", + Optional: true, + }, "exclude_office_ips": schema.BoolAttribute{ Description: "Whether to add Microsoft IPs to Split Tunnel exclusions.", Optional: true, }, + "register_interface_ip_with_dns": schema.BoolAttribute{ + Description: "Determines if the operating system will register WARP's local interface IP with your on-premises DNS server.", + Optional: true, + }, "support_url": schema.StringAttribute{ Description: "The URL to launch when the Send Feedback button is clicked.", Optional: true, diff --git a/internal/services/zero_trust_device_managed_networks/data_source_schema.go b/internal/services/zero_trust_device_managed_networks/data_source_schema.go index 51ffe332d8..82f6e67fb0 100644 --- a/internal/services/zero_trust_device_managed_networks/data_source_schema.go +++ b/internal/services/zero_trust_device_managed_networks/data_source_schema.go @@ -34,7 +34,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The type of device managed network.", + Description: "The type of device managed network.\nAvailable values: \"tls\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("tls"), diff --git a/internal/services/zero_trust_device_managed_networks/list_data_source_schema.go b/internal/services/zero_trust_device_managed_networks/list_data_source_schema.go index b5636f8a59..3705b9f3e3 100644 --- a/internal/services/zero_trust_device_managed_networks/list_data_source_schema.go +++ b/internal/services/zero_trust_device_managed_networks/list_data_source_schema.go @@ -58,7 +58,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The type of device managed network.", + Description: "The type of device managed network.\nAvailable values: \"tls\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("tls"), diff --git a/internal/services/zero_trust_device_managed_networks/schema.go b/internal/services/zero_trust_device_managed_networks/schema.go index 0438ac0c8f..2298731794 100644 --- a/internal/services/zero_trust_device_managed_networks/schema.go +++ b/internal/services/zero_trust_device_managed_networks/schema.go @@ -36,7 +36,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "type": schema.StringAttribute{ - Description: "The type of device managed network.", + Description: "The type of device managed network.\nAvailable values: \"tls\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("tls"), diff --git a/internal/services/zero_trust_device_posture_integration/data_source_schema.go b/internal/services/zero_trust_device_posture_integration/data_source_schema.go index 2395a7eb49..eb169c3ed6 100644 --- a/internal/services/zero_trust_device_posture_integration/data_source_schema.go +++ b/internal/services/zero_trust_device_posture_integration/data_source_schema.go @@ -37,7 +37,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The type of device posture integration.", + Description: "The type of device posture integration.\nAvailable values: \"workspace_one\", \"crowdstrike_s2s\", \"uptycs\", \"intune\", \"kolide\", \"tanium\", \"sentinelone_s2s\", \"custom_s2s\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_device_posture_integration/list_data_source_schema.go b/internal/services/zero_trust_device_posture_integration/list_data_source_schema.go index d315ce0b20..c7c11d9903 100644 --- a/internal/services/zero_trust_device_posture_integration/list_data_source_schema.go +++ b/internal/services/zero_trust_device_posture_integration/list_data_source_schema.go @@ -66,7 +66,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The type of device posture integration.", + Description: "The type of device posture integration.\nAvailable values: \"workspace_one\", \"crowdstrike_s2s\", \"uptycs\", \"intune\", \"kolide\", \"tanium\", \"sentinelone_s2s\", \"custom_s2s\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_device_posture_integration/schema.go b/internal/services/zero_trust_device_posture_integration/schema.go index ea69d4b249..dafbf3482b 100644 --- a/internal/services/zero_trust_device_posture_integration/schema.go +++ b/internal/services/zero_trust_device_posture_integration/schema.go @@ -36,7 +36,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "type": schema.StringAttribute{ - Description: "The type of device posture integration.", + Description: "The type of device posture integration.\nAvailable values: \"workspace_one\", \"crowdstrike_s2s\", \"uptycs\", \"intune\", \"kolide\", \"tanium\", \"sentinelone_s2s\", \"custom_s2s\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_device_posture_rule/data_source_schema.go b/internal/services/zero_trust_device_posture_rule/data_source_schema.go index 1c9bf0f203..5a1d774531 100644 --- a/internal/services/zero_trust_device_posture_rule/data_source_schema.go +++ b/internal/services/zero_trust_device_posture_rule/data_source_schema.go @@ -47,7 +47,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The type of device posture rule.", + Description: "The type of device posture rule.\nAvailable values: \"file\", \"application\", \"tanium\", \"gateway\", \"warp\", \"disk_encryption\", \"sentinelone\", \"carbonblack\", \"firewall\", \"os_version\", \"domain_joined\", \"client_certificate\", \"client_certificate_v2\", \"unique_client_id\", \"kolide\", \"tanium_s2s\", \"crowdstrike_s2s\", \"intune\", \"workspace_one\", \"sentinelone_s2s\", \"custom_s2s\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -81,7 +81,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustDevicePostureRuleInputDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "operating_system": schema.StringAttribute{ - Description: "Operating system", + Description: "Operating system\nAvailable values: \"windows\", \"linux\", \"mac\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -119,7 +119,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "operator": schema.StringAttribute{ - Description: "operator", + Description: "operator\nAvailable values: \"<\", \"<=\", \">\", \">=\", \"==\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -208,7 +208,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "compliance_status": schema.StringAttribute{ - Description: "Compliance Status", + Description: "Compliance Status\nAvailable values: \"compliant\", \"noncompliant\", \"unknown\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -242,7 +242,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "state": schema.StringAttribute{ - Description: "For more details on state, please refer to the Crowdstrike documentation.", + Description: "For more details on state, please refer to the Crowdstrike documentation.\nAvailable values: \"online\", \"offline\", \"unknown\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -253,7 +253,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "version_operator": schema.StringAttribute{ - Description: "Version Operator", + Description: "Version Operator\nAvailable values: \"<\", \"<=\", \">\", \">=\", \"==\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -266,7 +266,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "count_operator": schema.StringAttribute{ - Description: "Count Operator", + Description: "Count Operator\nAvailable values: \"<\", \"<=\", \">\", \">=\", \"==\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -287,7 +287,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "risk_level": schema.StringAttribute{ - Description: "For more details on risk level, refer to the Tanium documentation.", + Description: "For more details on risk level, refer to the Tanium documentation.\nAvailable values: \"low\", \"medium\", \"high\", \"critical\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -299,7 +299,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "score_operator": schema.StringAttribute{ - Description: "Score Operator", + Description: "Score Operator\nAvailable values: \"<\", \"<=\", \">\", \">=\", \"==\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -328,7 +328,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "network_status": schema.StringAttribute{ - Description: "Network status of device.", + Description: "Network status of device.\nAvailable values: \"connected\", \"disconnected\", \"disconnecting\", \"connecting\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -340,7 +340,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "operational_state": schema.StringAttribute{ - Description: "Agent operational state.", + Description: "Agent operational state.\nAvailable values: \"na\", \"partially_disabled\", \"auto_fully_disabled\", \"fully_disabled\", \"auto_partially_disabled\", \"disabled_error\", \"db_corruption\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -367,7 +367,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "platform": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"windows\", \"mac\", \"linux\", \"android\", \"ios\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "windows", diff --git a/internal/services/zero_trust_device_posture_rule/list_data_source_schema.go b/internal/services/zero_trust_device_posture_rule/list_data_source_schema.go index a8635eafdd..8e2cbbacf3 100644 --- a/internal/services/zero_trust_device_posture_rule/list_data_source_schema.go +++ b/internal/services/zero_trust_device_posture_rule/list_data_source_schema.go @@ -54,7 +54,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustDevicePostureRulesInputDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "operating_system": schema.StringAttribute{ - Description: "Operating system", + Description: "Operating system\nAvailable values: \"windows\", \"linux\", \"mac\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -92,7 +92,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "operator": schema.StringAttribute{ - Description: "operator", + Description: "operator\nAvailable values: \"<\", \"<=\", \">\", \">=\", \"==\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -181,7 +181,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "compliance_status": schema.StringAttribute{ - Description: "Compliance Status", + Description: "Compliance Status\nAvailable values: \"compliant\", \"noncompliant\", \"unknown\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -215,7 +215,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "state": schema.StringAttribute{ - Description: "For more details on state, please refer to the Crowdstrike documentation.", + Description: "For more details on state, please refer to the Crowdstrike documentation.\nAvailable values: \"online\", \"offline\", \"unknown\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -226,7 +226,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "version_operator": schema.StringAttribute{ - Description: "Version Operator", + Description: "Version Operator\nAvailable values: \"<\", \"<=\", \">\", \">=\", \"==\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -239,7 +239,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "count_operator": schema.StringAttribute{ - Description: "Count Operator", + Description: "Count Operator\nAvailable values: \"<\", \"<=\", \">\", \">=\", \"==\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -260,7 +260,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "risk_level": schema.StringAttribute{ - Description: "For more details on risk level, refer to the Tanium documentation.", + Description: "For more details on risk level, refer to the Tanium documentation.\nAvailable values: \"low\", \"medium\", \"high\", \"critical\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -272,7 +272,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "score_operator": schema.StringAttribute{ - Description: "Score Operator", + Description: "Score Operator\nAvailable values: \"<\", \"<=\", \">\", \">=\", \"==\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -301,7 +301,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "network_status": schema.StringAttribute{ - Description: "Network status of device.", + Description: "Network status of device.\nAvailable values: \"connected\", \"disconnected\", \"disconnecting\", \"connecting\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -313,7 +313,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "operational_state": schema.StringAttribute{ - Description: "Agent operational state.", + Description: "Agent operational state.\nAvailable values: \"na\", \"partially_disabled\", \"auto_fully_disabled\", \"fully_disabled\", \"auto_partially_disabled\", \"disabled_error\", \"db_corruption\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -340,7 +340,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "platform": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"windows\", \"mac\", \"linux\", \"android\", \"ios\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "windows", @@ -363,7 +364,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The type of device posture rule.", + Description: "The type of device posture rule.\nAvailable values: \"file\", \"application\", \"tanium\", \"gateway\", \"warp\", \"disk_encryption\", \"sentinelone\", \"carbonblack\", \"firewall\", \"os_version\", \"domain_joined\", \"client_certificate\", \"client_certificate_v2\", \"unique_client_id\", \"kolide\", \"tanium_s2s\", \"crowdstrike_s2s\", \"intune\", \"workspace_one\", \"sentinelone_s2s\", \"custom_s2s\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_device_posture_rule/schema.go b/internal/services/zero_trust_device_posture_rule/schema.go index ff2c110369..f82f134eb3 100644 --- a/internal/services/zero_trust_device_posture_rule/schema.go +++ b/internal/services/zero_trust_device_posture_rule/schema.go @@ -35,7 +35,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "type": schema.StringAttribute{ - Description: "The type of device posture rule.", + Description: "The type of device posture rule.\nAvailable values: \"file\", \"application\", \"tanium\", \"gateway\", \"warp\", \"disk_encryption\", \"sentinelone\", \"carbonblack\", \"firewall\", \"os_version\", \"domain_joined\", \"client_certificate\", \"client_certificate_v2\", \"unique_client_id\", \"kolide\", \"tanium_s2s\", \"crowdstrike_s2s\", \"intune\", \"workspace_one\", \"sentinelone_s2s\", \"custom_s2s\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -82,7 +82,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustDevicePostureRuleInputModel](ctx), Attributes: map[string]schema.Attribute{ "operating_system": schema.StringAttribute{ - Description: "Operating system", + Description: "Operating system\nAvailable values: \"windows\", \"linux\", \"mac\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -120,7 +120,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "operator": schema.StringAttribute{ - Description: "operator", + Description: "operator\nAvailable values: \"<\", \"<=\", \">\", \">=\", \"==\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -206,7 +206,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "compliance_status": schema.StringAttribute{ - Description: "Compliance Status", + Description: "Compliance Status\nAvailable values: \"compliant\", \"noncompliant\", \"unknown\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -240,7 +240,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "state": schema.StringAttribute{ - Description: "For more details on state, please refer to the Crowdstrike documentation.", + Description: "For more details on state, please refer to the Crowdstrike documentation.\nAvailable values: \"online\", \"offline\", \"unknown\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -251,7 +251,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "version_operator": schema.StringAttribute{ - Description: "Version Operator", + Description: "Version Operator\nAvailable values: \"<\", \"<=\", \">\", \">=\", \"==\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -264,7 +264,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "count_operator": schema.StringAttribute{ - Description: "Count Operator", + Description: "Count Operator\nAvailable values: \"<\", \"<=\", \">\", \">=\", \"==\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -285,7 +285,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "risk_level": schema.StringAttribute{ - Description: "For more details on risk level, refer to the Tanium documentation.", + Description: "For more details on risk level, refer to the Tanium documentation.\nAvailable values: \"low\", \"medium\", \"high\", \"critical\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -297,7 +297,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "score_operator": schema.StringAttribute{ - Description: "Score Operator", + Description: "Score Operator\nAvailable values: \"<\", \"<=\", \">\", \">=\", \"==\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -326,7 +326,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "network_status": schema.StringAttribute{ - Description: "Network status of device.", + Description: "Network status of device.\nAvailable values: \"connected\", \"disconnected\", \"disconnecting\", \"connecting\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -338,7 +338,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "operational_state": schema.StringAttribute{ - Description: "Agent operational state.", + Description: "Agent operational state.\nAvailable values: \"na\", \"partially_disabled\", \"auto_fully_disabled\", \"fully_disabled\", \"auto_partially_disabled\", \"disabled_error\", \"db_corruption\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -366,7 +366,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "platform": schema.StringAttribute{ - Optional: true, + Description: "Available values: \"windows\", \"mac\", \"linux\", \"android\", \"ios\".", + Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "windows", diff --git a/internal/services/zero_trust_dlp_custom_profile/data_source_schema.go b/internal/services/zero_trust_dlp_custom_profile/data_source_schema.go index 3081d9d218..1e8b199a86 100644 --- a/internal/services/zero_trust_dlp_custom_profile/data_source_schema.go +++ b/internal/services/zero_trust_dlp_custom_profile/data_source_schema.go @@ -37,7 +37,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "confidence_threshold": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"low\", \"medium\", \"high\", \"very_high\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "low", @@ -72,7 +73,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"custom\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "custom", @@ -134,7 +136,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "validation": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"luhn\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("luhn"), }, @@ -142,7 +145,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"custom\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "custom", @@ -165,10 +169,11 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustDLPCustomProfileEntriesConfidenceDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "ai_context_available": schema.BoolAttribute{ - Computed: true, + Description: "Indicates whether this entry has AI remote service validation", + Computed: true, }, "available": schema.BoolAttribute{ - Description: "Indicates whether this entry can be made more or less sensitive by setting a confidence threshold.\nProfiles that use an entry with `available` set to true can use confidence thresholds", + Description: "Indicates whether this entry has any form of validation that is not an AI remote service", Computed: true, }, }, diff --git a/internal/services/zero_trust_dlp_custom_profile/schema.go b/internal/services/zero_trust_dlp_custom_profile/schema.go index 87291e19ba..f95e44c827 100644 --- a/internal/services/zero_trust_dlp_custom_profile/schema.go +++ b/internal/services/zero_trust_dlp_custom_profile/schema.go @@ -56,7 +56,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "validation": schema.StringAttribute{ - Optional: true, + Description: "Available values: \"luhn\".", + Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("luhn"), }, @@ -131,7 +132,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "entry_type": schema.StringAttribute{ - Required: true, + Description: "Available values: \"custom\".", + Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "custom", @@ -216,7 +218,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "validation": schema.StringAttribute{ - Optional: true, + Description: "Available values: \"luhn\".", + Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("luhn"), }, @@ -244,7 +247,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "entry_type": schema.StringAttribute{ - Required: true, + Description: "Available values: \"custom\".", + Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "custom", @@ -267,7 +271,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"custom\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "custom", diff --git a/internal/services/zero_trust_dlp_dataset/data_source_schema.go b/internal/services/zero_trust_dlp_dataset/data_source_schema.go index 5843716fa9..8e9e0b7c8c 100644 --- a/internal/services/zero_trust_dlp_dataset/data_source_schema.go +++ b/internal/services/zero_trust_dlp_dataset/data_source_schema.go @@ -52,7 +52,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"empty\", \"uploading\", \"processing\", \"failed\", \"complete\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "empty", @@ -83,7 +84,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "upload_status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"empty\", \"uploading\", \"processing\", \"failed\", \"complete\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "empty", @@ -106,7 +108,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"empty\", \"uploading\", \"processing\", \"failed\", \"complete\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "empty", diff --git a/internal/services/zero_trust_dlp_dataset/list_data_source_schema.go b/internal/services/zero_trust_dlp_dataset/list_data_source_schema.go index 2289cedca9..06066cb346 100644 --- a/internal/services/zero_trust_dlp_dataset/list_data_source_schema.go +++ b/internal/services/zero_trust_dlp_dataset/list_data_source_schema.go @@ -53,7 +53,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "upload_status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"empty\", \"uploading\", \"processing\", \"failed\", \"complete\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "empty", @@ -87,7 +88,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"empty\", \"uploading\", \"processing\", \"failed\", \"complete\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "empty", @@ -112,7 +114,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"empty\", \"uploading\", \"processing\", \"failed\", \"complete\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "empty", diff --git a/internal/services/zero_trust_dlp_dataset/schema.go b/internal/services/zero_trust_dlp_dataset/schema.go index ec749b4b23..1010fc4460 100644 --- a/internal/services/zero_trust_dlp_dataset/schema.go +++ b/internal/services/zero_trust_dlp_dataset/schema.go @@ -68,7 +68,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"empty\", \"uploading\", \"processing\", \"failed\", \"complete\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "empty", @@ -103,7 +104,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "upload_status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"empty\", \"uploading\", \"processing\", \"failed\", \"complete\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "empty", @@ -139,7 +141,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "upload_status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"empty\", \"uploading\", \"processing\", \"failed\", \"complete\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "empty", @@ -173,7 +176,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"empty\", \"uploading\", \"processing\", \"failed\", \"complete\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "empty", @@ -198,7 +202,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"empty\", \"uploading\", \"processing\", \"failed\", \"complete\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "empty", @@ -230,7 +235,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"empty\", \"uploading\", \"processing\", \"failed\", \"complete\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "empty", diff --git a/internal/services/zero_trust_dlp_entry/data_source_schema.go b/internal/services/zero_trust_dlp_entry/data_source_schema.go index 706d3bbb2b..598b2e6bdc 100644 --- a/internal/services/zero_trust_dlp_entry/data_source_schema.go +++ b/internal/services/zero_trust_dlp_entry/data_source_schema.go @@ -45,7 +45,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"custom\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "custom", @@ -65,10 +66,11 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustDLPEntryConfidenceDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "ai_context_available": schema.BoolAttribute{ - Computed: true, + Description: "Indicates whether this entry has AI remote service validation", + Computed: true, }, "available": schema.BoolAttribute{ - Description: "Indicates whether this entry can be made more or less sensitive by setting a confidence threshold.\nProfiles that use an entry with `available` set to true can use confidence thresholds", + Description: "Indicates whether this entry has any form of validation that is not an AI remote service", Computed: true, }, }, @@ -81,7 +83,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "validation": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"luhn\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("luhn"), }, diff --git a/internal/services/zero_trust_dlp_entry/list_data_source_schema.go b/internal/services/zero_trust_dlp_entry/list_data_source_schema.go index 2993590218..547d836451 100644 --- a/internal/services/zero_trust_dlp_entry/list_data_source_schema.go +++ b/internal/services/zero_trust_dlp_entry/list_data_source_schema.go @@ -57,7 +57,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "validation": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"luhn\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("luhn"), }, @@ -65,7 +66,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"custom\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "custom", @@ -88,10 +90,11 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustDLPEntriesConfidenceDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "ai_context_available": schema.BoolAttribute{ - Computed: true, + Description: "Indicates whether this entry has AI remote service validation", + Computed: true, }, "available": schema.BoolAttribute{ - Description: "Indicates whether this entry can be made more or less sensitive by setting a confidence threshold.\nProfiles that use an entry with `available` set to true can use confidence thresholds", + Description: "Indicates whether this entry has any form of validation that is not an AI remote service", Computed: true, }, }, diff --git a/internal/services/zero_trust_dlp_entry/schema.go b/internal/services/zero_trust_dlp_entry/schema.go index c0e52857b6..2fc4b7f4d2 100644 --- a/internal/services/zero_trust_dlp_entry/schema.go +++ b/internal/services/zero_trust_dlp_entry/schema.go @@ -46,7 +46,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "validation": schema.StringAttribute{ - Optional: true, + Description: "Available values: \"luhn\".", + Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("luhn"), }, @@ -54,7 +55,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Optional: true, + Description: "Available values: \"custom\".", + Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "custom", @@ -79,10 +81,11 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustDLPEntryConfidenceModel](ctx), Attributes: map[string]schema.Attribute{ "ai_context_available": schema.BoolAttribute{ - Computed: true, + Description: "Indicates whether this entry has AI remote service validation", + Computed: true, }, "available": schema.BoolAttribute{ - Description: "Indicates whether this entry can be made more or less sensitive by setting a confidence threshold.\nProfiles that use an entry with `available` set to true can use confidence thresholds", + Description: "Indicates whether this entry has any form of validation that is not an AI remote service", Computed: true, }, }, diff --git a/internal/services/zero_trust_dlp_predefined_profile/data_source_schema.go b/internal/services/zero_trust_dlp_predefined_profile/data_source_schema.go index b7a35b490e..8c8225422b 100644 --- a/internal/services/zero_trust_dlp_predefined_profile/data_source_schema.go +++ b/internal/services/zero_trust_dlp_predefined_profile/data_source_schema.go @@ -37,7 +37,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "confidence_threshold": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"low\", \"medium\", \"high\", \"very_high\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "low", @@ -72,7 +73,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"custom\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "custom", @@ -134,7 +136,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "validation": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"luhn\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("luhn"), }, @@ -142,7 +145,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"custom\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "custom", @@ -165,10 +169,11 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustDLPPredefinedProfileEntriesConfidenceDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "ai_context_available": schema.BoolAttribute{ - Computed: true, + Description: "Indicates whether this entry has AI remote service validation", + Computed: true, }, "available": schema.BoolAttribute{ - Description: "Indicates whether this entry can be made more or less sensitive by setting a confidence threshold.\nProfiles that use an entry with `available` set to true can use confidence thresholds", + Description: "Indicates whether this entry has any form of validation that is not an AI remote service", Computed: true, }, }, diff --git a/internal/services/zero_trust_dlp_predefined_profile/schema.go b/internal/services/zero_trust_dlp_predefined_profile/schema.go index bad7bafeb7..d21c8750a7 100644 --- a/internal/services/zero_trust_dlp_predefined_profile/schema.go +++ b/internal/services/zero_trust_dlp_predefined_profile/schema.go @@ -97,7 +97,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"custom\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "custom", diff --git a/internal/services/zero_trust_gateway_categories/list_data_source_schema.go b/internal/services/zero_trust_gateway_categories/list_data_source_schema.go index ff95384161..2e9e0957dd 100644 --- a/internal/services/zero_trust_gateway_categories/list_data_source_schema.go +++ b/internal/services/zero_trust_gateway_categories/list_data_source_schema.go @@ -44,7 +44,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "class": schema.StringAttribute{ - Description: "Which account types are allowed to create policies based on this category. `blocked` categories are blocked unconditionally for all accounts. `removalPending` categories can be removed from policies but not added. `noBlock` categories cannot be blocked.", + Description: "Which account types are allowed to create policies based on this category. `blocked` categories are blocked unconditionally for all accounts. `removalPending` categories can be removed from policies but not added. `noBlock` categories cannot be blocked.\nAvailable values: \"free\", \"premium\", \"blocked\", \"removalPending\", \"noBlock\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -79,7 +79,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "class": schema.StringAttribute{ - Description: "Which account types are allowed to create policies based on this category. `blocked` categories are blocked unconditionally for all accounts. `removalPending` categories can be removed from policies but not added. `noBlock` categories cannot be blocked.", + Description: "Which account types are allowed to create policies based on this category. `blocked` categories are blocked unconditionally for all accounts. `removalPending` categories can be removed from policies but not added. `noBlock` categories cannot be blocked.\nAvailable values: \"free\", \"premium\", \"blocked\", \"removalPending\", \"noBlock\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_gateway_certificate/data_source_schema.go b/internal/services/zero_trust_gateway_certificate/data_source_schema.go index c1f93549e6..b0bfe4d474 100644 --- a/internal/services/zero_trust_gateway_certificate/data_source_schema.go +++ b/internal/services/zero_trust_gateway_certificate/data_source_schema.go @@ -29,7 +29,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "binding_status": schema.StringAttribute{ - Description: "The deployment status of the certificate on Cloudflare's edge. Certificates in the 'available' (previously called 'active') state may be used for Gateway TLS interception.", + Description: "The deployment status of the certificate on Cloudflare's edge. Certificates in the 'available' (previously called 'active') state may be used for Gateway TLS interception.\nAvailable values: \"pending_deployment\", \"available\", \"pending_deletion\", \"inactive\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -69,7 +69,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The type of certificate, either BYO-PKI (custom) or Gateway-managed.", + Description: "The type of certificate, either BYO-PKI (custom) or Gateway-managed.\nAvailable values: \"custom\", \"gateway_managed\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("custom", "gateway_managed"), diff --git a/internal/services/zero_trust_gateway_certificate/list_data_source_schema.go b/internal/services/zero_trust_gateway_certificate/list_data_source_schema.go index d1d01bd881..9e27610713 100644 --- a/internal/services/zero_trust_gateway_certificate/list_data_source_schema.go +++ b/internal/services/zero_trust_gateway_certificate/list_data_source_schema.go @@ -40,7 +40,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "binding_status": schema.StringAttribute{ - Description: "The deployment status of the certificate on Cloudflare's edge. Certificates in the 'available' (previously called 'active') state may be used for Gateway TLS interception.", + Description: "The deployment status of the certificate on Cloudflare's edge. Certificates in the 'available' (previously called 'active') state may be used for Gateway TLS interception.\nAvailable values: \"pending_deployment\", \"available\", \"pending_deletion\", \"inactive\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -80,7 +80,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The type of certificate, either BYO-PKI (custom) or Gateway-managed.", + Description: "The type of certificate, either BYO-PKI (custom) or Gateway-managed.\nAvailable values: \"custom\", \"gateway_managed\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("custom", "gateway_managed"), diff --git a/internal/services/zero_trust_gateway_certificate/schema.go b/internal/services/zero_trust_gateway_certificate/schema.go index 19e081b71f..b794397b98 100644 --- a/internal/services/zero_trust_gateway_certificate/schema.go +++ b/internal/services/zero_trust_gateway_certificate/schema.go @@ -35,7 +35,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.Int64{int64planmodifier.RequiresReplace()}, }, "binding_status": schema.StringAttribute{ - Description: "The deployment status of the certificate on Cloudflare's edge. Certificates in the 'available' (previously called 'active') state may be used for Gateway TLS interception.", + Description: "The deployment status of the certificate on Cloudflare's edge. Certificates in the 'available' (previously called 'active') state may be used for Gateway TLS interception.\nAvailable values: \"pending_deployment\", \"available\", \"pending_deletion\", \"inactive\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -75,7 +75,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The type of certificate, either BYO-PKI (custom) or Gateway-managed.", + Description: "The type of certificate, either BYO-PKI (custom) or Gateway-managed.\nAvailable values: \"custom\", \"gateway_managed\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("custom", "gateway_managed"), diff --git a/internal/services/zero_trust_gateway_policy/data_source_schema.go b/internal/services/zero_trust_gateway_policy/data_source_schema.go index 3eea73f960..6f3298ec1d 100644 --- a/internal/services/zero_trust_gateway_policy/data_source_schema.go +++ b/internal/services/zero_trust_gateway_policy/data_source_schema.go @@ -33,7 +33,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "action": schema.StringAttribute{ - Description: "The action to preform when the associated traffic, identity, and device posture expressions are either absent or evaluate to `true`.", + Description: "The action to preform when the associated traffic, identity, and device posture expressions are either absent or evaluate to `true`.\nAvailable values: \"on\", \"off\", \"allow\", \"block\", \"scan\", \"noscan\", \"safesearch\", \"ytrestricted\", \"isolate\", \"noisolate\", \"override\", \"l4_override\", \"egress\", \"resolve\", \"quarantine\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -117,12 +117,12 @@ func DataSourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "expiration": schema.SingleNestedAttribute{ - Description: "The expiration time stamp and default duration of a DNS policy. Takes\nprecedence over the policy's `schedule` configuration, if any.\n\nThis does not apply to HTTP or network policies.\n", + Description: "The expiration time stamp and default duration of a DNS policy. Takes\nprecedence over the policy's `schedule` configuration, if any.\n\nThis does not apply to HTTP or network policies.", Computed: true, CustomType: customfield.NewNestedObjectType[ZeroTrustGatewayPolicyExpirationDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "expires_at": schema.StringAttribute{ - Description: "The time stamp at which the policy will expire and cease to be\napplied.\n\nMust adhere to RFC 3339 and include a UTC offset. Non-zero\noffsets are accepted but will be converted to the equivalent\nvalue with offset zero (UTC+00:00) and will be returned as time\nstamps with offset zero denoted by a trailing 'Z'.\n\nPolicies with an expiration do not consider the timezone of\nclients they are applied to, and expire \"globally\" at the point\ngiven by their `expires_at` value.\n", + Description: "The time stamp at which the policy will expire and cease to be\napplied.\n\nMust adhere to RFC 3339 and include a UTC offset. Non-zero\noffsets are accepted but will be converted to the equivalent\nvalue with offset zero (UTC+00:00) and will be returned as time\nstamps with offset zero denoted by a trailing 'Z'.\n\nPolicies with an expiration do not consider the timezone of\nclients they are applied to, and expire \"globally\" at the point\ngiven by their `expires_at` value.", Computed: true, CustomType: timetypes.RFC3339Type{}, }, @@ -171,7 +171,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustGatewayPolicyRuleSettingsBISOAdminControlsDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "copy": schema.StringAttribute{ - Description: "Configure whether copy is enabled or not. When set with \"remote_only\", copying isolated content from the remote browser to the user's local clipboard is disabled. When absent, copy is enabled. Only applies when `version == \"v2\"`.", + Description: "Configure whether copy is enabled or not. When set with \"remote_only\", copying isolated content from the remote browser to the user's local clipboard is disabled. When absent, copy is enabled. Only applies when `version == \"v2\"`.\nAvailable values: \"enabled\", \"disabled\", \"remote_only\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -194,7 +194,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "download": schema.StringAttribute{ - Description: "Configure whether downloading enabled or not. When absent, downloading is enabled. Only applies when `version == \"v2\"`.", + Description: "Configure whether downloading enabled or not. When absent, downloading is enabled. Only applies when `version == \"v2\"`.\nAvailable values: \"enabled\", \"disabled\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("enabled", "disabled"), @@ -209,14 +209,14 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "keyboard": schema.StringAttribute{ - Description: "Configure whether keyboard usage is enabled or not. When absent, keyboard usage is enabled. Only applies when `version == \"v2\"`.", + Description: "Configure whether keyboard usage is enabled or not. When absent, keyboard usage is enabled. Only applies when `version == \"v2\"`.\nAvailable values: \"enabled\", \"disabled\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("enabled", "disabled"), }, }, "paste": schema.StringAttribute{ - Description: "Configure whether pasting is enabled or not. When set with \"remote_only\", pasting content from the user's local clipboard into isolated pages is disabled. When absent, paste is enabled. Only applies when `version == \"v2\"`.", + Description: "Configure whether pasting is enabled or not. When set with \"remote_only\", pasting content from the user's local clipboard into isolated pages is disabled. When absent, paste is enabled. Only applies when `version == \"v2\"`.\nAvailable values: \"enabled\", \"disabled\", \"remote_only\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -227,21 +227,21 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "printing": schema.StringAttribute{ - Description: "Configure whether printing is enabled or not. When absent, printing is enabled. Only applies when `version == \"v2\"`.", + Description: "Configure whether printing is enabled or not. When absent, printing is enabled. Only applies when `version == \"v2\"`.\nAvailable values: \"enabled\", \"disabled\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("enabled", "disabled"), }, }, "upload": schema.StringAttribute{ - Description: "Configure whether uploading is enabled or not. When absent, uploading is enabled. Only applies when `version == \"v2\"`.", + Description: "Configure whether uploading is enabled or not. When absent, uploading is enabled. Only applies when `version == \"v2\"`.\nAvailable values: \"enabled\", \"disabled\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("enabled", "disabled"), }, }, "version": schema.StringAttribute{ - Description: "Indicates which version of the browser isolation controls should apply.", + Description: "Indicates which version of the browser isolation controls should apply.\nAvailable values: \"v1\", \"v2\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("v1", "v2"), @@ -459,7 +459,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustGatewayPolicyRuleSettingsResolveDNSInternallyDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "fallback": schema.StringAttribute{ - Description: "The fallback behavior to apply when the internal DNS response code is different from 'NOERROR' or when the response data only contains CNAME records for 'A' or 'AAAA' queries.", + Description: "The fallback behavior to apply when the internal DNS response code is different from 'NOERROR' or when the response data only contains CNAME records for 'A' or 'AAAA' queries.\nAvailable values: \"none\", \"public_dns\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("none", "public_dns"), @@ -481,7 +481,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustGatewayPolicyRuleSettingsUntrustedCERTDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "action": schema.StringAttribute{ - Description: "The action performed when an untrusted certificate is seen. The default action is an error with HTTP code 526.", + Description: "The action performed when an untrusted certificate is seen. The default action is an error with HTTP code 526.\nAvailable values: \"pass_through\", \"block\", \"error\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_gateway_policy/list_data_source_schema.go b/internal/services/zero_trust_gateway_policy/list_data_source_schema.go index f1bf83fd14..868e7c7f82 100644 --- a/internal/services/zero_trust_gateway_policy/list_data_source_schema.go +++ b/internal/services/zero_trust_gateway_policy/list_data_source_schema.go @@ -42,7 +42,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "action": schema.StringAttribute{ - Description: "The action to preform when the associated traffic, identity, and device posture expressions are either absent or evaluate to `true`.", + Description: "The action to preform when the associated traffic, identity, and device posture expressions are either absent or evaluate to `true`.\nAvailable values: \"on\", \"off\", \"allow\", \"block\", \"scan\", \"noscan\", \"safesearch\", \"ytrestricted\", \"isolate\", \"noisolate\", \"override\", \"l4_override\", \"egress\", \"resolve\", \"quarantine\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -86,12 +86,12 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "expiration": schema.SingleNestedAttribute{ - Description: "The expiration time stamp and default duration of a DNS policy. Takes\nprecedence over the policy's `schedule` configuration, if any.\n\nThis does not apply to HTTP or network policies.\n", + Description: "The expiration time stamp and default duration of a DNS policy. Takes\nprecedence over the policy's `schedule` configuration, if any.\n\nThis does not apply to HTTP or network policies.", Computed: true, CustomType: customfield.NewNestedObjectType[ZeroTrustGatewayPoliciesExpirationDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "expires_at": schema.StringAttribute{ - Description: "The time stamp at which the policy will expire and cease to be\napplied.\n\nMust adhere to RFC 3339 and include a UTC offset. Non-zero\noffsets are accepted but will be converted to the equivalent\nvalue with offset zero (UTC+00:00) and will be returned as time\nstamps with offset zero denoted by a trailing 'Z'.\n\nPolicies with an expiration do not consider the timezone of\nclients they are applied to, and expire \"globally\" at the point\ngiven by their `expires_at` value.\n", + Description: "The time stamp at which the policy will expire and cease to be\napplied.\n\nMust adhere to RFC 3339 and include a UTC offset. Non-zero\noffsets are accepted but will be converted to the equivalent\nvalue with offset zero (UTC+00:00) and will be returned as time\nstamps with offset zero denoted by a trailing 'Z'.\n\nPolicies with an expiration do not consider the timezone of\nclients they are applied to, and expire \"globally\" at the point\ngiven by their `expires_at` value.", Computed: true, CustomType: timetypes.RFC3339Type{}, }, @@ -168,7 +168,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustGatewayPoliciesRuleSettingsBISOAdminControlsDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "copy": schema.StringAttribute{ - Description: "Configure whether copy is enabled or not. When set with \"remote_only\", copying isolated content from the remote browser to the user's local clipboard is disabled. When absent, copy is enabled. Only applies when `version == \"v2\"`.", + Description: "Configure whether copy is enabled or not. When set with \"remote_only\", copying isolated content from the remote browser to the user's local clipboard is disabled. When absent, copy is enabled. Only applies when `version == \"v2\"`.\nAvailable values: \"enabled\", \"disabled\", \"remote_only\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -191,7 +191,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "download": schema.StringAttribute{ - Description: "Configure whether downloading enabled or not. When absent, downloading is enabled. Only applies when `version == \"v2\"`.", + Description: "Configure whether downloading enabled or not. When absent, downloading is enabled. Only applies when `version == \"v2\"`.\nAvailable values: \"enabled\", \"disabled\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("enabled", "disabled"), @@ -206,14 +206,14 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "keyboard": schema.StringAttribute{ - Description: "Configure whether keyboard usage is enabled or not. When absent, keyboard usage is enabled. Only applies when `version == \"v2\"`.", + Description: "Configure whether keyboard usage is enabled or not. When absent, keyboard usage is enabled. Only applies when `version == \"v2\"`.\nAvailable values: \"enabled\", \"disabled\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("enabled", "disabled"), }, }, "paste": schema.StringAttribute{ - Description: "Configure whether pasting is enabled or not. When set with \"remote_only\", pasting content from the user's local clipboard into isolated pages is disabled. When absent, paste is enabled. Only applies when `version == \"v2\"`.", + Description: "Configure whether pasting is enabled or not. When set with \"remote_only\", pasting content from the user's local clipboard into isolated pages is disabled. When absent, paste is enabled. Only applies when `version == \"v2\"`.\nAvailable values: \"enabled\", \"disabled\", \"remote_only\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -224,21 +224,21 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "printing": schema.StringAttribute{ - Description: "Configure whether printing is enabled or not. When absent, printing is enabled. Only applies when `version == \"v2\"`.", + Description: "Configure whether printing is enabled or not. When absent, printing is enabled. Only applies when `version == \"v2\"`.\nAvailable values: \"enabled\", \"disabled\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("enabled", "disabled"), }, }, "upload": schema.StringAttribute{ - Description: "Configure whether uploading is enabled or not. When absent, uploading is enabled. Only applies when `version == \"v2\"`.", + Description: "Configure whether uploading is enabled or not. When absent, uploading is enabled. Only applies when `version == \"v2\"`.\nAvailable values: \"enabled\", \"disabled\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("enabled", "disabled"), }, }, "version": schema.StringAttribute{ - Description: "Indicates which version of the browser isolation controls should apply.", + Description: "Indicates which version of the browser isolation controls should apply.\nAvailable values: \"v1\", \"v2\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("v1", "v2"), @@ -456,7 +456,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustGatewayPoliciesRuleSettingsResolveDNSInternallyDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "fallback": schema.StringAttribute{ - Description: "The fallback behavior to apply when the internal DNS response code is different from 'NOERROR' or when the response data only contains CNAME records for 'A' or 'AAAA' queries.", + Description: "The fallback behavior to apply when the internal DNS response code is different from 'NOERROR' or when the response data only contains CNAME records for 'A' or 'AAAA' queries.\nAvailable values: \"none\", \"public_dns\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("none", "public_dns"), @@ -478,7 +478,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustGatewayPoliciesRuleSettingsUntrustedCERTDataSourceModel](ctx), Attributes: map[string]schema.Attribute{ "action": schema.StringAttribute{ - Description: "The action performed when an untrusted certificate is seen. The default action is an error with HTTP code 526.", + Description: "The action performed when an untrusted certificate is seen. The default action is an error with HTTP code 526.\nAvailable values: \"pass_through\", \"block\", \"error\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_gateway_policy/schema.go b/internal/services/zero_trust_gateway_policy/schema.go index f641d3c7fa..2eed1485d0 100644 --- a/internal/services/zero_trust_gateway_policy/schema.go +++ b/internal/services/zero_trust_gateway_policy/schema.go @@ -34,7 +34,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "action": schema.StringAttribute{ - Description: "The action to preform when the associated traffic, identity, and device posture expressions are either absent or evaluate to `true`.", + Description: "The action to preform when the associated traffic, identity, and device posture expressions are either absent or evaluate to `true`.\nAvailable values: \"on\", \"off\", \"allow\", \"block\", \"scan\", \"noscan\", \"safesearch\", \"ytrestricted\", \"isolate\", \"noisolate\", \"override\", \"l4_override\", \"egress\", \"resolve\", \"quarantine\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -100,13 +100,13 @@ func ResourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "expiration": schema.SingleNestedAttribute{ - Description: "The expiration time stamp and default duration of a DNS policy. Takes\nprecedence over the policy's `schedule` configuration, if any.\n\nThis does not apply to HTTP or network policies.\n", + Description: "The expiration time stamp and default duration of a DNS policy. Takes\nprecedence over the policy's `schedule` configuration, if any.\n\nThis does not apply to HTTP or network policies.", Computed: true, Optional: true, CustomType: customfield.NewNestedObjectType[ZeroTrustGatewayPolicyExpirationModel](ctx), Attributes: map[string]schema.Attribute{ "expires_at": schema.StringAttribute{ - Description: "The time stamp at which the policy will expire and cease to be\napplied.\n\nMust adhere to RFC 3339 and include a UTC offset. Non-zero\noffsets are accepted but will be converted to the equivalent\nvalue with offset zero (UTC+00:00) and will be returned as time\nstamps with offset zero denoted by a trailing 'Z'.\n\nPolicies with an expiration do not consider the timezone of\nclients they are applied to, and expire \"globally\" at the point\ngiven by their `expires_at` value.\n", + Description: "The time stamp at which the policy will expire and cease to be\napplied.\n\nMust adhere to RFC 3339 and include a UTC offset. Non-zero\noffsets are accepted but will be converted to the equivalent\nvalue with offset zero (UTC+00:00) and will be returned as time\nstamps with offset zero denoted by a trailing 'Z'.\n\nPolicies with an expiration do not consider the timezone of\nclients they are applied to, and expire \"globally\" at the point\ngiven by their `expires_at` value.", Required: true, CustomType: timetypes.RFC3339Type{}, }, @@ -157,7 +157,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustGatewayPolicyRuleSettingsBISOAdminControlsModel](ctx), Attributes: map[string]schema.Attribute{ "copy": schema.StringAttribute{ - Description: "Configure whether copy is enabled or not. When set with \"remote_only\", copying isolated content from the remote browser to the user's local clipboard is disabled. When absent, copy is enabled. Only applies when `version == \"v2\"`.", + Description: "Configure whether copy is enabled or not. When set with \"remote_only\", copying isolated content from the remote browser to the user's local clipboard is disabled. When absent, copy is enabled. Only applies when `version == \"v2\"`.\nAvailable values: \"enabled\", \"disabled\", \"remote_only\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -180,7 +180,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "download": schema.StringAttribute{ - Description: "Configure whether downloading enabled or not. When absent, downloading is enabled. Only applies when `version == \"v2\"`.", + Description: "Configure whether downloading enabled or not. When absent, downloading is enabled. Only applies when `version == \"v2\"`.\nAvailable values: \"enabled\", \"disabled\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("enabled", "disabled"), @@ -195,14 +195,14 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "keyboard": schema.StringAttribute{ - Description: "Configure whether keyboard usage is enabled or not. When absent, keyboard usage is enabled. Only applies when `version == \"v2\"`.", + Description: "Configure whether keyboard usage is enabled or not. When absent, keyboard usage is enabled. Only applies when `version == \"v2\"`.\nAvailable values: \"enabled\", \"disabled\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("enabled", "disabled"), }, }, "paste": schema.StringAttribute{ - Description: "Configure whether pasting is enabled or not. When set with \"remote_only\", pasting content from the user's local clipboard into isolated pages is disabled. When absent, paste is enabled. Only applies when `version == \"v2\"`.", + Description: "Configure whether pasting is enabled or not. When set with \"remote_only\", pasting content from the user's local clipboard into isolated pages is disabled. When absent, paste is enabled. Only applies when `version == \"v2\"`.\nAvailable values: \"enabled\", \"disabled\", \"remote_only\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -213,21 +213,21 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "printing": schema.StringAttribute{ - Description: "Configure whether printing is enabled or not. When absent, printing is enabled. Only applies when `version == \"v2\"`.", + Description: "Configure whether printing is enabled or not. When absent, printing is enabled. Only applies when `version == \"v2\"`.\nAvailable values: \"enabled\", \"disabled\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("enabled", "disabled"), }, }, "upload": schema.StringAttribute{ - Description: "Configure whether uploading is enabled or not. When absent, uploading is enabled. Only applies when `version == \"v2\"`.", + Description: "Configure whether uploading is enabled or not. When absent, uploading is enabled. Only applies when `version == \"v2\"`.\nAvailable values: \"enabled\", \"disabled\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("enabled", "disabled"), }, }, "version": schema.StringAttribute{ - Description: "Indicates which version of the browser isolation controls should apply.", + Description: "Indicates which version of the browser isolation controls should apply.\nAvailable values: \"v1\", \"v2\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -455,7 +455,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustGatewayPolicyRuleSettingsResolveDNSInternallyModel](ctx), Attributes: map[string]schema.Attribute{ "fallback": schema.StringAttribute{ - Description: "The fallback behavior to apply when the internal DNS response code is different from 'NOERROR' or when the response data only contains CNAME records for 'A' or 'AAAA' queries.", + Description: "The fallback behavior to apply when the internal DNS response code is different from 'NOERROR' or when the response data only contains CNAME records for 'A' or 'AAAA' queries.\nAvailable values: \"none\", \"public_dns\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -480,7 +480,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZeroTrustGatewayPolicyRuleSettingsUntrustedCERTModel](ctx), Attributes: map[string]schema.Attribute{ "action": schema.StringAttribute{ - Description: "The action performed when an untrusted certificate is seen. The default action is an error with HTTP code 526.", + Description: "The action performed when an untrusted certificate is seen. The default action is an error with HTTP code 526.\nAvailable values: \"pass_through\", \"block\", \"error\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_gateway_settings/data_source_schema.go b/internal/services/zero_trust_gateway_settings/data_source_schema.go index 11d2ca7b3d..a11f5c477b 100644 --- a/internal/services/zero_trust_gateway_settings/data_source_schema.go +++ b/internal/services/zero_trust_gateway_settings/data_source_schema.go @@ -229,7 +229,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "fallback_action": schema.StringAttribute{ - Description: "Action to take when the file cannot be scanned.", + Description: "Action to take when the file cannot be scanned.\nAvailable values: \"allow\", \"block\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("allow", "block"), diff --git a/internal/services/zero_trust_gateway_settings/schema.go b/internal/services/zero_trust_gateway_settings/schema.go index 8098f13f9a..7068fc038f 100644 --- a/internal/services/zero_trust_gateway_settings/schema.go +++ b/internal/services/zero_trust_gateway_settings/schema.go @@ -241,7 +241,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "fallback_action": schema.StringAttribute{ - Description: "Action to take when the file cannot be scanned.", + Description: "Action to take when the file cannot be scanned.\nAvailable values: \"allow\", \"block\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("allow", "block"), diff --git a/internal/services/zero_trust_list/data_source_schema.go b/internal/services/zero_trust_list/data_source_schema.go index 0c89aa453b..df39182587 100644 --- a/internal/services/zero_trust_list/data_source_schema.go +++ b/internal/services/zero_trust_list/data_source_schema.go @@ -47,7 +47,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The type of list.", + Description: "The type of list.\nAvailable values: \"SERIAL\", \"URL\", \"DOMAIN\", \"EMAIL\", \"IP\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -67,7 +67,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, Attributes: map[string]schema.Attribute{ "type": schema.StringAttribute{ - Description: "The type of list.", + Description: "The type of list.\nAvailable values: \"SERIAL\", \"URL\", \"DOMAIN\", \"EMAIL\", \"IP\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_list/list_data_source_schema.go b/internal/services/zero_trust_list/list_data_source_schema.go index 2139297b4d..c4fd72066d 100644 --- a/internal/services/zero_trust_list/list_data_source_schema.go +++ b/internal/services/zero_trust_list/list_data_source_schema.go @@ -23,7 +23,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Required: true, }, "type": schema.StringAttribute{ - Description: "The type of list.", + Description: "The type of list.\nAvailable values: \"SERIAL\", \"URL\", \"DOMAIN\", \"EMAIL\", \"IP\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -69,7 +69,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "type": schema.StringAttribute{ - Description: "The type of list.", + Description: "The type of list.\nAvailable values: \"SERIAL\", \"URL\", \"DOMAIN\", \"EMAIL\", \"IP\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_list/schema.go b/internal/services/zero_trust_list/schema.go index 17a74d3dd9..4f2fc9c5ee 100644 --- a/internal/services/zero_trust_list/schema.go +++ b/internal/services/zero_trust_list/schema.go @@ -30,7 +30,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "type": schema.StringAttribute{ - Description: "The type of list.", + Description: "The type of list.\nAvailable values: \"SERIAL\", \"URL\", \"DOMAIN\", \"EMAIL\", \"IP\".", Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_risk_behavior/data_source_schema.go b/internal/services/zero_trust_risk_behavior/data_source_schema.go index 18ee21b913..6321a067fd 100644 --- a/internal/services/zero_trust_risk_behavior/data_source_schema.go +++ b/internal/services/zero_trust_risk_behavior/data_source_schema.go @@ -35,7 +35,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "risk_level": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"low\", \"medium\", \"high\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "low", diff --git a/internal/services/zero_trust_risk_behavior/schema.go b/internal/services/zero_trust_risk_behavior/schema.go index eaca2be63e..a02f079535 100644 --- a/internal/services/zero_trust_risk_behavior/schema.go +++ b/internal/services/zero_trust_risk_behavior/schema.go @@ -31,7 +31,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { Required: true, }, "risk_level": schema.StringAttribute{ - Required: true, + Description: "Available values: \"low\", \"medium\", \"high\".", + Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( "low", diff --git a/internal/services/zero_trust_risk_scoring_integration/data_source_schema.go b/internal/services/zero_trust_risk_scoring_integration/data_source_schema.go index 8f0f458c7c..08ecc55cc1 100644 --- a/internal/services/zero_trust_risk_scoring_integration/data_source_schema.go +++ b/internal/services/zero_trust_risk_scoring_integration/data_source_schema.go @@ -40,7 +40,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "integration_type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"Okta\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("Okta"), }, diff --git a/internal/services/zero_trust_risk_scoring_integration/list_data_source_schema.go b/internal/services/zero_trust_risk_scoring_integration/list_data_source_schema.go index 9a2168483f..e9cc6b37fe 100644 --- a/internal/services/zero_trust_risk_scoring_integration/list_data_source_schema.go +++ b/internal/services/zero_trust_risk_scoring_integration/list_data_source_schema.go @@ -53,7 +53,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "integration_type": schema.StringAttribute{ - Computed: true, + Description: "Available values: \"Okta\".", + Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("Okta"), }, diff --git a/internal/services/zero_trust_risk_scoring_integration/schema.go b/internal/services/zero_trust_risk_scoring_integration/schema.go index a7f602a027..9445eb4855 100644 --- a/internal/services/zero_trust_risk_scoring_integration/schema.go +++ b/internal/services/zero_trust_risk_scoring_integration/schema.go @@ -29,7 +29,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "integration_type": schema.StringAttribute{ - Required: true, + Description: "Available values: \"Okta\".", + Required: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("Okta"), }, diff --git a/internal/services/zero_trust_tunnel_cloudflared/data_source.go b/internal/services/zero_trust_tunnel_cloudflared/data_source.go index 77eed5f3cb..dc985d2023 100644 --- a/internal/services/zero_trust_tunnel_cloudflared/data_source.go +++ b/internal/services/zero_trust_tunnel_cloudflared/data_source.go @@ -65,7 +65,7 @@ func (d *ZeroTrustTunnelCloudflaredDataSource) Read(ctx context.Context, req dat } env := ZeroTrustTunnelCloudflaredsResultListDataSourceEnvelope{} - page, err := d.client.ZeroTrust.Tunnels.List(ctx, params) + page, err := d.client.ZeroTrust.Tunnels.Cloudflared.List(ctx, params) if err != nil { resp.Diagnostics.AddError("failed to make http request", err.Error()) return @@ -95,7 +95,7 @@ func (d *ZeroTrustTunnelCloudflaredDataSource) Read(ctx context.Context, req dat res := new(http.Response) env := ZeroTrustTunnelCloudflaredResultDataSourceEnvelope{*data} - _, err := d.client.ZeroTrust.Tunnels.Get( + _, err := d.client.ZeroTrust.Tunnels.Cloudflared.Get( ctx, data.TunnelID.ValueString(), params, diff --git a/internal/services/zero_trust_tunnel_cloudflared/data_source_model.go b/internal/services/zero_trust_tunnel_cloudflared/data_source_model.go index 662c8bf0fc..de66086434 100644 --- a/internal/services/zero_trust_tunnel_cloudflared/data_source_model.go +++ b/internal/services/zero_trust_tunnel_cloudflared/data_source_model.go @@ -36,23 +36,21 @@ type ZeroTrustTunnelCloudflaredDataSourceModel struct { Filter *ZeroTrustTunnelCloudflaredFindOneByDataSourceModel `tfsdk:"filter"` } -func (m *ZeroTrustTunnelCloudflaredDataSourceModel) toReadParams(_ context.Context) (params zero_trust.TunnelGetParams, diags diag.Diagnostics) { - params = zero_trust.TunnelGetParams{ +func (m *ZeroTrustTunnelCloudflaredDataSourceModel) toReadParams(_ context.Context) (params zero_trust.TunnelCloudflaredGetParams, diags diag.Diagnostics) { + params = zero_trust.TunnelCloudflaredGetParams{ AccountID: cloudflare.F(m.AccountID.ValueString()), } return } -func (m *ZeroTrustTunnelCloudflaredDataSourceModel) toListParams(_ context.Context) (params zero_trust.TunnelListParams, diags diag.Diagnostics) { - mFilterExistedAt, errs := m.Filter.ExistedAt.ValueRFC3339Time() - diags.Append(errs...) +func (m *ZeroTrustTunnelCloudflaredDataSourceModel) toListParams(_ context.Context) (params zero_trust.TunnelCloudflaredListParams, diags diag.Diagnostics) { mFilterWasActiveAt, errs := m.Filter.WasActiveAt.ValueRFC3339Time() diags.Append(errs...) mFilterWasInactiveAt, errs := m.Filter.WasInactiveAt.ValueRFC3339Time() diags.Append(errs...) - params = zero_trust.TunnelListParams{ + params = zero_trust.TunnelCloudflaredListParams{ AccountID: cloudflare.F(m.AccountID.ValueString()), } @@ -60,7 +58,7 @@ func (m *ZeroTrustTunnelCloudflaredDataSourceModel) toListParams(_ context.Conte params.ExcludePrefix = cloudflare.F(m.Filter.ExcludePrefix.ValueString()) } if !m.Filter.ExistedAt.IsNull() { - params.ExistedAt = cloudflare.F(mFilterExistedAt) + params.ExistedAt = cloudflare.F(m.Filter.ExistedAt.ValueString()) } if !m.Filter.IncludePrefix.IsNull() { params.IncludePrefix = cloudflare.F(m.Filter.IncludePrefix.ValueString()) @@ -72,7 +70,7 @@ func (m *ZeroTrustTunnelCloudflaredDataSourceModel) toListParams(_ context.Conte params.Name = cloudflare.F(m.Filter.Name.ValueString()) } if !m.Filter.Status.IsNull() { - params.Status = cloudflare.F(zero_trust.TunnelListParamsStatus(m.Filter.Status.ValueString())) + params.Status = cloudflare.F(zero_trust.TunnelCloudflaredListParamsStatus(m.Filter.Status.ValueString())) } if !m.Filter.UUID.IsNull() { params.UUID = cloudflare.F(m.Filter.UUID.ValueString()) @@ -100,7 +98,7 @@ type ZeroTrustTunnelCloudflaredConnectionsDataSourceModel struct { type ZeroTrustTunnelCloudflaredFindOneByDataSourceModel struct { ExcludePrefix types.String `tfsdk:"exclude_prefix" query:"exclude_prefix,optional"` - ExistedAt timetypes.RFC3339 `tfsdk:"existed_at" query:"existed_at,optional" format:"date-time"` + ExistedAt types.String `tfsdk:"existed_at" query:"existed_at,optional"` IncludePrefix types.String `tfsdk:"include_prefix" query:"include_prefix,optional"` IsDeleted types.Bool `tfsdk:"is_deleted" query:"is_deleted,optional"` Name types.String `tfsdk:"name" query:"name,optional"` diff --git a/internal/services/zero_trust_tunnel_cloudflared/data_source_schema.go b/internal/services/zero_trust_tunnel_cloudflared/data_source_schema.go index 7240f3a126..d78f8bdf2b 100644 --- a/internal/services/zero_trust_tunnel_cloudflared/data_source_schema.go +++ b/internal/services/zero_trust_tunnel_cloudflared/data_source_schema.go @@ -66,7 +66,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).", + Description: "The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).\nAvailable values: \"inactive\", \"degraded\", \"healthy\", \"down\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -78,7 +78,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "tun_type": schema.StringAttribute{ - Description: "The type of tunnel.", + Description: "The type of tunnel.\nAvailable values: \"cfd_tunnel\", \"warp_connector\", \"ip_sec\", \"gre\", \"cni\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -144,9 +144,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "existed_at": schema.StringAttribute{ - Description: "If provided, include only tunnels that were created (and not deleted) before this time.", + Description: "If provided, include only resources that were created (and not deleted) before this time. URL encoded.", Optional: true, - CustomType: timetypes.RFC3339Type{}, }, "include_prefix": schema.StringAttribute{ Optional: true, @@ -160,7 +159,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "status": schema.StringAttribute{ - Description: "The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).", + Description: "The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).\nAvailable values: \"inactive\", \"degraded\", \"healthy\", \"down\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_tunnel_cloudflared/list_data_source.go b/internal/services/zero_trust_tunnel_cloudflared/list_data_source.go index 4bd959443b..614a352aaa 100644 --- a/internal/services/zero_trust_tunnel_cloudflared/list_data_source.go +++ b/internal/services/zero_trust_tunnel_cloudflared/list_data_source.go @@ -67,7 +67,7 @@ func (d *ZeroTrustTunnelCloudflaredsDataSource) Read(ctx context.Context, req da if maxItems <= 0 { maxItems = 1000 } - page, err := d.client.ZeroTrust.Tunnels.List(ctx, params) + page, err := d.client.ZeroTrust.Tunnels.Cloudflared.List(ctx, params) if err != nil { resp.Diagnostics.AddError("failed to make http request", err.Error()) return diff --git a/internal/services/zero_trust_tunnel_cloudflared/list_data_source_model.go b/internal/services/zero_trust_tunnel_cloudflared/list_data_source_model.go index c4fe0850af..625af82605 100644 --- a/internal/services/zero_trust_tunnel_cloudflared/list_data_source_model.go +++ b/internal/services/zero_trust_tunnel_cloudflared/list_data_source_model.go @@ -21,7 +21,7 @@ type ZeroTrustTunnelCloudflaredsResultListDataSourceEnvelope struct { type ZeroTrustTunnelCloudflaredsDataSourceModel struct { AccountID types.String `tfsdk:"account_id" path:"account_id,required"` ExcludePrefix types.String `tfsdk:"exclude_prefix" query:"exclude_prefix,optional"` - ExistedAt timetypes.RFC3339 `tfsdk:"existed_at" query:"existed_at,optional" format:"date-time"` + ExistedAt types.String `tfsdk:"existed_at" query:"existed_at,optional"` IncludePrefix types.String `tfsdk:"include_prefix" query:"include_prefix,optional"` IsDeleted types.Bool `tfsdk:"is_deleted" query:"is_deleted,optional"` Name types.String `tfsdk:"name" query:"name,optional"` @@ -33,15 +33,13 @@ type ZeroTrustTunnelCloudflaredsDataSourceModel struct { Result customfield.NestedObjectList[ZeroTrustTunnelCloudflaredsResultDataSourceModel] `tfsdk:"result"` } -func (m *ZeroTrustTunnelCloudflaredsDataSourceModel) toListParams(_ context.Context) (params zero_trust.TunnelListParams, diags diag.Diagnostics) { - mExistedAt, errs := m.ExistedAt.ValueRFC3339Time() - diags.Append(errs...) +func (m *ZeroTrustTunnelCloudflaredsDataSourceModel) toListParams(_ context.Context) (params zero_trust.TunnelCloudflaredListParams, diags diag.Diagnostics) { mWasActiveAt, errs := m.WasActiveAt.ValueRFC3339Time() diags.Append(errs...) mWasInactiveAt, errs := m.WasInactiveAt.ValueRFC3339Time() diags.Append(errs...) - params = zero_trust.TunnelListParams{ + params = zero_trust.TunnelCloudflaredListParams{ AccountID: cloudflare.F(m.AccountID.ValueString()), } @@ -49,7 +47,7 @@ func (m *ZeroTrustTunnelCloudflaredsDataSourceModel) toListParams(_ context.Cont params.ExcludePrefix = cloudflare.F(m.ExcludePrefix.ValueString()) } if !m.ExistedAt.IsNull() { - params.ExistedAt = cloudflare.F(mExistedAt) + params.ExistedAt = cloudflare.F(m.ExistedAt.ValueString()) } if !m.IncludePrefix.IsNull() { params.IncludePrefix = cloudflare.F(m.IncludePrefix.ValueString()) @@ -61,7 +59,7 @@ func (m *ZeroTrustTunnelCloudflaredsDataSourceModel) toListParams(_ context.Cont params.Name = cloudflare.F(m.Name.ValueString()) } if !m.Status.IsNull() { - params.Status = cloudflare.F(zero_trust.TunnelListParamsStatus(m.Status.ValueString())) + params.Status = cloudflare.F(zero_trust.TunnelCloudflaredListParamsStatus(m.Status.ValueString())) } if !m.UUID.IsNull() { params.UUID = cloudflare.F(m.UUID.ValueString()) diff --git a/internal/services/zero_trust_tunnel_cloudflared/list_data_source_schema.go b/internal/services/zero_trust_tunnel_cloudflared/list_data_source_schema.go index b2b304e9eb..aa1369d6ce 100644 --- a/internal/services/zero_trust_tunnel_cloudflared/list_data_source_schema.go +++ b/internal/services/zero_trust_tunnel_cloudflared/list_data_source_schema.go @@ -28,9 +28,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "existed_at": schema.StringAttribute{ - Description: "If provided, include only tunnels that were created (and not deleted) before this time.", + Description: "If provided, include only resources that were created (and not deleted) before this time. URL encoded.", Optional: true, - CustomType: timetypes.RFC3339Type{}, }, "include_prefix": schema.StringAttribute{ Optional: true, @@ -44,7 +43,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "status": schema.StringAttribute{ - Description: "The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).", + Description: "The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).\nAvailable values: \"inactive\", \"degraded\", \"healthy\", \"down\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -164,7 +163,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).", + Description: "The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).\nAvailable values: \"inactive\", \"degraded\", \"healthy\", \"down\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -176,7 +175,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "tun_type": schema.StringAttribute{ - Description: "The type of tunnel.", + Description: "The type of tunnel.\nAvailable values: \"cfd_tunnel\", \"warp_connector\", \"ip_sec\", \"gre\", \"cni\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_tunnel_cloudflared/resource.go b/internal/services/zero_trust_tunnel_cloudflared/resource.go index 1b825ba83c..f7c410e4f0 100644 --- a/internal/services/zero_trust_tunnel_cloudflared/resource.go +++ b/internal/services/zero_trust_tunnel_cloudflared/resource.go @@ -71,9 +71,9 @@ func (r *ZeroTrustTunnelCloudflaredResource) Create(ctx context.Context, req res } res := new(http.Response) env := ZeroTrustTunnelCloudflaredResultEnvelope{*data} - _, err = r.client.ZeroTrust.Tunnels.New( + _, err = r.client.ZeroTrust.Tunnels.Cloudflared.New( ctx, - zero_trust.TunnelNewParams{ + zero_trust.TunnelCloudflaredNewParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, option.WithRequestBody("application/json", dataBytes), @@ -119,10 +119,10 @@ func (r *ZeroTrustTunnelCloudflaredResource) Update(ctx context.Context, req res } res := new(http.Response) env := ZeroTrustTunnelCloudflaredResultEnvelope{*data} - _, err = r.client.ZeroTrust.Tunnels.Edit( + _, err = r.client.ZeroTrust.Tunnels.Cloudflared.Edit( ctx, data.ID.ValueString(), - zero_trust.TunnelEditParams{ + zero_trust.TunnelCloudflaredEditParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, option.WithRequestBody("application/json", dataBytes), @@ -155,10 +155,10 @@ func (r *ZeroTrustTunnelCloudflaredResource) Read(ctx context.Context, req resou res := new(http.Response) env := ZeroTrustTunnelCloudflaredResultEnvelope{*data} - _, err := r.client.ZeroTrust.Tunnels.Get( + _, err := r.client.ZeroTrust.Tunnels.Cloudflared.Get( ctx, data.ID.ValueString(), - zero_trust.TunnelGetParams{ + zero_trust.TunnelCloudflaredGetParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, option.WithResponseBodyInto(&res), @@ -193,10 +193,10 @@ func (r *ZeroTrustTunnelCloudflaredResource) Delete(ctx context.Context, req res return } - _, err := r.client.ZeroTrust.Tunnels.Delete( + _, err := r.client.ZeroTrust.Tunnels.Cloudflared.Delete( ctx, data.ID.ValueString(), - zero_trust.TunnelDeleteParams{ + zero_trust.TunnelCloudflaredDeleteParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, option.WithMiddleware(logging.Middleware(ctx)), @@ -230,10 +230,10 @@ func (r *ZeroTrustTunnelCloudflaredResource) ImportState(ctx context.Context, re res := new(http.Response) env := ZeroTrustTunnelCloudflaredResultEnvelope{*data} - _, err := r.client.ZeroTrust.Tunnels.Get( + _, err := r.client.ZeroTrust.Tunnels.Cloudflared.Get( ctx, path_tunnel_id, - zero_trust.TunnelGetParams{ + zero_trust.TunnelCloudflaredGetParams{ AccountID: cloudflare.F(path_account_id), }, option.WithResponseBodyInto(&res), diff --git a/internal/services/zero_trust_tunnel_cloudflared/schema.go b/internal/services/zero_trust_tunnel_cloudflared/schema.go index a0d33f614b..044f92a899 100644 --- a/internal/services/zero_trust_tunnel_cloudflared/schema.go +++ b/internal/services/zero_trust_tunnel_cloudflared/schema.go @@ -33,7 +33,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "config_src": schema.StringAttribute{ - Description: "Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard.", + Description: "Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard.\nAvailable values: \"local\", \"cloudflare\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -79,7 +79,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).", + Description: "The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).\nAvailable values: \"inactive\", \"degraded\", \"healthy\", \"down\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -91,7 +91,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "tun_type": schema.StringAttribute{ - Description: "The type of tunnel.", + Description: "The type of tunnel.\nAvailable values: \"cfd_tunnel\", \"warp_connector\", \"ip_sec\", \"gre\", \"cni\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_tunnel_cloudflared_config/data_source.go b/internal/services/zero_trust_tunnel_cloudflared_config/data_source.go index 0c5914ccd4..faab7e342c 100644 --- a/internal/services/zero_trust_tunnel_cloudflared_config/data_source.go +++ b/internal/services/zero_trust_tunnel_cloudflared_config/data_source.go @@ -65,7 +65,7 @@ func (d *ZeroTrustTunnelCloudflaredConfigDataSource) Read(ctx context.Context, r res := new(http.Response) env := ZeroTrustTunnelCloudflaredConfigResultDataSourceEnvelope{*data} - _, err := d.client.ZeroTrust.Tunnels.Configurations.Get( + _, err := d.client.ZeroTrust.Tunnels.Cloudflared.Configurations.Get( ctx, data.TunnelID.ValueString(), params, diff --git a/internal/services/zero_trust_tunnel_cloudflared_config/data_source_model.go b/internal/services/zero_trust_tunnel_cloudflared_config/data_source_model.go index 45b48fdf52..84416e12c1 100644 --- a/internal/services/zero_trust_tunnel_cloudflared_config/data_source_model.go +++ b/internal/services/zero_trust_tunnel_cloudflared_config/data_source_model.go @@ -18,16 +18,16 @@ type ZeroTrustTunnelCloudflaredConfigResultDataSourceEnvelope struct { } type ZeroTrustTunnelCloudflaredConfigDataSourceModel struct { - AccountID types.String `tfsdk:"account_id" path:"account_id,computed"` - TunnelID types.String `tfsdk:"tunnel_id" path:"tunnel_id,computed"` + AccountID types.String `tfsdk:"account_id" path:"account_id,required"` + TunnelID types.String `tfsdk:"tunnel_id" path:"tunnel_id,required"` CreatedAt timetypes.RFC3339 `tfsdk:"created_at" json:"created_at,computed" format:"date-time"` Source types.String `tfsdk:"source" json:"source,computed"` Version types.Int64 `tfsdk:"version" json:"version,computed"` Config customfield.NestedObject[ZeroTrustTunnelCloudflaredConfigConfigDataSourceModel] `tfsdk:"config" json:"config,computed"` } -func (m *ZeroTrustTunnelCloudflaredConfigDataSourceModel) toReadParams(_ context.Context) (params zero_trust.TunnelConfigurationGetParams, diags diag.Diagnostics) { - params = zero_trust.TunnelConfigurationGetParams{ +func (m *ZeroTrustTunnelCloudflaredConfigDataSourceModel) toReadParams(_ context.Context) (params zero_trust.TunnelCloudflaredConfigurationGetParams, diags diag.Diagnostics) { + params = zero_trust.TunnelCloudflaredConfigurationGetParams{ AccountID: cloudflare.F(m.AccountID.ValueString()), } diff --git a/internal/services/zero_trust_tunnel_cloudflared_config/data_source_schema.go b/internal/services/zero_trust_tunnel_cloudflared_config/data_source_schema.go index 077b7e45ba..8ff4229e4f 100644 --- a/internal/services/zero_trust_tunnel_cloudflared_config/data_source_schema.go +++ b/internal/services/zero_trust_tunnel_cloudflared_config/data_source_schema.go @@ -21,18 +21,18 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Attributes: map[string]schema.Attribute{ "account_id": schema.StringAttribute{ Description: "Identifier", - Computed: true, + Required: true, }, "tunnel_id": schema.StringAttribute{ Description: "UUID of the tunnel.", - Computed: true, + Required: true, }, "created_at": schema.StringAttribute{ Computed: true, CustomType: timetypes.RFC3339Type{}, }, "source": schema.StringAttribute{ - Description: "Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel's configuration on the Zero Trust dashboard.", + Description: "Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel's configuration on the Zero Trust dashboard.\nAvailable values: \"local\", \"cloudflare\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("local", "cloudflare"), @@ -58,7 +58,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "service": schema.StringAttribute{ - Description: "Protocol and address of destination server. Supported protocols: http://, https://, unix://, tcp://, ssh://, rdp://, unix+tls://, smb://. Alternatively can return a HTTP status code http_status:[code] e.g. 'http_status:404'.\n", + Description: "Protocol and address of destination server. Supported protocols: http://, https://, unix://, tcp://, ssh://, rdp://, unix+tls://, smb://. Alternatively can return a HTTP status code http_status:[code] e.g. 'http_status:404'.", Computed: true, }, "origin_request": schema.SingleNestedAttribute{ @@ -127,7 +127,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "proxy_type": schema.StringAttribute{ - Description: "cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: \"\" for the regular proxy and \"socks\" for a SOCKS5 proxy.\n", + Description: "cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: \"\" for the regular proxy and \"socks\" for a SOCKS5 proxy.", Computed: true, }, "tcp_keep_alive": schema.Int64Attribute{ @@ -213,7 +213,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "proxy_type": schema.StringAttribute{ - Description: "cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: \"\" for the regular proxy and \"socks\" for a SOCKS5 proxy.\n", + Description: "cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: \"\" for the regular proxy and \"socks\" for a SOCKS5 proxy.", Computed: true, }, "tcp_keep_alive": schema.Int64Attribute{ diff --git a/internal/services/zero_trust_tunnel_cloudflared_config/resource.go b/internal/services/zero_trust_tunnel_cloudflared_config/resource.go index 8b48b5c92b..9478a3a24a 100644 --- a/internal/services/zero_trust_tunnel_cloudflared_config/resource.go +++ b/internal/services/zero_trust_tunnel_cloudflared_config/resource.go @@ -71,10 +71,10 @@ func (r *ZeroTrustTunnelCloudflaredConfigResource) Create(ctx context.Context, r } res := new(http.Response) env := ZeroTrustTunnelCloudflaredConfigResultEnvelope{*data} - _, err = r.client.ZeroTrust.Tunnels.Configurations.Update( + _, err = r.client.ZeroTrust.Tunnels.Cloudflared.Configurations.Update( ctx, data.TunnelID.ValueString(), - zero_trust.TunnelConfigurationUpdateParams{ + zero_trust.TunnelCloudflaredConfigurationUpdateParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, option.WithRequestBody("application/json", dataBytes), @@ -121,10 +121,10 @@ func (r *ZeroTrustTunnelCloudflaredConfigResource) Update(ctx context.Context, r } res := new(http.Response) env := ZeroTrustTunnelCloudflaredConfigResultEnvelope{*data} - _, err = r.client.ZeroTrust.Tunnels.Configurations.Update( + _, err = r.client.ZeroTrust.Tunnels.Cloudflared.Configurations.Update( ctx, data.TunnelID.ValueString(), - zero_trust.TunnelConfigurationUpdateParams{ + zero_trust.TunnelCloudflaredConfigurationUpdateParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, option.WithRequestBody("application/json", dataBytes), @@ -158,10 +158,10 @@ func (r *ZeroTrustTunnelCloudflaredConfigResource) Read(ctx context.Context, req res := new(http.Response) env := ZeroTrustTunnelCloudflaredConfigResultEnvelope{*data} - _, err := r.client.ZeroTrust.Tunnels.Configurations.Get( + _, err := r.client.ZeroTrust.Tunnels.Cloudflared.Configurations.Get( ctx, data.TunnelID.ValueString(), - zero_trust.TunnelConfigurationGetParams{ + zero_trust.TunnelCloudflaredConfigurationGetParams{ AccountID: cloudflare.F(data.AccountID.ValueString()), }, option.WithResponseBodyInto(&res), @@ -213,10 +213,10 @@ func (r *ZeroTrustTunnelCloudflaredConfigResource) ImportState(ctx context.Conte res := new(http.Response) env := ZeroTrustTunnelCloudflaredConfigResultEnvelope{*data} - _, err := r.client.ZeroTrust.Tunnels.Configurations.Get( + _, err := r.client.ZeroTrust.Tunnels.Cloudflared.Configurations.Get( ctx, path_tunnel_id, - zero_trust.TunnelConfigurationGetParams{ + zero_trust.TunnelCloudflaredConfigurationGetParams{ AccountID: cloudflare.F(path_account_id), }, option.WithResponseBodyInto(&res), diff --git a/internal/services/zero_trust_tunnel_cloudflared_config/schema.go b/internal/services/zero_trust_tunnel_cloudflared_config/schema.go index 1407de5b48..9aa26900cc 100644 --- a/internal/services/zero_trust_tunnel_cloudflared_config/schema.go +++ b/internal/services/zero_trust_tunnel_cloudflared_config/schema.go @@ -57,7 +57,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "service": schema.StringAttribute{ - Description: "Protocol and address of destination server. Supported protocols: http://, https://, unix://, tcp://, ssh://, rdp://, unix+tls://, smb://. Alternatively can return a HTTP status code http_status:[code] e.g. 'http_status:404'.\n", + Description: "Protocol and address of destination server. Supported protocols: http://, https://, unix://, tcp://, ssh://, rdp://, unix+tls://, smb://. Alternatively can return a HTTP status code http_status:[code] e.g. 'http_status:404'.", Required: true, }, "origin_request": schema.SingleNestedAttribute{ @@ -145,7 +145,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: stringdefault.StaticString(""), }, "proxy_type": schema.StringAttribute{ - Description: "cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: \"\" for the regular proxy and \"socks\" for a SOCKS5 proxy.\n", + Description: "cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: \"\" for the regular proxy and \"socks\" for a SOCKS5 proxy.", Computed: true, Optional: true, Default: stringdefault.StaticString(""), @@ -258,7 +258,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Default: stringdefault.StaticString(""), }, "proxy_type": schema.StringAttribute{ - Description: "cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: \"\" for the regular proxy and \"socks\" for a SOCKS5 proxy.\n", + Description: "cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: \"\" for the regular proxy and \"socks\" for a SOCKS5 proxy.", Computed: true, Optional: true, Default: stringdefault.StaticString(""), @@ -297,7 +297,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "source": schema.StringAttribute{ - Description: "Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel's configuration on the Zero Trust dashboard.", + Description: "Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel's configuration on the Zero Trust dashboard.\nAvailable values: \"local\", \"cloudflare\".", Computed: true, Optional: true, Validators: []validator.String{ diff --git a/internal/services/zero_trust_tunnel_cloudflared_route/data_source_model.go b/internal/services/zero_trust_tunnel_cloudflared_route/data_source_model.go index 0e8cb3843b..336d090415 100644 --- a/internal/services/zero_trust_tunnel_cloudflared_route/data_source_model.go +++ b/internal/services/zero_trust_tunnel_cloudflared_route/data_source_model.go @@ -38,9 +38,6 @@ func (m *ZeroTrustTunnelCloudflaredRouteDataSourceModel) toReadParams(_ context. } func (m *ZeroTrustTunnelCloudflaredRouteDataSourceModel) toListParams(_ context.Context) (params zero_trust.NetworkRouteListParams, diags diag.Diagnostics) { - mFilterExistedAt, errs := m.Filter.ExistedAt.ValueRFC3339Time() - diags.Append(errs...) - params = zero_trust.NetworkRouteListParams{ AccountID: cloudflare.F(m.AccountID.ValueString()), } @@ -49,7 +46,7 @@ func (m *ZeroTrustTunnelCloudflaredRouteDataSourceModel) toListParams(_ context. params.Comment = cloudflare.F(m.Filter.Comment.ValueString()) } if !m.Filter.ExistedAt.IsNull() { - params.ExistedAt = cloudflare.F(mFilterExistedAt) + params.ExistedAt = cloudflare.F(m.Filter.ExistedAt.ValueString()) } if !m.Filter.IsDeleted.IsNull() { params.IsDeleted = cloudflare.F(m.Filter.IsDeleted.ValueBool()) @@ -77,13 +74,13 @@ func (m *ZeroTrustTunnelCloudflaredRouteDataSourceModel) toListParams(_ context. } type ZeroTrustTunnelCloudflaredRouteFindOneByDataSourceModel struct { - Comment types.String `tfsdk:"comment" query:"comment,optional"` - ExistedAt timetypes.RFC3339 `tfsdk:"existed_at" query:"existed_at,optional" format:"date-time"` - IsDeleted types.Bool `tfsdk:"is_deleted" query:"is_deleted,optional"` - NetworkSubset types.String `tfsdk:"network_subset" query:"network_subset,optional"` - NetworkSuperset types.String `tfsdk:"network_superset" query:"network_superset,optional"` - RouteID types.String `tfsdk:"route_id" query:"route_id,optional"` - TunTypes types.String `tfsdk:"tun_types" query:"tun_types,optional"` - TunnelID types.String `tfsdk:"tunnel_id" query:"tunnel_id,optional"` - VirtualNetworkID types.String `tfsdk:"virtual_network_id" query:"virtual_network_id,optional"` + Comment types.String `tfsdk:"comment" query:"comment,optional"` + ExistedAt types.String `tfsdk:"existed_at" query:"existed_at,optional"` + IsDeleted types.Bool `tfsdk:"is_deleted" query:"is_deleted,optional"` + NetworkSubset types.String `tfsdk:"network_subset" query:"network_subset,optional"` + NetworkSuperset types.String `tfsdk:"network_superset" query:"network_superset,optional"` + RouteID types.String `tfsdk:"route_id" query:"route_id,optional"` + TunTypes types.String `tfsdk:"tun_types" query:"tun_types,optional"` + TunnelID types.String `tfsdk:"tunnel_id" query:"tunnel_id,optional"` + VirtualNetworkID types.String `tfsdk:"virtual_network_id" query:"virtual_network_id,optional"` } diff --git a/internal/services/zero_trust_tunnel_cloudflared_route/data_source_schema.go b/internal/services/zero_trust_tunnel_cloudflared_route/data_source_schema.go index 4eb5170036..dcdda570e3 100644 --- a/internal/services/zero_trust_tunnel_cloudflared_route/data_source_schema.go +++ b/internal/services/zero_trust_tunnel_cloudflared_route/data_source_schema.go @@ -63,9 +63,8 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "existed_at": schema.StringAttribute{ - Description: "If provided, include only tunnels that were created (and not deleted) before this time.", + Description: "If provided, include only resources that were created (and not deleted) before this time. URL encoded.", Optional: true, - CustomType: timetypes.RFC3339Type{}, }, "is_deleted": schema.BoolAttribute{ Description: "If `true`, only include deleted routes. If `false`, exclude deleted routes. If empty, all routes will be included.", diff --git a/internal/services/zero_trust_tunnel_cloudflared_route/list_data_source_model.go b/internal/services/zero_trust_tunnel_cloudflared_route/list_data_source_model.go index c94239d46c..3bc6a7176e 100644 --- a/internal/services/zero_trust_tunnel_cloudflared_route/list_data_source_model.go +++ b/internal/services/zero_trust_tunnel_cloudflared_route/list_data_source_model.go @@ -20,7 +20,7 @@ type ZeroTrustTunnelCloudflaredRoutesResultListDataSourceEnvelope struct { type ZeroTrustTunnelCloudflaredRoutesDataSourceModel struct { AccountID types.String `tfsdk:"account_id" path:"account_id,required"` Comment types.String `tfsdk:"comment" query:"comment,optional"` - ExistedAt timetypes.RFC3339 `tfsdk:"existed_at" query:"existed_at,optional" format:"date-time"` + ExistedAt types.String `tfsdk:"existed_at" query:"existed_at,optional"` IsDeleted types.Bool `tfsdk:"is_deleted" query:"is_deleted,optional"` NetworkSubset types.String `tfsdk:"network_subset" query:"network_subset,optional"` NetworkSuperset types.String `tfsdk:"network_superset" query:"network_superset,optional"` @@ -33,9 +33,6 @@ type ZeroTrustTunnelCloudflaredRoutesDataSourceModel struct { } func (m *ZeroTrustTunnelCloudflaredRoutesDataSourceModel) toListParams(_ context.Context) (params zero_trust.NetworkRouteListParams, diags diag.Diagnostics) { - mExistedAt, errs := m.ExistedAt.ValueRFC3339Time() - diags.Append(errs...) - params = zero_trust.NetworkRouteListParams{ AccountID: cloudflare.F(m.AccountID.ValueString()), } @@ -44,7 +41,7 @@ func (m *ZeroTrustTunnelCloudflaredRoutesDataSourceModel) toListParams(_ context params.Comment = cloudflare.F(m.Comment.ValueString()) } if !m.ExistedAt.IsNull() { - params.ExistedAt = cloudflare.F(mExistedAt) + params.ExistedAt = cloudflare.F(m.ExistedAt.ValueString()) } if !m.IsDeleted.IsNull() { params.IsDeleted = cloudflare.F(m.IsDeleted.ValueBool()) diff --git a/internal/services/zero_trust_tunnel_cloudflared_route/list_data_source_schema.go b/internal/services/zero_trust_tunnel_cloudflared_route/list_data_source_schema.go index c53ffc2a1c..5657a4e61b 100644 --- a/internal/services/zero_trust_tunnel_cloudflared_route/list_data_source_schema.go +++ b/internal/services/zero_trust_tunnel_cloudflared_route/list_data_source_schema.go @@ -28,9 +28,8 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "existed_at": schema.StringAttribute{ - Description: "If provided, include only tunnels that were created (and not deleted) before this time.", + Description: "If provided, include only resources that were created (and not deleted) before this time. URL encoded.", Optional: true, - CustomType: timetypes.RFC3339Type{}, }, "is_deleted": schema.BoolAttribute{ Description: "If `true`, only include deleted routes. If `false`, exclude deleted routes. If empty, all routes will be included.", @@ -96,7 +95,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "tun_type": schema.StringAttribute{ - Description: "The type of tunnel.", + Description: "The type of tunnel.\nAvailable values: \"cfd_tunnel\", \"warp_connector\", \"ip_sec\", \"gre\", \"cni\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zero_trust_tunnel_cloudflared_token/data_source.go b/internal/services/zero_trust_tunnel_cloudflared_token/data_source.go index 2508d98b77..f6763b4027 100644 --- a/internal/services/zero_trust_tunnel_cloudflared_token/data_source.go +++ b/internal/services/zero_trust_tunnel_cloudflared_token/data_source.go @@ -64,8 +64,8 @@ func (d *ZeroTrustTunnelCloudflaredTokenDataSource) Read(ctx context.Context, re } res := new(http.Response) - env := ZeroTrustTunnelCloudflaredTokenResultDataSourceEnvelope{*data} - _, err := d.client.ZeroTrust.Tunnels.Token.Get( + env := ZeroTrustTunnelCloudflaredTokenResultDataSourceEnvelope{} + _, err := d.client.ZeroTrust.Tunnels.Cloudflared.Token.Get( ctx, data.TunnelID.ValueString(), params, @@ -82,7 +82,7 @@ func (d *ZeroTrustTunnelCloudflaredTokenDataSource) Read(ctx context.Context, re resp.Diagnostics.AddError("failed to deserialize http request", err.Error()) return } - data = &env.Result + data.Token = env.Result resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } diff --git a/internal/services/zero_trust_tunnel_cloudflared_token/data_source_model.go b/internal/services/zero_trust_tunnel_cloudflared_token/data_source_model.go index af20bc3ff4..95b86f92c2 100644 --- a/internal/services/zero_trust_tunnel_cloudflared_token/data_source_model.go +++ b/internal/services/zero_trust_tunnel_cloudflared_token/data_source_model.go @@ -12,16 +12,17 @@ import ( ) type ZeroTrustTunnelCloudflaredTokenResultDataSourceEnvelope struct { - Result ZeroTrustTunnelCloudflaredTokenDataSourceModel `json:"result,computed"` + Result types.String `json:"result,computed"` } type ZeroTrustTunnelCloudflaredTokenDataSourceModel struct { AccountID types.String `tfsdk:"account_id" path:"account_id,required"` TunnelID types.String `tfsdk:"tunnel_id" path:"tunnel_id,required"` + Token types.String `tfsdk:"token" json:"-,computed"` } -func (m *ZeroTrustTunnelCloudflaredTokenDataSourceModel) toReadParams(_ context.Context) (params zero_trust.TunnelTokenGetParams, diags diag.Diagnostics) { - params = zero_trust.TunnelTokenGetParams{ +func (m *ZeroTrustTunnelCloudflaredTokenDataSourceModel) toReadParams(_ context.Context) (params zero_trust.TunnelCloudflaredTokenGetParams, diags diag.Diagnostics) { + params = zero_trust.TunnelCloudflaredTokenGetParams{ AccountID: cloudflare.F(m.AccountID.ValueString()), } diff --git a/internal/services/zero_trust_tunnel_cloudflared_token/data_source_schema.go b/internal/services/zero_trust_tunnel_cloudflared_token/data_source_schema.go index 8874d9ddfc..b1ec860e9f 100644 --- a/internal/services/zero_trust_tunnel_cloudflared_token/data_source_schema.go +++ b/internal/services/zero_trust_tunnel_cloudflared_token/data_source_schema.go @@ -22,6 +22,10 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Description: "UUID of the tunnel.", Required: true, }, + "token": schema.StringAttribute{ + Description: "The Tunnel Token is used as a mechanism to authenticate the operation of a tunnel.", + Computed: true, + }, }, } } diff --git a/internal/services/zero_trust_tunnel_cloudflared_token/data_source_test.go b/internal/services/zero_trust_tunnel_cloudflared_token/data_source_test.go new file mode 100644 index 0000000000..91d592f37f --- /dev/null +++ b/internal/services/zero_trust_tunnel_cloudflared_token/data_source_test.go @@ -0,0 +1,40 @@ +package zero_trust_tunnel_cloudflared_token_test + +import ( + "fmt" + "os" + "testing" + + "github.com/cloudflare/terraform-provider-cloudflare/internal/acctest" + "github.com/cloudflare/terraform-provider-cloudflare/internal/utils" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" +) + +func TestAccCloudflareTunnelDatasource_Basic(t *testing.T) { + if os.Getenv("CLOUDFLARE_API_TOKEN") != "" { + t.Setenv("CLOUDFLARE_API_TOKEN", "") + } + + accID := os.Getenv("CLOUDFLARE_ACCOUNT_ID") + rnd := utils.GenerateRandomResourceName() + name := fmt.Sprintf("data.cloudflare_zero_trust_tunnel_cloudflared_token.%s", rnd) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + acctest.TestAccPreCheck(t) + }, + ProtoV6ProviderFactories: acctest.TestAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccCheckCloudflareTunnelDatasourceBasic(accID, rnd), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(name, "token"), + ), + }, + }, + }) +} + +func testAccCheckCloudflareTunnelDatasourceBasic(accID, name string) string { + return acctest.LoadTestCase("basic.tf", accID, name) +} diff --git a/internal/services/zero_trust_tunnel_cloudflared_token/testdata/basic.tf b/internal/services/zero_trust_tunnel_cloudflared_token/testdata/basic.tf new file mode 100644 index 0000000000..fffea52645 --- /dev/null +++ b/internal/services/zero_trust_tunnel_cloudflared_token/testdata/basic.tf @@ -0,0 +1,10 @@ +resource "cloudflare_zero_trust_tunnel_cloudflared" "%[2]s" { + account_id = "%[1]s" + name = "%[2]s" + tunnel_secret = "AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=" +} + +data "cloudflare_zero_trust_tunnel_cloudflared_token" "%[2]s" { + account_id = "%[1]s" + tunnel_id = cloudflare_zero_trust_tunnel_cloudflared.%[2]s.id +} diff --git a/internal/services/zone/data_source_schema.go b/internal/services/zone/data_source_schema.go index 678b81fbc6..b44b6059c0 100644 --- a/internal/services/zone/data_source_schema.go +++ b/internal/services/zone/data_source_schema.go @@ -61,11 +61,11 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "paused": schema.BoolAttribute{ - Description: "Indicates whether the zone is only using Cloudflare DNS services. A\ntrue value means the zone will not receive security or performance\nbenefits.\n", + Description: "Indicates whether the zone is only using Cloudflare DNS services. A\ntrue value means the zone will not receive security or performance\nbenefits.", Computed: true, }, "status": schema.StringAttribute{ - Description: "The zone status on Cloudflare.", + Description: "The zone status on Cloudflare.\nAvailable values: \"initializing\", \"pending\", \"active\", \"moved\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -77,7 +77,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "A full zone implies that DNS is hosted with Cloudflare. A partial zone is\ntypically a partner-hosted zone or a CNAME setup.\n", + Description: "A full zone implies that DNS is hosted with Cloudflare. A partial zone is\ntypically a partner-hosted zone or a CNAME setup.\nAvailable values: \"full\", \"partial\", \"secondary\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -188,20 +188,20 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "name": schema.StringAttribute{ - Description: "An account Name. Optional filter operators can be provided to extend refine the search:\n * `equal` (default)\n * `not_equal`\n * `starts_with`\n * `ends_with`\n * `contains`\n * `starts_with_case_sensitive`\n * `ends_with_case_sensitive`\n * `contains_case_sensitive`\n", + Description: "An account Name. Optional filter operators can be provided to extend refine the search:\n * `equal` (default)\n * `not_equal`\n * `starts_with`\n * `ends_with`\n * `contains`\n * `starts_with_case_sensitive`\n * `ends_with_case_sensitive`\n * `contains_case_sensitive`", Optional: true, }, }, }, "direction": schema.StringAttribute{ - Description: "Direction to order zones.", + Description: "Direction to order zones.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), }, }, "match": schema.StringAttribute{ - Description: "Whether to match all search requirements or at least one (any).", + Description: "Whether to match all search requirements or at least one (any).\nAvailable values: \"any\", \"all\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -209,11 +209,11 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "name": schema.StringAttribute{ - Description: "A domain name. Optional filter operators can be provided to extend refine the search:\n * `equal` (default)\n * `not_equal`\n * `starts_with`\n * `ends_with`\n * `contains`\n * `starts_with_case_sensitive`\n * `ends_with_case_sensitive`\n * `contains_case_sensitive`\n", + Description: "A domain name. Optional filter operators can be provided to extend refine the search:\n * `equal` (default)\n * `not_equal`\n * `starts_with`\n * `ends_with`\n * `contains`\n * `starts_with_case_sensitive`\n * `ends_with_case_sensitive`\n * `contains_case_sensitive`", Optional: true, }, "order": schema.StringAttribute{ - Description: "Field to order zones by.", + Description: "Field to order zones by.\nAvailable values: \"name\", \"status\", \"account.id\", \"account.name\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -225,7 +225,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { }, }, "status": schema.StringAttribute{ - Description: "A zone status", + Description: "A zone status\nAvailable values: \"initializing\", \"pending\", \"active\", \"moved\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zone/list_data_source_schema.go b/internal/services/zone/list_data_source_schema.go index 77ea247493..6232ed67c8 100644 --- a/internal/services/zone/list_data_source_schema.go +++ b/internal/services/zone/list_data_source_schema.go @@ -21,18 +21,18 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { return schema.Schema{ Attributes: map[string]schema.Attribute{ "direction": schema.StringAttribute{ - Description: "Direction to order zones.", + Description: "Direction to order zones.\nAvailable values: \"asc\", \"desc\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("asc", "desc"), }, }, "name": schema.StringAttribute{ - Description: "A domain name. Optional filter operators can be provided to extend refine the search:\n * `equal` (default)\n * `not_equal`\n * `starts_with`\n * `ends_with`\n * `contains`\n * `starts_with_case_sensitive`\n * `ends_with_case_sensitive`\n * `contains_case_sensitive`\n", + Description: "A domain name. Optional filter operators can be provided to extend refine the search:\n * `equal` (default)\n * `not_equal`\n * `starts_with`\n * `ends_with`\n * `contains`\n * `starts_with_case_sensitive`\n * `ends_with_case_sensitive`\n * `contains_case_sensitive`", Optional: true, }, "order": schema.StringAttribute{ - Description: "Field to order zones by.", + Description: "Field to order zones by.\nAvailable values: \"name\", \"status\", \"account.id\", \"account.name\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -44,7 +44,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "status": schema.StringAttribute{ - Description: "A zone status", + Description: "A zone status\nAvailable values: \"initializing\", \"pending\", \"active\", \"moved\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -63,13 +63,13 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "name": schema.StringAttribute{ - Description: "An account Name. Optional filter operators can be provided to extend refine the search:\n * `equal` (default)\n * `not_equal`\n * `starts_with`\n * `ends_with`\n * `contains`\n * `starts_with_case_sensitive`\n * `ends_with_case_sensitive`\n * `contains_case_sensitive`\n", + Description: "An account Name. Optional filter operators can be provided to extend refine the search:\n * `equal` (default)\n * `not_equal`\n * `starts_with`\n * `ends_with`\n * `contains`\n * `starts_with_case_sensitive`\n * `ends_with_case_sensitive`\n * `contains_case_sensitive`", Optional: true, }, }, }, "match": schema.StringAttribute{ - Description: "Whether to match all search requirements or at least one (any).", + Description: "Whether to match all search requirements or at least one (any).\nAvailable values: \"any\", \"all\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -205,11 +205,11 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "paused": schema.BoolAttribute{ - Description: "Indicates whether the zone is only using Cloudflare DNS services. A\ntrue value means the zone will not receive security or performance\nbenefits.\n", + Description: "Indicates whether the zone is only using Cloudflare DNS services. A\ntrue value means the zone will not receive security or performance\nbenefits.", Computed: true, }, "status": schema.StringAttribute{ - Description: "The zone status on Cloudflare.", + Description: "The zone status on Cloudflare.\nAvailable values: \"initializing\", \"pending\", \"active\", \"moved\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -221,7 +221,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { }, }, "type": schema.StringAttribute{ - Description: "A full zone implies that DNS is hosted with Cloudflare. A partial zone is\ntypically a partner-hosted zone or a CNAME setup.\n", + Description: "A full zone implies that DNS is hosted with Cloudflare. A partial zone is\ntypically a partner-hosted zone or a CNAME setup.\nAvailable values: \"full\", \"partial\", \"secondary\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zone/schema.go b/internal/services/zone/schema.go index c2618603b3..554d38ddad 100644 --- a/internal/services/zone/schema.go +++ b/internal/services/zone/schema.go @@ -50,7 +50,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { ElementType: types.StringType, }, "type": schema.StringAttribute{ - Description: "A full zone implies that DNS is hosted with Cloudflare. A partial zone is\ntypically a partner-hosted zone or a CNAME setup.\n", + Description: "A full zone implies that DNS is hosted with Cloudflare. A partial zone is\ntypically a partner-hosted zone or a CNAME setup.\nAvailable values: \"full\", \"partial\", \"secondary\".", Computed: true, Optional: true, Validators: []validator.String{ @@ -90,12 +90,12 @@ func ResourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "paused": schema.BoolAttribute{ - Description: "Indicates whether the zone is only using Cloudflare DNS services. A\ntrue value means the zone will not receive security or performance\nbenefits.\n", + Description: "Indicates whether the zone is only using Cloudflare DNS services. A\ntrue value means the zone will not receive security or performance\nbenefits.", Computed: true, Default: booldefault.StaticBool(false), }, "status": schema.StringAttribute{ - Description: "The zone status on Cloudflare.", + Description: "The zone status on Cloudflare.\nAvailable values: \"initializing\", \"pending\", \"active\", \"moved\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zone_cache_reserve/data_source_schema.go b/internal/services/zone_cache_reserve/data_source_schema.go index 534724281d..0dd7ba0263 100644 --- a/internal/services/zone_cache_reserve/data_source_schema.go +++ b/internal/services/zone_cache_reserve/data_source_schema.go @@ -26,7 +26,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "id": schema.StringAttribute{ - Description: "ID of the zone setting.", + Description: "ID of the zone setting.\nAvailable values: \"cache_reserve\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("cache_reserve"), @@ -38,7 +38,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { CustomType: timetypes.RFC3339Type{}, }, "value": schema.StringAttribute{ - Description: "The value of the feature", + Description: "The value of the feature\nAvailable values: \"on\", \"off\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("on", "off"), diff --git a/internal/services/zone_cache_reserve/schema.go b/internal/services/zone_cache_reserve/schema.go index 9f0928cc62..3b636c3756 100644 --- a/internal/services/zone_cache_reserve/schema.go +++ b/internal/services/zone_cache_reserve/schema.go @@ -31,7 +31,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown(), stringplanmodifier.RequiresReplace()}, }, "value": schema.StringAttribute{ - Description: "Value of the Cache Reserve zone setting.", + Description: "Value of the Cache Reserve zone setting.\nAvailable values: \"on\", \"off\".", Computed: true, Optional: true, Validators: []validator.String{ diff --git a/internal/services/zone_cache_variants/data_source_schema.go b/internal/services/zone_cache_variants/data_source_schema.go index 670f9efc4a..ef35d72bcb 100644 --- a/internal/services/zone_cache_variants/data_source_schema.go +++ b/internal/services/zone_cache_variants/data_source_schema.go @@ -26,7 +26,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "id": schema.StringAttribute{ - Description: "ID of the zone setting.", + Description: "ID of the zone setting.\nAvailable values: \"variants\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("variants"), diff --git a/internal/services/zone_dnssec/data_source_schema.go b/internal/services/zone_dnssec/data_source_schema.go index 85c4f3b542..a454309280 100644 --- a/internal/services/zone_dnssec/data_source_schema.go +++ b/internal/services/zone_dnssec/data_source_schema.go @@ -71,7 +71,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "status": schema.StringAttribute{ - Description: "Status of DNSSEC, based on user-desired state and presence of necessary records.", + Description: "Status of DNSSEC, based on user-desired state and presence of necessary records.\nAvailable values: \"active\", \"pending\", \"disabled\", \"pending-disabled\", \"error\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zone_dnssec/schema.go b/internal/services/zone_dnssec/schema.go index ec45ad75d4..b461829d5b 100644 --- a/internal/services/zone_dnssec/schema.go +++ b/internal/services/zone_dnssec/schema.go @@ -38,7 +38,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { Optional: true, }, "status": schema.StringAttribute{ - Description: "Status of DNSSEC, based on user-desired state and presence of necessary records.", + Description: "Status of DNSSEC, based on user-desired state and presence of necessary records.\nAvailable values: \"active\", \"disabled\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("active", "disabled"), diff --git a/internal/services/zone_lockdown/data_source_schema.go b/internal/services/zone_lockdown/data_source_schema.go index 3a7c084960..12e4c9ea8c 100644 --- a/internal/services/zone_lockdown/data_source_schema.go +++ b/internal/services/zone_lockdown/data_source_schema.go @@ -64,7 +64,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "target": schema.StringAttribute{ - Description: "The configuration target. You must set the target to `ip` when specifying an IP address in the Zone Lockdown rule.", + Description: "The configuration target. You must set the target to `ip` when specifying an IP address in the Zone Lockdown rule.\nAvailable values: \"ip\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("ip", "ip_range"), diff --git a/internal/services/zone_lockdown/list_data_source_schema.go b/internal/services/zone_lockdown/list_data_source_schema.go index 02f21b4e3d..ee64667cbc 100644 --- a/internal/services/zone_lockdown/list_data_source_schema.go +++ b/internal/services/zone_lockdown/list_data_source_schema.go @@ -86,7 +86,7 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "target": schema.StringAttribute{ - Description: "The configuration target. You must set the target to `ip` when specifying an IP address in the Zone Lockdown rule.", + Description: "The configuration target. You must set the target to `ip` when specifying an IP address in the Zone Lockdown rule.\nAvailable values: \"ip\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("ip", "ip_range"), diff --git a/internal/services/zone_lockdown/schema.go b/internal/services/zone_lockdown/schema.go index 50b7724f2c..8e16f18c0d 100644 --- a/internal/services/zone_lockdown/schema.go +++ b/internal/services/zone_lockdown/schema.go @@ -41,7 +41,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "target": schema.StringAttribute{ - Description: "The configuration target. You must set the target to `ip` when specifying an IP address in the Zone Lockdown rule.", + Description: "The configuration target. You must set the target to `ip` when specifying an IP address in the Zone Lockdown rule.\nAvailable values: \"ip\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("ip", "ip_range"), diff --git a/internal/services/zone_setting/data_source_schema.go b/internal/services/zone_setting/data_source_schema.go index 6384203e51..453b41a533 100644 --- a/internal/services/zone_setting/data_source_schema.go +++ b/internal/services/zone_setting/data_source_schema.go @@ -34,7 +34,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "id": schema.StringAttribute{ - Description: "ID of the zone setting.", + Description: "ID of the zone setting.\nAvailable values: \"0rtt\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -108,7 +108,7 @@ func DataSourceSchema(ctx context.Context) schema.Schema { Computed: true, }, "value": schema.StringAttribute{ - Description: "Current value of the zone setting.", + Description: "Current value of the zone setting.\nAvailable values: \"on\", \"off\".", Computed: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive("on", "off"), diff --git a/internal/services/zone_setting/schema.go b/internal/services/zone_setting/schema.go index f8da25b77e..3868610cd4 100644 --- a/internal/services/zone_setting/schema.go +++ b/internal/services/zone_setting/schema.go @@ -31,7 +31,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "id": schema.StringAttribute{ - Description: "ID of the zone setting.", + Description: "ID of the zone setting.\nAvailable values: \"0rtt\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/internal/services/zone_subscription/schema.go b/internal/services/zone_subscription/schema.go index f68f6a3cd5..f03f6134cd 100644 --- a/internal/services/zone_subscription/schema.go +++ b/internal/services/zone_subscription/schema.go @@ -26,7 +26,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, "frequency": schema.StringAttribute{ - Description: "How often the subscription is renewed automatically.", + Description: "How often the subscription is renewed automatically.\nAvailable values: \"weekly\", \"monthly\", \"quarterly\", \"yearly\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( @@ -44,7 +44,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { CustomType: customfield.NewNestedObjectType[ZoneSubscriptionRatePlanModel](ctx), Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ - Description: "The ID of the rate plan.", + Description: "The ID of the rate plan.\nAvailable values: \"free\", \"lite\", \"pro\", \"pro_plus\", \"business\", \"enterprise\", \"partners_free\", \"partners_pro\", \"partners_business\", \"partners_enterprise\".", Optional: true, Validators: []validator.String{ stringvalidator.OneOfCaseInsensitive( diff --git a/templates/guides/version-5-upgrade.md b/templates/guides/version-5-upgrade.md index 47106a90cd..df584edbe0 100644 --- a/templates/guides/version-5-upgrade.md +++ b/templates/guides/version-5-upgrade.md @@ -1090,10 +1090,32 @@ resource "cloudflare_api_token" "example" { ## cloudflare_list -- `hostname` is now a list of objects (`hostname = [{ ... }]`) instead of multiple block attribute (`hostname { ... }`). -- `item` is now a list of objects (`item = [{ ... }]`) instead of multiple block attribute (`item { ... }`). -- `redirect` is now a list of objects (`redirect = [{ ... }]`) instead of multiple block attribute (`redirect { ... }`). -- `value` is now a list of objects (`value = [{ ... }]`) instead of multiple block attribute (`value { ... }`). +- Items are no longer attached on the `cloudflare_list` resource. Instead, they should live in their own resources. + +Before + +```hcl +resource "cloudflare_list" "example" { + account_id = "f037e56e89293a057740de681ac9abbe" + item { + ip = "198.51.100.1" + } +} +``` + +After + +```hcl +resource "cloudflare_list" "example" { + account_id = "f037e56e89293a057740de681ac9abbe" +} + +resource "cloudflare_list_item" "example" { + account_id = "f037e56e89293a057740de681ac9abbe" + list_id = cloudflare_list.example.id + ip = "198.51.100.1" +} +``` ## cloudflare_list_item