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

Removing schema_settings from google_pubsub_topic does not trigger update #15925

Closed
GustenT opened this issue Sep 21, 2023 · 4 comments
Closed

Comments

@GustenT
Copy link

GustenT commented Sep 21, 2023

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v1.4.6
on darwin_arm64
+ provider registry.terraform.io/hashicorp/google v4.83.0

Affected Resource(s)

  • google_pubsub_topic

Terraform Configuration Files

Before

resource "google_pubsub_topic" "topic" {
  project      = google_project.project.project_id
  name         = "topic"

  schema_settings {
    schema   = google_pubsub_schema.schema.id
    encoding = "JSON"
  }

  depends_on = [google_pubsub_schema.schema]
}

resource "google_pubsub_schema" "schema" {
  project    = google_project.project.project_id
  name       = "schema"
  type       = "PROTOCOL_BUFFER"
  definition = "syntax = \"proto3\";\nmessage Results {\nstring message_request = 1;\nstring message_response = 2;\nstring timestamp_request = 3;\nstring timestamp_response = 4;\n}"
}

After

resource "google_pubsub_topic" "topic" {
  project      = google_project.project.project_id
  name         = "topic"

  depends_on = [google_pubsub_schema.schema]
}

resource "google_pubsub_schema" "schema" {
  project    = google_project.project.project_id
  name       = "schema"
  type       = "PROTOCOL_BUFFER"
  definition = "syntax = \"proto3\";\nmessage Results {\nstring message_request = 1;\nstring message_response = 2;\nstring timestamp_request = 3;\nstring timestamp_response = 4;\n}"
}

Expected Behavior

The expected behaviour is that terraform would pick up on the removal of schema_settings and update the topic and remove the schema association from the topic.

Actual Behavior

No changes detected.

Steps to Reproduce

  1. Create a google_pubsub_schema and a google_pubsub_topic with a schema_setting (terraform apply)
  2. Remove schema_setting from google_pubsub_topic resource (terraform apply)

b/301582871

@kamalaboulhosn
Copy link

The fix for this would be considered a breaking change. Therefore, it has to wait for next year's 6.0 release.

@GustenT
Copy link
Author

GustenT commented Oct 18, 2023

That's unfortunate. The bug can be quite damaging if trying to remove a schema and it's setting, resulting in deleting the schema resource and breaking publishing to the topic entirely

@kamalaboulhosn
Copy link

The fix has been submitted as part of the next major release, which is planned for August 2024.

@c2thorn c2thorn closed this as completed Jul 22, 2024
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants