Skip to content

Commit

Permalink
According to the documentation the enabled flag must be set to null (…
Browse files Browse the repository at this point in the history
…or nil)

in order for the association to be destroyed. Setting this to false keeps the
association in a disabled state instead of destroying the resource.

Documentation on this API endpoint can be found here:

https://developers.cloudflare.com/api/operations/per-hostname-authenticated-origin-pull-enable-or-disable-a-hostname-for-client-authentication

Referencing issue raised on provider:

#4648
  • Loading branch information
Philip Skinner committed Nov 22, 2024
1 parent e2013d8 commit fa512e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/4649.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/cloudflare_authenticated_origin_pulls: Fix issue where resources are disabled instead of being destroyed on `tf destroy`
```
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func resourceCloudflareAuthenticatedOriginPullsDelete(ctx context.Context, d *sc
conf := []cloudflare.PerHostnameAuthenticatedOriginPullsConfig{{
CertID: aopCert,
Hostname: hostname,
Enabled: false,
Enabled: nil,

Check failure on line 126 in internal/sdkv2provider/resource_cloudflare_authenticated_origin_pulls.go

View workflow job for this annotation

GitHub Actions / golangci-lint

cannot use nil as bool value in struct literal) (typecheck)

Check failure on line 126 in internal/sdkv2provider/resource_cloudflare_authenticated_origin_pulls.go

View workflow job for this annotation

GitHub Actions / golangci-lint

cannot use nil as bool value in struct literal) (typecheck)

Check failure on line 126 in internal/sdkv2provider/resource_cloudflare_authenticated_origin_pulls.go

View workflow job for this annotation

GitHub Actions / golangci-lint

cannot use nil as bool value in struct literal) (typecheck)

Check failure on line 126 in internal/sdkv2provider/resource_cloudflare_authenticated_origin_pulls.go

View workflow job for this annotation

GitHub Actions / golangci-lint

cannot use nil as bool value in struct literal (typecheck)

Check failure on line 126 in internal/sdkv2provider/resource_cloudflare_authenticated_origin_pulls.go

View workflow job for this annotation

GitHub Actions / test

cannot use nil as bool value in struct literal

Check failure on line 126 in internal/sdkv2provider/resource_cloudflare_authenticated_origin_pulls.go

View workflow job for this annotation

GitHub Actions / tfproviderlint (ubuntu-latest)

cannot use nil as bool value in struct literal

Check failure on line 126 in internal/sdkv2provider/resource_cloudflare_authenticated_origin_pulls.go

View workflow job for this annotation

GitHub Actions / tfproviderlint (ubuntu-latest)

cannot use nil as bool value in struct literal

Check failure on line 126 in internal/sdkv2provider/resource_cloudflare_authenticated_origin_pulls.go

View workflow job for this annotation

GitHub Actions / tfproviderlint (ubuntu-latest)

cannot use nil as bool value in struct literal

Check failure on line 126 in internal/sdkv2provider/resource_cloudflare_authenticated_origin_pulls.go

View workflow job for this annotation

GitHub Actions / tfproviderlint (ubuntu-latest)

cannot use nil as bool value in struct literal
}}
_, err := client.EditPerHostnameAuthenticatedOriginPullsConfig(ctx, zoneID, conf)
if err != nil {
Expand Down

0 comments on commit fa512e3

Please sign in to comment.