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 needs account_id in provider, but is deprecated #1711

Closed
2 tasks done
cfstras opened this issue Jun 20, 2022 · 8 comments · Fixed by #1767
Closed
2 tasks done

cloudflare_zone needs account_id in provider, but is deprecated #1711

cfstras opened this issue Jun 20, 2022 · 8 comments · Fixed by #1767
Labels
kind/enhancement Categorizes issue or PR as related to improving an existing feature. service/zones Categorizes issue or PR as related to the Zones service. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@cfstras
Copy link

cfstras commented Jun 20, 2022

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

Terraform v1.2.1
on darwin_arm64
+ provider registry.terraform.io/cloudflare/cloudflare v3.17.0
+ provider registry.terraform.io/hashicorp/aws v3.75.2

Affected resource(s)

  • cloudflare_zone

Terraform configuration files

terraform {
  required_version = "~>1.0"
  required_providers {
    cloudflare = {
      source  = "cloudflare/cloudflare"
      version = "~> 3.0"
    }
  }
}

provider "cloudflare" {
  account_id = "SNIP"
}

resource "cloudflare_zone" "proxy-zone" {
  zone = "SNIP"
}

Debug output

2022-06-20T16:09:53.317+0200 [INFO]  Terraform version: 1.2.1
2022-06-20T16:09:53.317+0200 [DEBUG] using github.com/hashicorp/go-tfe v1.0.0
2022-06-20T16:09:53.317+0200 [DEBUG] using github.com/hashicorp/hcl/v2 v2.12.0
2022-06-20T16:09:53.317+0200 [DEBUG] using github.com/hashicorp/terraform-config-inspect v0.0.0-20210209133302-4fd17a0faac2
2022-06-20T16:09:53.317+0200 [DEBUG] using github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734
2022-06-20T16:09:53.317+0200 [DEBUG] using github.com/zclconf/go-cty v1.10.0
2022-06-20T16:09:53.317+0200 [INFO]  Go runtime version: go1.18.1
2022-06-20T16:09:53.317+0200 [INFO]  CLI args: []string{"/Users/claus/.improbable/imp-tool/binaries/v2/terraform/1.2.1/darwin/arm64/terraform", "plan"}
2022-06-20T16:09:53.317+0200 [DEBUG] Attempting to open CLI config file: /Users/claus/.terraformrc
2022-06-20T16:09:53.318+0200 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2022-06-20T16:09:53.318+0200 [DEBUG] checking for credentials in "/Users/claus/.terraform.d/plugins"
2022-06-20T16:09:53.318+0200 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2022-06-20T16:09:53.318+0200 [DEBUG] will search for provider plugins in /Users/claus/.terraform.d/plugins
2022-06-20T16:09:53.319+0200 [DEBUG] ignoring non-existing provider search directory /Users/claus/Library/Application Support/io.terraform/plugins
2022-06-20T16:09:53.319+0200 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2022-06-20T16:09:53.319+0200 [INFO]  CLI command args: []string{"plan"}
2022-06-20T16:09:53.319+0200 [DEBUG] New state was assigned lineage "8d20b758-7302-ce5d-011a-a9842b623d49"
2022-06-20T16:09:53.332+0200 [DEBUG] checking for provisioner in "."
2022-06-20T16:09:53.332+0200 [DEBUG] checking for provisioner in "/Users/claus/.improbable/imp-tool/binaries/v2/terraform/1.2.1/darwin/arm64"
2022-06-20T16:09:53.332+0200 [DEBUG] checking for provisioner in "/Users/claus/.terraform.d/plugins"
2022-06-20T16:09:53.333+0200 [INFO]  backend/local: starting Plan operation
2022-06-20T16:09:53.334+0200 [DEBUG] created provider logger: level=debug
2022-06-20T16:09:53.334+0200 [INFO]  provider: configuring client automatic mTLS
2022-06-20T16:09:53.344+0200 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.17.0/darwin_arm64/terraform-provider-cloudflare_v3.17.0 args=[.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.17.0/darwin_arm64/terraform-provider-cloudflare_v3.17.0]
2022-06-20T16:09:53.346+0200 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.17.0/darwin_arm64/terraform-provider-cloudflare_v3.17.0 pid=96755
2022-06-20T16:09:53.346+0200 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.17.0/darwin_arm64/terraform-provider-cloudflare_v3.17.0
2022-06-20T16:09:53.354+0200 [INFO]  provider.terraform-provider-cloudflare_v3.17.0: configuring server automatic mTLS: timestamp=2022-06-20T16:09:53.354+0200
2022-06-20T16:09:53.363+0200 [DEBUG] provider: using plugin: version=5
2022-06-20T16:09:53.363+0200 [DEBUG] provider.terraform-provider-cloudflare_v3.17.0: plugin address: address=/var/folders/v8/k2h3bjbd0wd071yx066pnxtw0000gn/T/plugin2539318530 network=unix timestamp=2022-06-20T16:09:53.363+0200
2022-06-20T16:09:53.382+0200 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2022-06-20T16:09:53.382+0200 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.17.0/darwin_arm64/terraform-provider-cloudflare_v3.17.0 pid=96755
2022-06-20T16:09:53.382+0200 [DEBUG] provider: plugin exited
2022-06-20T16:09:53.382+0200 [DEBUG] Building and walking validate graph
2022-06-20T16:09:53.382+0200 [DEBUG] ProviderTransformer: "cloudflare_zone.proxy-zone" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/cloudflare/cloudflare"]
2022-06-20T16:09:53.382+0200 [DEBUG] ReferenceTransformer: "cloudflare_zone.proxy-zone" references: []
2022-06-20T16:09:53.382+0200 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/cloudflare/cloudflare\"]" references: []
2022-06-20T16:09:53.382+0200 [DEBUG] Starting graph walk: walkValidate
2022-06-20T16:09:53.383+0200 [DEBUG] created provider logger: level=debug
2022-06-20T16:09:53.383+0200 [INFO]  provider: configuring client automatic mTLS
2022-06-20T16:09:53.391+0200 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.17.0/darwin_arm64/terraform-provider-cloudflare_v3.17.0 args=[.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.17.0/darwin_arm64/terraform-provider-cloudflare_v3.17.0]
2022-06-20T16:09:53.393+0200 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.17.0/darwin_arm64/terraform-provider-cloudflare_v3.17.0 pid=96756
2022-06-20T16:09:53.393+0200 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.17.0/darwin_arm64/terraform-provider-cloudflare_v3.17.0
2022-06-20T16:09:53.400+0200 [INFO]  provider.terraform-provider-cloudflare_v3.17.0: configuring server automatic mTLS: timestamp=2022-06-20T16:09:53.400+0200
2022-06-20T16:09:53.409+0200 [DEBUG] provider: using plugin: version=5
2022-06-20T16:09:53.409+0200 [DEBUG] provider.terraform-provider-cloudflare_v3.17.0: plugin address: address=/var/folders/v8/k2h3bjbd0wd071yx066pnxtw0000gn/T/plugin3282743163 network=unix timestamp=2022-06-20T16:09:53.409+0200
2022-06-20T16:09:53.432+0200 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2022-06-20T16:09:53.432+0200 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.17.0/darwin_arm64/terraform-provider-cloudflare_v3.17.0 pid=96756
2022-06-20T16:09:53.432+0200 [DEBUG] provider: plugin exited
2022-06-20T16:09:53.432+0200 [INFO]  backend/local: plan calling Plan
2022-06-20T16:09:53.432+0200 [DEBUG] Building and walking plan graph for NormalMode
2022-06-20T16:09:53.432+0200 [DEBUG] ProviderTransformer: "cloudflare_zone.proxy-zone (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/cloudflare/cloudflare"]
2022-06-20T16:09:53.432+0200 [DEBUG] ReferenceTransformer: "cloudflare_zone.proxy-zone (expand)" references: []
2022-06-20T16:09:53.432+0200 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/cloudflare/cloudflare\"]" references: []
2022-06-20T16:09:53.433+0200 [DEBUG] Starting graph walk: walkPlan
2022-06-20T16:09:53.433+0200 [DEBUG] created provider logger: level=debug
2022-06-20T16:09:53.433+0200 [INFO]  provider: configuring client automatic mTLS
2022-06-20T16:09:53.441+0200 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.17.0/darwin_arm64/terraform-provider-cloudflare_v3.17.0 args=[.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.17.0/darwin_arm64/terraform-provider-cloudflare_v3.17.0]
2022-06-20T16:09:53.442+0200 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.17.0/darwin_arm64/terraform-provider-cloudflare_v3.17.0 pid=96757
2022-06-20T16:09:53.443+0200 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.17.0/darwin_arm64/terraform-provider-cloudflare_v3.17.0
2022-06-20T16:09:53.450+0200 [INFO]  provider.terraform-provider-cloudflare_v3.17.0: configuring server automatic mTLS: timestamp=2022-06-20T16:09:53.450+0200
2022-06-20T16:09:53.459+0200 [DEBUG] provider: using plugin: version=5
2022-06-20T16:09:53.459+0200 [DEBUG] provider.terraform-provider-cloudflare_v3.17.0: plugin address: address=/var/folders/v8/k2h3bjbd0wd071yx066pnxtw0000gn/T/plugin3361545931 network=unix timestamp=2022-06-20T16:09:53.459+0200
2022-06-20T16:09:53.479+0200 [WARN]  ValidateProviderConfig from "provider[\"registry.terraform.io/cloudflare/cloudflare\"]" changed the config value, but that value is unused
2022-06-20T16:09:53.480+0200 [INFO]  provider.terraform-provider-cloudflare_v3.17.0: using specified account id SNIP in Cloudflare provider: tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_req_id=52005446-b99b-dc28-1ac8-9d79dc2e4fac tf_rpc=Configure @caller=github.com/cloudflare/terraform-provider-cloudflare/internal/provider/provider.go:299 @module=cloudflare timestamp=2022-06-20T16:09:53.480+0200
2022-06-20T16:09:53.480+0200 [DEBUG] Resource instance state not found for node "cloudflare_zone.proxy-zone", instance cloudflare_zone.proxy-zone
2022-06-20T16:09:53.480+0200 [DEBUG] ReferenceTransformer: "cloudflare_zone.proxy-zone" references: []
2022-06-20T16:09:53.480+0200 [DEBUG] refresh: cloudflare_zone.proxy-zone: no state, so not refreshing
2022-06-20T16:09:53.481+0200 [WARN]  Provider "registry.terraform.io/cloudflare/cloudflare" produced an invalid plan for cloudflare_zone.proxy-zone, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .type: planned value cty.StringVal("full") for a non-computed attribute
2022-06-20T16:09:53.481+0200 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2022-06-20T16:09:53.482+0200 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.17.0/darwin_arm64/terraform-provider-cloudflare_v3.17.0 pid=96757
2022-06-20T16:09:53.482+0200 [DEBUG] provider: plugin exited
2022-06-20T16:09:53.482+0200 [DEBUG] building apply graph to check for errors
2022-06-20T16:09:53.482+0200 [DEBUG] Resource state not found for node "cloudflare_zone.proxy-zone", instance cloudflare_zone.proxy-zone
2022-06-20T16:09:53.482+0200 [DEBUG] ProviderTransformer: "cloudflare_zone.proxy-zone (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/cloudflare/cloudflare"]
2022-06-20T16:09:53.482+0200 [DEBUG] ProviderTransformer: "cloudflare_zone.proxy-zone" (*terraform.NodeApplyableResourceInstance) needs provider["registry.terraform.io/cloudflare/cloudflare"]
2022-06-20T16:09:53.482+0200 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/cloudflare/cloudflare\"]" references: []
2022-06-20T16:09:53.482+0200 [DEBUG] ReferenceTransformer: "cloudflare_zone.proxy-zone (expand)" references: []
2022-06-20T16:09:53.482+0200 [DEBUG] ReferenceTransformer: "cloudflare_zone.proxy-zone" references: []
2022-06-20T16:09:53.482+0200 [INFO]  backend/local: plan operation completed

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # cloudflare_zone.proxy-zone will be created
  + resource "cloudflare_zone" "proxy-zone" {
      + id                  = (known after apply)
      + meta                = (known after apply)
      + name_servers        = (known after apply)
      + plan                = (known after apply)
      + status              = (known after apply)
      + type                = "full"
      + vanity_name_servers = (known after apply)
      + verification_key    = (known after apply)
      + zone                = "SNIP"
    }

Plan: 1 to add, 0 to change, 0 to destroy.
╷
│ Warning: Argument is deprecated
│
│   with provider["registry.terraform.io/cloudflare/cloudflare"],
│   on test.tf line 12, in provider "cloudflare":
│   12:   account_id = "SNIP"
│
│ Use resource specific `account_id` attributes instead.
│
│ (and one more similar warning elsewhere)
╵

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now.

Panic output

No response

Expected output

No deprecation warning.

If I set the account_id on the cloudflare_zone instead, I get this error:

╷
│ Error: Unsupported argument
│
│   on ../module/cloudflare_zone.tf line 3, in resource "cloudflare_zone" "proxy-zone":
│    3:   account_id = var.cloudflare_account_id
│
│ An argument named "account_id" is not expected here.
╵

Actual output

╷
│Warning: Argument is deprecated
│
│  with module.shared_infrastructure.provider["registry.terraform.io/cloudflare/cloudflare"],
│  on ../module/terraform.tf line 6, in provider "cloudflare":
│   6:   account_id = "SNIP"
│
│Use resource specific `account_id` attributes instead.
╵

Steps to reproduce

  1. Save terraform file (see repro above)
  2. terraform init
  3. terraform plan / apply

Additional factoids

No response

References

No response

@cfstras cfstras added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 20, 2022
@jacobbednarz jacobbednarz added kind/enhancement Categorizes issue or PR as related to improving an existing feature. triage/accepted Indicates an issue or PR is ready to be actively worked on. service/zones Categorizes issue or PR as related to the Zones service. and removed kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 21, 2022
@ChristophShyper
Copy link
Contributor

