cf-terraforming icon indicating copy to clipboard operation
cf-terraforming copied to clipboard

FATA 0023 configuration is invalid

Open JamesArthurHolland opened this issue 3 years ago • 5 comments

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

0.8.1

Expected outcome

To generate stanzas

Actual outcome

Failed with non helpful error message.

Steps to reproduce

cf-terraforming generate --zone <zone_id> --resource-type cloudflare_record

CLOUDFLARE_API_TOKEN env var is set.

References

No response

JamesArthurHolland avatar Jul 24 '22 19:07 JamesArthurHolland

this works fine here; can you please include more information as to how you've hit this? running commands with the --debug flag will provide more useful information.

jacobbednarz avatar Jul 24 '22 20:07 jacobbednarz

$ cf-terraforming generate -t $CLOUDFLARE_API_TOKEN --resource-type cloudflare_record -a <account_id>  --zone <zone> --verbose

DEBU[0000] --account and --zone are mutually exclusive, support for both is deprecated 
DEBU[0000] initializing cloudflare-go with API Token     account_Id=<account_id> zone_id=<zone>
DEBU[0000] configuring Cloudflare API with account       account_id=<account_id> 
DEBU[0022] initializing Terraform in .                  
FATA[0023] configuration is invalid                 

JamesArthurHolland avatar Jul 25 '22 10:07 JamesArthurHolland

ok, this is different to your issue repro. have you tried without the account argument? you shouldn't be providing them both in the same invocation.

you'll also want to confirm you have a working and initialised Terraform directory to operate this binary from.

jacobbednarz avatar Jul 25 '22 10:07 jacobbednarz

I am facing the same issue.

juliosaraiva avatar Oct 05 '22 11:10 juliosaraiva

Note that cf-terraforming uses the actual Terraform provider you have installed in your config. So it needs to run from a valid Terraform setup locally.

Ensure that terraform validate passes in the same directory, and importantly, that the Cloudflare provider doesn't depend on any Terraform input variables or it will fail with this cryptic error- I had planned to pass the API key as an input var rather than using an env var and this tripped me up.

justisb avatar Oct 07 '22 18:10 justisb