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

confluent_environment unable to reflect current Stream governance package #591

Open
mihdih opened this issue Mar 12, 2025 · 4 comments
Open
Labels
question Further information is requested

Comments

@mihdih
Copy link

mihdih commented Mar 12, 2025

As introduced in around version 1.7 (I think) of terraform confluent provider, Stream governance is handled under the resource confluent_environment. We are in a situation where our Environments are provisioned using an older version of the provider (1.6.x). When we try to update it now to version 2.2.x, we thought that it would be able to pickup the configured Stream Governance package, given our terraform code is updated.

Current package is set to Essentials

# Old code
resource "confluent_environment" "env-foo" {
  display_name = "foo-environment"

  lifecycle {
    prevent_destroy = true
  }
}

Then updated to

# New code
resource "confluent_environment" "env-foo" {
  display_name = "foo-environment"

  stream_governance {
    package = "ESSENTIALS"
  }

  lifecycle {
    prevent_destroy = true
  }
}

Given that terraform refresh is ran, we thought and would have expected that when running terraform plan/apply no change is detected since code is reflecting the current state.

# confluent_environment.env-foo will be updated in-place
  ~ resource "confluent_environment" "env-foo" {
        id            = "env-xxxx"
        # (2 unchanged attributes hidden)
      ~ stream_governance {
          + package = "ESSENTIALS"
        }
    }

Even if removing the state manually and then re-import, the behaviour still persist. It's as if the API is not returning and reflecting the current state.

@linouk23 linouk23 added the question Further information is requested label Mar 12, 2025
@linouk23
Copy link
Contributor

linouk23 commented Mar 12, 2025

@mihdih thanks for creating this issue!

"We are going to update the backend to return ESSENTIALS for all environments that were created with an old version of the TF Provider (currently, the backend returns null/empty, as you can see). This will happen once the deprecated srcm/v2 API group will be fully removed in the next few months. For now, we'd recommend using

resource "confluent_environment" "example" {
  # ...

  lifecycle {
    ignore_changes = [
      stream_governance,
    ]
  }
}

or something.

Please let us know if that makes sense. Thank you!

@mihdih
Copy link
Author

mihdih commented Mar 12, 2025

Thank you for the prompt response @linouk23 !

Yup it does make sense. Okay we can ignore it for now. But let say we want to update one to ADVANCED will that work with out problem? and carry on with the update as if done in GUI without changing any other configuration like region.

@linouk23
Copy link
Contributor

My assumption is that if you set ADVANCED in your TF config, the update should go through, yes.

@mihdih
Copy link
Author

mihdih commented Mar 13, 2025

Awesome! Thanks @linouk23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants