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

add cloudflare_api_shield resource #1874

Merged
merged 7 commits into from Sep 1, 2022

Conversation

jafowler
Copy link
Contributor

This PR requires cloudflare-go@v0.49.0 to merge. It will be angry until then. I'll wait for dependabot to do its thing then i'll rebase.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 31, 2022

changelog detected ✅

@jacobbednarz
Copy link
Member

v0.49.0 landed here yesterday; bumping your branch in case it was cut prior to the merge.

client := meta.(*cloudflare.API)
zoneID := d.Get("zone_id")

_, err := client.UpdateAPIShieldConfiguration(ctx, cloudflare.ZoneIdentifier(zoneID.(string)), cloudflare.UpdateAPIShieldParams{nil})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't seem to be working. the payload is {"auth_id_characteristics":null} however, i'm unsure what it should be. could you find out? we may need to update the Go library if it is expecting no keys too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I followed up with the team:

we usually tend to preserve configurations and not delete them.
The endpoint currently has only one configuration value. To remove that one can send as the payload using PUT:
{"auth_id_characteristics":[]}

I will update the PR to send an empty auth_id_characteristics

@jacobbednarz
Copy link
Member

acceptance tests are looking good!

TF_ACC=1 go test $(go list ./...) -v -run "^TestAccAPIShield_" -count 1 -parallel 1 -timeout 120m -parallel 1
?       github.com/cloudflare/terraform-provider-cloudflare     [no test files]
=== RUN   TestAccAPIShield_Basic
--- PASS: TestAccAPIShield_Basic (9.35s)
PASS
ok      github.com/cloudflare/terraform-provider-cloudflare/internal/provider   10.118s
?       github.com/cloudflare/terraform-provider-cloudflare/tools/cmd/changelog-check   [no test files]
?       github.com/cloudflare/terraform-provider-cloudflare/tools/cmd/maintainer-only-file-check        [no test files]
?       github.com/cloudflare/terraform-provider-cloudflare/tools/cmd/tf-log-check      [no test files]
?       github.com/cloudflare/terraform-provider-cloudflare/version     [no test files]

@jacobbednarz jacobbednarz merged commit 828bfe1 into cloudflare:master Sep 1, 2022
@github-actions github-actions bot added this to the v3.23.0 milestone Sep 1, 2022
@jacobbednarz
Copy link
Member

github-actions bot pushed a commit that referenced this pull request Sep 1, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2022

This functionality has been released in v3.23.0 of the Terraform Cloudflare Provider.

Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants