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

import of cloudflare_argo_tunnel resource fails with invalid API error #1329

Closed
2 tasks done
tjstansell opened this issue Dec 3, 2021 · 0 comments
Closed
2 tasks done
Labels
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.

Comments

@tjstansell
Copy link
Contributor

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 -v
Terraform v1.0.11
on linux_amd64
+ provider registry.terraform.io/cloudflare/cloudflare v3.4.0
+ provider registry.terraform.io/hashicorp/random v3.1.0

Affected resource(s)

cloudflare_argo_tunnel

Terraform configuration files

resource "random_id" "tunnel_secret" {
  byte_length = 32
}

resource "cloudflare_argo_tunnel" "this" {
  account_id = var.account_id
  name       = var.name
  secret     = random_id.tunnel_secret.b64_std
}

Debug output

initial part of import succeeds:

module.mytunnel.cloudflare_argo_tunnel.this: Importing from ID "<accountid>/<tunnelid>"...
2021-12-03T07:43:19.903Z [INFO]  provider.terraform-provider-cloudflare_v3.4.0: 2021/12/03 07:43:19 [DEBUG] Cloudflare API Request Details:
---[ REQUEST ]---------------------------------------
GET /client/v4/accounts/<accountid>/tunnels/<tunnelid> HTTP/1.1
Host: api.cloudflare.com
User-Agent: terraform/1.0.11 terraform-plugin-sdk/2.8.0 terraform-provider-cloudflare/3.4.0
Accept: application/json;version=1
Authorization: Bearer <token>
Content-Type: application/json
Accept-Encoding: gzip


-----------------------------------------------------: timestamp=2021-12-03T07:43:19.903Z
2021-12-03T07:43:20.129Z [INFO]  provider.terraform-provider-cloudflare_v3.4.0: 2021/12/03 07:43:20 [DEBUG] Cloudflare API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK

but then right after it uses an api call without the accountid:

-----------------------------------------------------: timestamp=2021-12-03T07:43:20.128Z
2021-12-03T07:43:20.154Z [INFO]  provider.terraform-provider-cloudflare_v3.4.0: 2021/12/03 07:43:20 [DEBUG] Cloudflare API Request Details:
---[ REQUEST ]---------------------------------------
GET /client/v4/accounts//tunnels/<tunnelid> HTTP/1.1
Host: api.cloudflare.com
User-Agent: terraform/1.0.11 terraform-plugin-sdk/2.8.0 terraform-provider-cloudflare/3.4.0
Accept: application/json;version=1
Authorization: Bearer <token>
Content-Type: application/json
Accept-Encoding: gzip

-----------------------------------------------------: timestamp=2021-12-03T07:43:20.154Z
2021-12-03T07:43:20.336Z [INFO]  provider.terraform-provider-cloudflare_v3.4.0: 2021/12/03 07:43:20 [DEBUG] Cloudflare API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 400 Bad Request

Panic output

No response

Expected output

import should have succeeded.

Actual output

got an error during import:

Error: failed to fetch Argo Tunnel: HTTP status 400: Could not route to /accounts/tunnels/<tunnelid>, perhaps your object identifier is invalid? (7003), No route for that URI (7000)

Steps to reproduce

try to import any cloudflare_argo_tunnel resource.

Additional factoids

No response

References

No response

@tjstansell tjstansell 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 Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

No branches or pull requests

2 participants