Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enforce account_id for resources that previously depended on global account_id #2153

Merged
merged 1 commit into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .changelog/2153.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
```release-note:breaking-change
resource/cloudflare_zone: `account_id` is now required
```

```release-note:breaking-change
resource/cloudflare_load_balancer_pool: `account_id` is now required
```

```release-note:breaking-change
resource/cloudflare_load_balancer_monitor: `account_id` is now required
```

```release-note:breaking-change
resource/cloudflare_account_member: `account_id` is now required
```

```release-note:breaking-change
resource/cloudflare_workers_kv_namespace: `account_id` is now required
```

```release-note:breaking-change
resource/cloudflare_workers_kv: `account_id` is now required
```

```release-note:breaking-change
resource/cloudflare_workers_script: `account_id` is now required
```
2 changes: 1 addition & 1 deletion docs/resources/account_member.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ resource "cloudflare_account_member" "example_user" {

### Required

- `account_id` (String) Account ID to create the account member in.
- `email_address` (String) The email address of the user who you wish to manage. Following creation, this field becomes read only via the API and cannot be updated.
- `role_ids` (Set of String) List of account role IDs that you want to assign to a member.

### Optional

- `account_id` (String) Account ID to create the account member in.
- `status` (String) A member's status in the account. Available values: `accepted`, `pending`.

### Read-Only
Expand Down
5 changes: 4 additions & 1 deletion docs/resources/load_balancer_monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ resource "cloudflare_load_balancer_monitor" "example" {
<!-- schema generated by tfplugindocs -->
## Schema

### Optional
### Required

- `account_id` (String) The account identifier to target for the resource.

### Optional

- `allow_insecure` (Boolean) Do not validate the certificate when monitor use HTTPS. Only valid if `type` is "http" or "https".
- `description` (String) Free text description.
- `expected_body` (String) A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. Only valid if `type` is "http" or "https".
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/load_balancer_pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ resource "cloudflare_load_balancer_pool" "example" {

### Required

- `account_id` (String) The account identifier to target for the resource.
- `name` (String) A short name (tag) for the pool.
- `origins` (Block Set, Min: 1) The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. (see [below for nested schema](#nestedblock--origins))

### Optional

- `account_id` (String) The account identifier to target for the resource.
- `check_regions` (Set of String) A list of regions (specified by region code) from which to run health checks. Empty means every Cloudflare data center (the default), but requires an Enterprise plan. Region codes can be found [here](https://developers.cloudflare.com/load-balancing/reference/region-mapping-api).
- `description` (String) Free text description.
- `enabled` (Boolean) Whether to enable (the default) this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any). Defaults to `true`.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/worker_script.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ resource "cloudflare_worker_script" "my_script" {

### Required

- `account_id` (String) The account identifier to target for the resource.
- `content` (String) The script content.
- `name` (String) The name for the script. **Modifying this attribute will force creation of a new resource.**

### Optional

- `account_id` (String) The account identifier to target for the resource.
- `analytics_engine_binding` (Block Set) (see [below for nested schema](#nestedblock--analytics_engine_binding))
- `kv_namespace_binding` (Block Set) (see [below for nested schema](#nestedblock--kv_namespace_binding))
- `module` (Boolean) Whether to upload Worker as a module.
Expand Down
5 changes: 1 addition & 4 deletions docs/resources/workers_kv.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,11 @@ resource "cloudflare_workers_kv" "example" {

### Required

- `account_id` (String) The account identifier to target for the resource.
- `key` (String) Name of the KV pair. **Modifying this attribute will force creation of a new resource.**
- `namespace_id` (String) The ID of the Workers KV namespace in which you want to create the KV pair. **Modifying this attribute will force creation of a new resource.**
- `value` (String) Value of the KV pair.

### Optional

- `account_id` (String) The account identifier to target for the resource.

### Read-Only

- `id` (String) The ID of this resource.
Expand Down
5 changes: 1 addition & 4 deletions docs/resources/workers_kv_namespace.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,8 @@ resource "cloudflare_workers_kv_namespace" "example" {

### Required

- `title` (String) Title value of the Worker KV Namespace.

### Optional

- `account_id` (String) The account identifier to target for the resource.
- `title` (String) Title value of the Worker KV Namespace.

### Read-Only

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/zone.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ resource "cloudflare_zone" "example" {

### Required

- `account_id` (String) Account ID to manage the zone resource in.
- `zone` (String) The DNS zone name which will be added. **Modifying this attribute will force creation of a new resource.**

### Optional

- `account_id` (String) Account ID to manage the zone resource in.
- `jump_start` (Boolean) Whether to scan for DNS records on creation. Ignored after zone is created.
- `paused` (Boolean) Whether this zone is paused (traffic bypasses Cloudflare). Defaults to `false`.
- `plan` (String) The name of the commercial plan to apply to the zone. Available values: `free`, `lite`, `pro`, `pro_plus`, `business`, `enterprise`, `partners_free`, `partners_pro`, `partners_business`, `partners_enterprise`.
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/schema_cloudflare_account_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func resourceCloudflareAccountMemberSchema() map[string]*schema.Schema {
return map[string]*schema.Schema{
"account_id": {
Type: schema.TypeString,
Optional: true,
Required: true,
Description: "Account ID to create the account member in.",
},
"email_address": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func resourceCloudflareLoadBalancerMonitorSchema() map[string]*schema.Schema {
"account_id": {
Description: "The account identifier to target for the resource.",
Type: schema.TypeString,
Optional: true,
Required: true,
},

"description": {
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/schema_cloudflare_load_balancer_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func resourceCloudflareLoadBalancerPoolSchema() map[string]*schema.Schema {
"account_id": {
Description: "The account identifier to target for the resource.",
Type: schema.TypeString,
Optional: true,
Required: true,
},

"name": {
Expand Down
3 changes: 1 addition & 2 deletions internal/provider/schema_cloudflare_workers_kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ func resourceCloudflareWorkerKVSchema() map[string]*schema.Schema {
"account_id": {
Description: "The account identifier to target for the resource.",
Type: schema.TypeString,
Optional: true,
Computed: true,
Required: true,
},
"key": {
Type: schema.TypeString,
Expand Down
3 changes: 1 addition & 2 deletions internal/provider/schema_cloudflare_workers_kv_namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ func resourceCloudflareWorkersKVNamespaceSchema() map[string]*schema.Schema {
"account_id": {
Description: "The account identifier to target for the resource.",
Type: schema.TypeString,
Optional: true,
Computed: true,
Required: true,
},
"title": {
Type: schema.TypeString,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/schema_cloudflare_workers_script.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func resourceCloudflareWorkerScriptSchema() map[string]*schema.Schema {
"account_id": {
Description: "The account identifier to target for the resource.",
Type: schema.TypeString,
Optional: true,
Required: true,
},
"name": {
Type: schema.TypeString,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/schema_cloudflare_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func resourceCloudflareZoneSchema() map[string]*schema.Schema {
return map[string]*schema.Schema{
"account_id": {
Type: schema.TypeString,
Optional: true,
Required: true,
Description: "Account ID to manage the zone resource in.",
},
"zone": {
Expand Down