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

Generating cloudflare_tunnel uses the 'tunnel_token' for 'secret' field #573

Open
2 tasks done
Weshnaw opened this issue Jun 5, 2023 · 0 comments
Open
2 tasks done

Comments

@Weshnaw
Copy link

Weshnaw commented Jun 5, 2023

Confirmation

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

cf-terraforming version

cf-terraforming v0.12.0

Expected outcome

I expect the output to be formatted such:

resource "cloudflare_tunnel" "terraform_managed_resource_tunnel_id" {
  account_id = "account_id"
  name       = "tunnel_name"
  secret     = "tunnel_secret"
}

Actual outcome

what is actually output

resource "cloudflare_tunnel" "terraform_managed_resource_tunnel_id" {
  account_id = "account_id"
  name       = "tunnel_name"
  secret     = "tunnel_token"
}

NOTE: that we can run the "tunnel_token" through base64 -d to show that it's the token and not just a base64 looking secret

echo "tunnel_token" | base64 -d
{"a":"account_id","t":"tunnel_id","s":"actual_tunnel_secret"}

Steps to reproduce

  1. have an existing cloudflare tunnel
  2. add CLOUDFLARE_API_TOKEN env variable with edit permissions to cloudflare tunnels
  3. create minimal cloudflare.tf
  4. run terraform init
  5. run cf-terraforming generate --resource-type "cloudflare_tunnel" -a account_id
cloudflare.tf
terraform {
  required_providers {
    cloudflare = {
      source  = "cloudflare/cloudflare"
      version = "~> 4.0"
    }
  }
}

provider "cloudflare" {
}

References

No response

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

No branches or pull requests

1 participant