Apparently (#1716) they marked it as deprecated now, but there are no handlers for account_id in any of the resources yet. They will add it in the future.
So now we just have junk output with false-positives...

@peterh-lon
Copy link

yeah cloudflare_load_balancer_monitor is the same, documentation is not updated either anywhere

@av-2024
Copy link

av-2024 commented Jul 20, 2022

Getting the same deprecation warning for account_id with cloudflare_argo_tunnel. Shouldn't the deprecation message be added AFTER the new usage is available?

@NJITman
Copy link

NJITman commented Jul 25, 2022

Do we have a list of affected resources? A current project has cloudflare_load_balancer_monitor, cloudflare_load_balancer_pool and cloudflare_load_balancer resources. Not providing account_id in the provider causes the resources to fail deployment. Adding account_id to provider adds the warning. I assume it is only account level resources, since simply A and CNAME records are not affected.

@github-actions
Copy link
Contributor

This functionality has been released in v3.20.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!

@george-angel
Copy link

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

No it hasn't, please re-open.

@NJITman
Copy link

NJITman commented Sep 9, 2022

It is listed for 4.x release.

#1646

@ferzescu
Copy link

still experience issue on

    cloudflare = {
      source  = "cloudflare/cloudflare"
      version = "~> 4"
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Categorizes issue or PR as related to improving an existing feature. service/zones Categorizes issue or PR as related to the Zones service. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants