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

Workbench Instance - Metadata forces recreate #18469

Open
kirksw opened this issue Jun 18, 2024 · 3 comments
Open

Workbench Instance - Metadata forces recreate #18469

kirksw opened this issue Jun 18, 2024 · 3 comments

Comments

@kirksw
Copy link

kirksw commented Jun 18, 2024

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 a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Terraform Version & Provider Version(s)

Terraform v1.8.5
on aarch64-apple-darwin

  • provider registry.terraform.io/hashicorp/google v5.33.0

Affected Resource(s)

google_workbench_instance

Terraform Configuration

resource "google_workbench_instance" "default" {
  name     = "workbench-test"
  location = "europe-west1-b"

  gce_setup {
    machine_type = "n1-standard-4"

    service_accounts {
      email = google_service_account.default.email
    }

    metadata = {
      idle-timeout-seconds = "3600"
    }
}

Debug Output

  • if resource stopped
~ resource "google_workbench_instance" "default" {
      ~ desired_state        = "STOPPED" -> "ACTIVE"
        id                   = "projects/<redacted>/locations/europe-west1-b/instances/<redacted>"
        name                 = "workbench-test"
        # (12 unchanged attributes hidden)

      ~ gce_setup {
          ~ metadata             = {
              - "proxy-byoid-url"            = "<redacted>-dot-europe-west1.notebooks.byoid.googleusercontent.com" -> null
  • if running already
  # module.poc_product_categorization[0].google_workbench_instance.default will be updated in-place
  ~ resource "google_workbench_instance" "default" {
        id                   = "projects/<redacted>/locations/europe-west1-b/instances/<redacted>"
        name                 = "<redacted>"
        # (13 unchanged attributes hidden)

      ~ gce_setup {
          ~ metadata             = {
              - "proxy-byoid-url"            = "<redacted>-dot-europe-west1.notebooks.byoid.googleusercontent.com" -> null
                # (16 unchanged elements hidden)

Expected Behavior

  • With no desired state defined if instance is active, instance should stay active, likewise if stopped should stay stopped
  • No update in-place should occur in relation to metadata.proxy-byoid-url

Actual Behavior

Starts all instances on every apply, updates metadata.proxy-byoid-url to null.

Steps to reproduce

  1. terraform apply

Important Factoids

No response

References

No response

b/348498822

@kirksw kirksw added the bug label Jun 18, 2024
@github-actions github-actions bot added forward/review In review; remove label to forward service/notebooks labels Jun 18, 2024
@ggtisc ggtisc self-assigned this Jun 20, 2024
@ggtisc
Copy link
Collaborator

ggtisc commented Jun 20, 2024

Confirmed issue!

After the resource was created when there aren't changes and ran a 2nd terraform apply it detects changes. This looks like a permadiff on proxy-byoid-url

@ggtisc ggtisc removed the forward/review In review; remove label to forward label Jun 20, 2024
@kirksw
Copy link
Author

kirksw commented Jun 25, 2024

Confirmed issue!

After the resource was created when there aren't changes and ran a 2nd terraform apply it detects changes. This looks like a permadiff on proxy-byoid-url

I would say there are two issues, what you have referenced - but also the default desired state behavior, which will start or stop all the instances (no possibility to just stay in the current state)

@bcreddy-gcp
Copy link

The issue should be fixed with GoogleCloudPlatform/magic-modules#10900

Verified by the following:
Created a google_workbench_instance using the following config.

resource "google_workbench_instance" "default" {
  project = "<redacted>"
  name = "workbench-test"
  location = "us-west1-a"

  gce_setup {
    machine_type = "n1-standard-4"
    metadata = {
      idle-timeout-seconds = "3600"
    }
  }

}

terraform plan on the same config any number of times gave No changes. Your infrastructure matches the configuration..

Added desired_state = "ACTIVE" to the config.
terraform plan on the same config any number of times gave No changes. Your infrastructure matches the configuration..

Updated desired_state = "STOPPED" in the config.

  ~ update in-place

Terraform will perform the following actions:

  # google_workbench_instance.default will be updated in-place
  ~ resource "google_workbench_instance" "default" {
      ~ desired_state        = "ACTIVE" -> "STOPPED"

terraform plan on the same config any number of times gave No changes. Your infrastructure matches the configuration..

Updated desired_state = "ACTIVE" in the config.

  ~ update in-place

Terraform will perform the following actions:

  # google_workbench_instance.default will be updated in-place
  ~ resource "google_workbench_instance" "default" {
      ~ desired_state        = "STOPPED" -> "ACTIVE"

terraform plan on the same config any number of times gave No changes. Your infrastructure matches the configuration..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants