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

Make cluster a required parameter for sources, sinks, matviews, and indexes #444

Open
bobbyiliev opened this issue Jan 22, 2024 · 1 comment

Comments

@bobbyiliev
Copy link
Contributor

Currently, the cluster parameter is not required and will use to the default cluster.

@benesch
Copy link
Member

benesch commented Jan 22, 2024

Moving a comment from Slack to here for discussion:

This will play nicely once ALTER SET CLUSTER for materialized views is in public preview, and I’ll have to think of a way to handle this for the rest of the objects.

ALTER SET CLUSTER, even for materialized views, had to be abandoned due to unforeseen complications. So we're not going to have ALTER SET CLUSTER support anytime soon.

It seems like that's okay, though? Can't we just set ForceNew on the cluster parameter?

I guess there's likely a question of how to do the migration. But it seems like it might be possible to do this with a state migration? Spitballing:

  • Create a release of the Terraform provider that ensures that a cluster output parameter is always set with the cluster of the object, regardless of whether the user has provided the input parameter.
  • Create a release of the Terraform provider that makes the cluster input parameter mandatory. Add a state migration to this release that fills in the input parameter based on the value of the output parameter. (Is this possible? Not sure).
  • Instruct users to upgrade through the releases in sequence, and when they upgrade to the last version, to fill in cluster input parameters wherever they are missing. Thanks to the schema migration, this won't cause the resources to be replaced.

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