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

redpanda_version interacts weirdly with Terraform data model #174

Open
ligfx opened this issue Oct 23, 2024 · 0 comments
Open

redpanda_version interacts weirdly with Terraform data model #174

ligfx opened this issue Oct 23, 2024 · 0 comments

Comments

@ligfx
Copy link
Contributor

ligfx commented Oct 23, 2024

Problem

Currently, resource_cluster.redpanda_version is configurable and passed to CreateCluster, but the actual remote state is ignored. generateModel simply uses the configured value and ignores the value returned by the server.

This happens because (1) The Cloud API only allows requesting a version like major.minor (???), but then returns version values like major.minor.patch and (2) Cluster versions can and will be updated outside of Terraform (there's no way to do it inside Terraform since the API doesn't support it, and updates are automatically managed by Redpanda anyways).

This is weird and doesn't fit with the Terraform model!

Solutions

Should we just make redpanda_version non-configurable, and always return the server version? This is simplest.

Or, if we keep redpanda_version configurable and want to reconcile with server state, one possible path could be:

  1. Require that the configured version value is major.minor.path
  2. Hit the /v1beta2/redpanda_versions endpoint to validate the configured version, then truncate the version and pass only major.minor to CreateCluster (or, fix the Cloud API to allow a major.minor.patch request)
  3. Strongly suggest that end-users use lifecycle { ignore_changes = [redpanda_version] } so that when the cluster is eventually updated, Terraform doesn't freak out
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