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

VPC Connector change machine type triggers connector to be recreated #20814

Open
Abdelwaheb-Hnaien opened this issue Jan 6, 2025 · 1 comment

Comments

@Abdelwaheb-Hnaien
Copy link

Abdelwaheb-Hnaien commented Jan 6, 2025

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.

Description

Modifying the machine_type attribute of the google_vpc_access_connector resource currently results in the destroying and re-creation of the VPC access connector. However, the API now supports patching the machine type directly, allowing the connector to be updated without requiring its re-creation.

Actual behaviour (via Terraform v1.10.3 and google provider version 6.14.1):

  # google_vpc_access_connector.test_connector must be replaced
-/+ resource "google_vpc_access_connector" "test_connector" {
      ~ connected_projects = [] -> (known after apply)
      ~ id                 = "projects/<project-id>/locations/europe-west1/connectors/test-ahn" -> (known after apply)
      ~ machine_type       = "e2-micro" -> "e2-standard-4" # forces replacement
      ~ max_throughput     = 500 -> (known after apply)
      ~ min_throughput     = 200 -> (known after apply)
        name               = "test-ahn"
      ~ self_link          = "projects/<project-id>/locations/europe-west1/connectors/test-ahn" -> (known after apply)
      ~ state              = "READY" -> (known after apply)
        # (6 unchanged attributes hidden)
    }

Expected behaviour:
Changing the machine type should update the connector via the projects.locations.connectors.patch method:

{
  "name": "projects/<project-id>/locations/europe-west1/operations/aef118dd-775e-41e8-8307-7802531803d1",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.vpcaccess.v1beta1.OperationMetadataV1Beta1",
    "method": "google.cloud.vpcaccess.v1beta1.VpcAccessService.UpdateConnector",
    "createTime": "2025-01-06T15:01:04.720073Z",
    "target": "projects/<project-id>/locations/europe-west1/connectors/test-ahn"
  }
}

New or Affected Resource(s)

  • google_vpc_access_connector

Potential Terraform Configuration

resource "google_vpc_access_connector" "test_connector" {
  provider      = "google-beta"
  name          = "test-ahn"
  project       = var.project_id
  region        = "europe-west1"
  ip_cidr_range = "10.11.0.0/28"
  network       = var.vpc
  machine_type  = "e2-standard-4"
  min_instances = 2
  max_instances = 5
}

References

No response

b/388037051

@github-actions github-actions bot added forward/review In review; remove label to forward service/vpcaccess labels Jan 6, 2025
@rileykarson rileykarson added size/s and removed forward/review In review; remove label to forward labels Jan 6, 2025
@rileykarson rileykarson added this to the Goals milestone Jan 6, 2025
@ramonvermeulen
Copy link

ramonvermeulen commented Jan 22, 2025

I would like to try picking this up as a first issue, also to get more familiar with the magic modules.

EDIT:
Opened (my first) PR to resolve this issue: GoogleCloudPlatform/magic-modules#12830

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