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

cloudflare_zone: add verification_key attribute #509

Closed
wants to merge 20 commits into from

Conversation

inge4pres
Copy link
Contributor

This supersedes #492, fixes #280

@ghost ghost added size/XS kind/documentation Categorizes issue or PR as related to documentation. labels Oct 10, 2019
@patryk
Copy link
Contributor

patryk commented Oct 15, 2019

We're good with this one despite the test failing (for now)?

@inge4pres
Copy link
Contributor Author

Hi @patryk I was able to setup an Enterprise zone with a custom built provider. I'd like to do an additional test to validate if #488 is impacting here too, then your call or @jacobbednarz for when it's safe to merge 😄

@jacobbednarz
Copy link
Member

I'm on the fence; I'd really rather not have the integration tests failing on master as that is helpful to know whether changes in the codebase or Cloudflare API have introduced regressions.

@jacobbednarz
Copy link
Member

This now passes locally but not in CI 🤔

When we initially put the zone sweeper into place, it was in a shared
account that we couldn't just remove everything. This meant the
`ListZones` needed to only look up the zones we were expecting to
remove and clear those out. This is no longer the case as the tests run
against a dedicated account so we can blow everything away that isn't
the static `cfapi.net` domains (`terraform` and `terraform2`).

Fixes the following integration test failure.

```
=== RUN   TestAccCloudflareZoneBasic
--- FAIL: TestAccCloudflareZoneBasic (0.79s)
    testing.go:569: Step 0 error: errors during apply:

        Error: Error creating zone "example.cfapi.net": error from makeRequest: HTTP status 400: content "{\"success\":false,\"errors\":[{\"code\":1061,\"message\":\"example.cfapi.net already exists\"}],\"messages\":[],\"result\":null}"

          on /opt/teamcity-agent/temp/buildTmp/tf-test007851057/main.tf line 2:
          (source code not available)

FAIL
```
Updates the certificates used for custom SSL to prevent exceptions with
the expiry.

```
=== RUN   TestAccCloudflareCustomSSL_Basic
=== PAUSE TestAccCloudflareCustomSSL_Basic
=== CONT  TestAccCloudflareCustomSSL_Basic
--- FAIL: TestAccCloudflareCustomSSL_Basic (0.28s)
    testing.go:569: Step 0 error: errors during apply:

        Error: Failed to create custom ssl cert: error from makeRequest: HTTP status 400: content "{\"success\":false,\"errors\":[{\"code\":1206,\"message\":\"The certificate will expire within soon. Please supply a newer one\"}],\"messages\":[],\"result\":null}"

          on /opt/teamcity-agent/temp/buildTmp/tf-test656714404/main.tf line 2:
          (source code not available)

FAIL
```
@inge4pres
Copy link
Contributor Author

@jacobbednarz what kind of error arises in CI? I was able to do an E2E creation of Enterprise zone using the provider built with this version

The Access Service Tokens endpoints unfortunately don't support API
tokens (the default authentication mechanism used in the tests) so we
need to unset it during test runs until this is resolved. It throws a
very confusing "insufficient permissions" exception.

```
=== RUN   TestAccAccessServiceTokenCreate
--- FAIL: TestAccAccessServiceTokenCreate (0.56s)
    testing.go:569: Step 0 error: errors during apply:

        Error: error creating access service token: error from makeRequest: HTTP status 403: insufficient permissions

          on /opt/teamcity-agent/temp/buildTmp/tf-test595601124/main.tf line 2:
          (source code not available)

FAIL
```
…ccess-service-tokens

* Add support for Access Service Tokens

Introduces support for Access Service Tokens[1] as an available resource

[1]: https://api.cloudflare.com/#access-service-tokens-properties
@jacobbednarz
Copy link
Member

The failure is

------- Stdout: -------
=== RUN   TestAccCloudflareZonePartialSetupEnterprise
--- FAIL: TestAccCloudflareZonePartialSetupEnterprise (11.13s)
    testing.go:569: Step 0 error: Check failed: Check 3/5 error: cloudflare_zone.tf-acc-partial-setup-zone: Attribute 'plan' expected "enterprise", got "free"
FAIL

But locally, it works as expected. I haven't had a chance to dig into this yet though. Might need another merge from master to get the partial support stuff in here?

@ghost ghost added size/XXL dependencies and removed size/XS labels Nov 2, 2019
@inge4pres
Copy link
Contributor Author

Hi @jacobbednarz I rebased from master including chages that fix #488 can you please verify this goes through CI?
Thanks 😄

@jacobbednarz jacobbednarz mentioned this pull request Nov 3, 2019
@jacobbednarz
Copy link
Member

Re-applied this in #532 as this one is messy due to merge updates.

jacobbednarz added a commit that referenced this pull request Nov 3, 2019
* cherry-pick dd8fbba with merge resolution

* use cfapi.net domain for tests
boekkooi-lengoo pushed a commit to boekkooi-lengoo/terraform-provider-cloudflare that referenced this pull request Feb 28, 2022
)

Adding this so it can be used in the Terraform provider easily.

Co-authored-by: Callum Loh <cloh@squiz.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies kind/documentation Categorizes issue or PR as related to documentation. size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Creating Partial (CNAME) Zones
4 participants