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

cf-terraforming generates incompatible code for terraform provider #492

Open
2 tasks done
fliphess opened this issue Nov 16, 2022 · 1 comment
Open
2 tasks done

Comments

@fliphess
Copy link

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.8.8

Expected outcome

Generated code is compatible with latest terraform provider: The private_dns option as generated by cf-terraforming is not allowed by the cloudflare-terraform-provider as the private_dns option is not supported.

Actual outcome

│ Error: expected type to be one of [app_launcher bookmark biso dash_sso saas self_hosted ssh vnc warp], got private_dns
│
│   with module.internal_apps.cloudflare_access_application.this,
│   on modules/internal_app/main.tf line 4, in resource "cloudflare_access_application" "this":
│    4:   type   = "private_dns"

Steps to reproduce

  1. Comment out required_version in terraform block (known bug in cf-terraforming)
  2. Generate applications using: cf-terraforming generate --resource-type cloudflare_access_application
  3. import access applications
  4. run terraform apply

References

See also: cloudflare/terraform-provider-cloudflare#2030

@jacobbednarz
Copy link
Member

this is an unfortunate side effect of having only stable options in the Terraform Provider. private_dns (as the linked issue mentions) is not yet stable enough for public API usage but because it is present in the API, we attempt to generate the resource for it.

for now, we can possibly ignore this when we make the API calls (see https://github.com/cloudflare/cf-terraforming/blob/master/internal/app/cf-terraforming/cmd/generate.go#L737-L747 for an example) where type = "private_dns". you're welcome to send a PR over if this is impacting you otherwise i'll add a ticket for someone to look at this in a backlog.

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

2 participants