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

refactor(internal): swap to resource and endpoint mapping #776

Merged
merged 12 commits into from
Jan 17, 2025

Conversation

jacobbednarz
Copy link
Member

@jacobbednarz jacobbednarz commented Jan 14, 2025

Previously, we relied on manually mapping the supported resources. This was for a number of reasons:

  1. Not all resources supported a List operation.
  2. Resources were not 1:1 to the API endpoint in Terraform.
  3. Resources did not have full attribute coverage and not having a way to flag incomplete resources could result in outages if they were applied.

With the release of the Cloudflare Terraform Provider v5 and the SDKs, we're now in a position to make the internals more dynamic as they are all powered by the OpenAPI schemas and eliminates the previously encountered constraints.

Under the covers, we have swapped to a mapping file that is generated by an out of band process while the HTTP client and data handling is now using the v4 Go library.

To do

  • Work out what to do with Cloudflare Terraform Provider v4. We don't have the same sources of truth that can automatically fetch the List operations. Maybe a one off manual mapping and call a freeze on v4?
  • Identify anything that currently works with manual mappings and incorporate those into this version.
  • Update the import strings mapping to have a source of truth as well. TBD

Previously, we relied on manually mapping the supported resources. This
was for a number of reasons:

1. Not all resources supported a `List` operation.
2. Resources were not 1:1 to the API endpoint in Terraform.
3. Resources did not have full attribute coverage and not having a way
   to flag incomplete resources could result in outages if they were
   applied.

With the release of the Cloudflare Terraform Provider v5 and the SDKs,
we're now in a position to make the internals more dynamic as they are
all powered by the OpenAPI schemas and eliminates the previously
encountered constraints.

Under the covers, we have swapped to a mapping file that is generated by
an out of band process while the HTTP client and data handling is now
using the v4 Go library.
@jacobbednarz jacobbednarz marked this pull request as ready for review January 17, 2025 04:43
@jacobbednarz jacobbednarz merged commit 09c61dc into master Jan 17, 2025
7 checks passed
@jacobbednarz jacobbednarz deleted the more-dynamicness branch January 17, 2025 04:43
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

Successfully merging this pull request may close these issues.

1 participant