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

change update verb for apigee_envgroup to patch #5047

Conversation

ScottSuarez
Copy link
Contributor

closes hashicorp/terraform-provider-google#9696

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

apigee: fixed update behavior on `google_apigee_envgroup`

@google-cla google-cla bot added the cla: yes label Aug 5, 2021
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 12 insertions(+), 7 deletions(-))
Terraform Beta: Diff ( 2 files changed, 13 insertions(+), 8 deletions(-))

@ScottSuarez ScottSuarez requested review from a team and melinath and removed request for a team August 5, 2021 22:20
@ScottSuarez
Copy link
Contributor Author

/gcbrun

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 12 insertions(+), 7 deletions(-))
Terraform Beta: Diff ( 2 files changed, 13 insertions(+), 8 deletions(-))

@ScottSuarez
Copy link
Contributor Author

/gcbrun

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 12 insertions(+), 7 deletions(-))
Terraform Beta: Diff ( 2 files changed, 13 insertions(+), 8 deletions(-))

Copy link
Member

@melinath melinath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM potentially - Is there a way to add a reasonable test for this? I know apigee resources can take a while to set up but maybe the basic test could be expanded to also do an update?

@ScottSuarez
Copy link
Contributor Author

ScottSuarez commented Aug 6, 2021

I totally agree and in normal circumstances I would be inclined to add them but with the volume of bugs and the ease of the fix in this method I am choosing to exclude in the essence of time. There are other things that call to my attention at the moment that make the timebox needed to add the test infra not worth it considering the needed functions are not already in place. I've tested locally and provided a debug log below. I hope thats sufficient.

scottsuarez-macbookpro:08-05-21 scottsuarez$ terraform apply 

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # google_apigee_envgroup.apigee_environment_group will be created
  + resource "google_apigee_envgroup" "apigee_environment_group" {
      + hostnames = [
          + "abc.foo.com",
          + "abc2.foo.com",
        ]
      + id        = (known after apply)
      + name      = "tf-test-21"
      + org_id    = (known after apply)
    }

  # google_apigee_environment.apigee_environment will be created
  + resource "google_apigee_environment" "apigee_environment" {
      + description  = "Apigee Environment"
      + display_name = "environment-1"
      + id           = (known after apply)
      + name         = "tf-test-212"
      + org_id       = (known after apply)
    }

  # google_apigee_organization.apigee_org will be created
  + resource "google_apigee_organization" "apigee_org" {
      + analytics_region   = "us-central1"
      + authorized_network = (known after apply)
      + ca_certificate     = (known after apply)
      + id                 = (known after apply)
      + name               = (known after apply)
      + project_id         = "tf-test-2123"
      + runtime_type       = "CLOUD"
      + subscription_type  = (known after apply)
    }

  # google_compute_global_address.apigee_range will be created
  + resource "google_compute_global_address" "apigee_range" {
      + address            = (known after apply)
      + address_type       = "INTERNAL"
      + creation_timestamp = (known after apply)
      + id                 = (known after apply)
      + label_fingerprint  = (known after apply)
      + name               = "apigee-range"
      + network            = (known after apply)
      + prefix_length      = 16
      + project            = "tf-test-2123"
      + purpose            = "VPC_PEERING"
      + self_link          = (known after apply)
    }

  # google_compute_network.apigee_network will be created
  + resource "google_compute_network" "apigee_network" {
      + auto_create_subnetworks         = true
      + delete_default_routes_on_create = false
      + gateway_ipv4                    = (known after apply)
      + id                              = (known after apply)
      + mtu                             = (known after apply)
      + name                            = "apigee-network"
      + project                         = "tf-test-2123"
      + routing_mode                    = (known after apply)
      + self_link                       = (known after apply)
    }

  # google_project.project will be created
  + resource "google_project" "project" {
      + auto_create_network = true
      + billing_account     = "xxxx"
      + folder_id           = (known after apply)
      + id                  = (known after apply)
      + name                = "tf-test-21213"
      + number              = (known after apply)
      + org_id              = "xxxx"
      + project_id          = "tf-test-2123"
      + skip_delete         = (known after apply)
    }

  # google_project_service.apigee will be created
  + resource "google_project_service" "apigee" {
      + disable_on_destroy = true
      + id                 = (known after apply)
      + project            = "tf-test-2123"
      + service            = "apigee.googleapis.com"
    }

  # google_project_service.compute will be created
  + resource "google_project_service" "compute" {
      + disable_on_destroy = true
      + id                 = (known after apply)
      + project            = "tf-test-2123"
      + service            = "compute.googleapis.com"
    }

  # google_project_service.servicenetworking will be created
  + resource "google_project_service" "servicenetworking" {
      + disable_on_destroy = true
      + id                 = (known after apply)
      + project            = "tf-test-2123"
      + service            = "servicenetworking.googleapis.com"
    }

  # google_service_networking_connection.apigee_vpc_connection will be created
  + resource "google_service_networking_connection" "apigee_vpc_connection" {
      + id                      = (known after apply)
      + network                 = (known after apply)
      + peering                 = (known after apply)
      + reserved_peering_ranges = [
          + "apigee-range",
        ]
      + service                 = "servicenetworking.googleapis.com"
    }

Plan: 10 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

google_project.project: Creating...
google_project.project: Still creating... [10s elapsed]
google_project.project: Still creating... [20s elapsed]
google_project.project: Creation complete after 24s [id=projects/tf-test-2123]
google_project_service.servicenetworking: Creating...
google_project_service.apigee: Creating...
google_project_service.compute: Creating...
google_project_service.compute: Still creating... [10s elapsed]
google_project_service.apigee: Still creating... [10s elapsed]
google_project_service.servicenetworking: Still creating... [10s elapsed]
google_project_service.apigee: Still creating... [20s elapsed]
google_project_service.compute: Still creating... [20s elapsed]
google_project_service.servicenetworking: Still creating... [20s elapsed]
google_project_service.compute: Still creating... [30s elapsed]
google_project_service.servicenetworking: Still creating... [30s elapsed]
google_project_service.apigee: Still creating... [30s elapsed]
google_project_service.compute: Still creating... [40s elapsed]
google_project_service.apigee: Still creating... [40s elapsed]
google_project_service.servicenetworking: Still creating... [40s elapsed]
google_project_service.apigee: Still creating... [50s elapsed]
google_project_service.servicenetworking: Still creating... [50s elapsed]
google_project_service.compute: Still creating... [50s elapsed]
google_project_service.servicenetworking: Still creating... [1m0s elapsed]
google_project_service.apigee: Still creating... [1m0s elapsed]
google_project_service.compute: Still creating... [1m0s elapsed]
google_project_service.servicenetworking: Still creating... [1m10s elapsed]
google_project_service.compute: Still creating... [1m10s elapsed]
google_project_service.apigee: Still creating... [1m10s elapsed]
google_project_service.servicenetworking: Still creating... [1m20s elapsed]
google_project_service.compute: Still creating... [1m20s elapsed]
google_project_service.apigee: Still creating... [1m20s elapsed]
google_project_service.compute: Still creating... [1m30s elapsed]
google_project_service.servicenetworking: Still creating... [1m30s elapsed]
google_project_service.apigee: Still creating... [1m30s elapsed]
google_project_service.apigee: Creation complete after 1m32s [id=tf-test-2123/apigee.googleapis.com]
google_project_service.compute: Creation complete after 1m33s [id=tf-test-2123/compute.googleapis.com]
google_project_service.servicenetworking: Creation complete after 1m33s [id=tf-test-2123/servicenetworking.googleapis.com]
google_compute_network.apigee_network: Creating...
google_compute_network.apigee_network: Still creating... [10s elapsed]
google_compute_network.apigee_network: Still creating... [20s elapsed]
google_compute_network.apigee_network: Still creating... [30s elapsed]
google_compute_network.apigee_network: Still creating... [40s elapsed]
google_compute_network.apigee_network: Creation complete after 42s [id=projects/tf-test-2123/global/networks/apigee-network]
google_compute_global_address.apigee_range: Creating...
google_compute_global_address.apigee_range: Still creating... [10s elapsed]
google_compute_global_address.apigee_range: Creation complete after 11s [id=projects/tf-test-2123/global/addresses/apigee-range]
google_service_networking_connection.apigee_vpc_connection: Creating...
google_service_networking_connection.apigee_vpc_connection: Still creating... [10s elapsed]
google_service_networking_connection.apigee_vpc_connection: Still creating... [20s elapsed]
google_service_networking_connection.apigee_vpc_connection: Still creating... [30s elapsed]
google_service_networking_connection.apigee_vpc_connection: Still creating... [40s elapsed]
google_service_networking_connection.apigee_vpc_connection: Still creating... [50s elapsed]
google_service_networking_connection.apigee_vpc_connection: Still creating... [1m0s elapsed]
google_service_networking_connection.apigee_vpc_connection: Still creating... [1m10s elapsed]
google_service_networking_connection.apigee_vpc_connection: Creation complete after 1m12s [id=projects%2Ftf-test-2123%2Fglobal%2Fnetworks%2Fapigee-network:servicenetworking.googleapis.com]
google_apigee_organization.apigee_org: Creating...
google_apigee_organization.apigee_org: Still creating... [10s elapsed]
google_apigee_organization.apigee_org: Still creating... [20s elapsed]
google_apigee_organization.apigee_org: Still creating... [30s elapsed]
google_apigee_organization.apigee_org: Still creating... [40s elapsed]
google_apigee_organization.apigee_org: Creation complete after 42s [id=organizations/tf-test-2123]
google_apigee_envgroup.apigee_environment_group: Creating...
google_apigee_environment.apigee_environment: Creating...
google_apigee_envgroup.apigee_environment_group: Creation complete after 1s [id=organizations/tf-test-2123/envgroups/tf-test-21]
google_apigee_environment.apigee_environment: Still creating... [10s elapsed]
google_apigee_environment.apigee_environment: Creation complete after 11s [id=organizations/tf-test-2123/environments/tf-test-212]

Apply complete! Resources: 10 added, 0 changed, 0 destroyed.
scottsuarez-macbookpro:08-05-21 scottsuarez$ terraform apply
google_project.project: Refreshing state... [id=projects/tf-test-2123]
google_project_service.compute: Refreshing state... [id=tf-test-2123/compute.googleapis.com]
google_project_service.apigee: Refreshing state... [id=tf-test-2123/apigee.googleapis.com]
google_project_service.servicenetworking: Refreshing state... [id=tf-test-2123/servicenetworking.googleapis.com]
google_compute_network.apigee_network: Refreshing state... [id=projects/tf-test-2123/global/networks/apigee-network]
google_compute_global_address.apigee_range: Refreshing state... [id=projects/tf-test-2123/global/addresses/apigee-range]
google_service_networking_connection.apigee_vpc_connection: Refreshing state... [id=projects%2Ftf-test-2123%2Fglobal%2Fnetworks%2Fapigee-network:servicenetworking.googleapis.com]
google_apigee_organization.apigee_org: Refreshing state... [id=organizations/tf-test-2123]
google_apigee_envgroup.apigee_environment_group: Refreshing state... [id=organizations/tf-test-2123/envgroups/tf-test-21]
google_apigee_environment.apigee_environment: Refreshing state... [id=organizations/tf-test-2123/environments/tf-test-212]

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # google_apigee_envgroup.apigee_environment_group will be updated in-place
  ~ resource "google_apigee_envgroup" "apigee_environment_group" {
      ~ hostnames = [
            "abc.foo.com",
            "abc2.foo.com",
          + "abc3.foo.com",
        ]
        id        = "organizations/tf-test-2123/envgroups/tf-test-21"
        name      = "tf-test-21"
        org_id    = "organizations/tf-test-2123"
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

google_apigee_envgroup.apigee_environment_group: Modifying... [id=organizations/tf-test-2123/envgroups/tf-test-21]
google_apigee_envgroup.apigee_environment_group: Modifications complete after 1s [id=organizations/tf-test-2123/envgroups/tf-test-21]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
scottsuarez-macbookpro:08-05-21 scottsuarez$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

google_project.project: Refreshing state... [id=projects/tf-test-2123]
google_project_service.apigee: Refreshing state... [id=tf-test-2123/apigee.googleapis.com]
google_project_service.compute: Refreshing state... [id=tf-test-2123/compute.googleapis.com]
google_project_service.servicenetworking: Refreshing state... [id=tf-test-2123/servicenetworking.googleapis.com]
google_compute_network.apigee_network: Refreshing state... [id=projects/tf-test-2123/global/networks/apigee-network]
google_compute_global_address.apigee_range: Refreshing state... [id=projects/tf-test-2123/global/addresses/apigee-range]
google_service_networking_connection.apigee_vpc_connection: Refreshing state... [id=projects%2Ftf-test-2123%2Fglobal%2Fnetworks%2Fapigee-network:servicenetworking.googleapis.com]
google_apigee_organization.apigee_org: Refreshing state... [id=organizations/tf-test-2123]
google_apigee_envgroup.apigee_environment_group: Refreshing state... [id=organizations/tf-test-2123/envgroups/tf-test-21]
google_apigee_environment.apigee_environment: Refreshing state... [id=organizations/tf-test-2123/environments/tf-test-212]

------------------------------------------------------------------------

No changes. Infrastructure is up-to-date.

This means that Terraform did not detect any differences between your
configuration and real physical resources that exist. As a result, no
actions need to be performed.
scottsuarez-macbookpro:08-05-21 scottsuarez$ 

@melinath
Copy link
Member

melinath commented Aug 6, 2021

I leave it to your discretion. I'm glad to hear you can verify the fix locally.

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataLossPreventionDeidentifyTemplate_dlpDeidentifyTemplateBasicExample|TestAccDialogflowCXEnvironment_dialogflowcxEnvironmentFullExample|TestAccDialogflowCXVersion_dialogflowcxVersionFullExample|TestAccDialogflowCXEnvironment_update|TestAccDialogflowCXVersion_update You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=199977

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

Successfully merging this pull request may close these issues.

Apigee envgroup update not working
3 participants