cf-terraforming
cf-terraforming copied to clipboard
Generating cloudflare_tunnel uses the 'tunnel_token' for 'secret' field
Confirmation
- [X] My issue isn't already found on the issue tracker.
- [X] 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
- have an existing cloudflare tunnel
- add CLOUDFLARE_API_TOKEN env variable with edit permissions to cloudflare tunnels
- create minimal
cloudflare.tf - run terraform init
- 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