Skip to content

Add Update Connector Support for VPC Access Connectors#8205

Merged
SarahFrench merged 4 commits into
GoogleCloudPlatform:mainfrom
jashansudan:vpcaccess-beta-update
Jul 14, 2023
Merged

Add Update Connector Support for VPC Access Connectors#8205
SarahFrench merged 4 commits into
GoogleCloudPlatform:mainfrom
jashansudan:vpcaccess-beta-update

Conversation

@jashansudan

@jashansudan jashansudan commented Jun 24, 2023

Copy link
Copy Markdown
Contributor

Adds support for updating Serverless VPC Connectors.

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).
  • 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).
  • Generated Terraform providers, and ran make test and make lint in the generated providers to ensure it passes unit and linter tests.
  • Ran relevant acceptance tests using my own Google Cloud project and credentials (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read Write release notes before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

vpcaccess: added support for updates to `google_vpc_access_connector` resource

@modular-magician

Copy link
Copy Markdown
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I've detected that you're a community contributor. @SarahFrench, a repository maintainer, has been assigned to assist you and help review your changes.

❓ First time contributing? Click here for more details

Your assigned reviewer will help review your code by:

  • Ensuring it's backwards compatible, covers common error cases, etc.
  • Summarizing the change into a user-facing changelog note.
  • Passes tests, either our "VCR" suite, a set of presubmit tests, or with manual test runs.

You can help make sure that review is quick by running local tests and ensuring they're passing in between each push you make to your PR's branch. Also, try to leave a comment with each push you make, as pushes generally don't generate emails.

If your reviewer doesn't get back to you within a week after your most recent change, please feel free to leave a comment on the issue asking them to take a look! In the absence of a dedicated review dashboard most maintainers manage their pending reviews through email, and those will sometimes get lost in their inbox.


@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field max_throughput default value changed from 300 to on google_vpc_access_connector - reference
  • Field min_throughput default value changed from 200 to on google_vpc_access_connector - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 5 files changed, 188 insertions(+), 9 deletions(-))
Terraform Beta: Diff ( 5 files changed, 188 insertions(+), 9 deletions(-))
TF Conversion: Diff ( 4 files changed, 15 insertions(+), 7 deletions(-))
TF OiCS: Diff ( 2 files changed, 4 insertions(+))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2817
Passed tests 2503
Skipped tests: 301
Affected tests: 13

Action taken

Found 13 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccVPCAccessConnector_vpcAccessConnectorMachineAndInstancesChanged|TestAccVPCAccessConnector_vpcAccessConnectorThroughput|TestAccVPCAccessConnector_vpcAccessConnectorSharedVpcExample|TestAccVPCAccessConnector_vpcAccessConnectorExample|TestAccComputeFirewallPolicyRule_multipleRules|TestAccComputeNetworkEndpoints_networkEndpointsBasic|TestAccVPCAccessConnectorDatasource_basic|TestAccCloudFunctionsFunction_vpcConnector|TestAccCloudRunV2Service_cloudrunv2ServiceFullUpdate|TestAccCloudRunV2Service_cloudrunv2ServiceVpcaccessExample|TestAccCloudRunV2Job_cloudrunv2JobFullUpdate|TestAccCloudRunV2Job_cloudrunv2JobVpcaccessExample|TestAccAppEngineStandardAppVersion_update

Get to know how VCR tests work

@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field max_throughput default value changed from 300 to on google_vpc_access_connector - reference
  • Field min_throughput default value changed from 200 to on google_vpc_access_connector - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 5 files changed, 188 insertions(+), 9 deletions(-))
Terraform Beta: Diff ( 5 files changed, 188 insertions(+), 9 deletions(-))
TF Conversion: Diff ( 4 files changed, 15 insertions(+), 7 deletions(-))
TF OiCS: Diff ( 2 files changed, 4 insertions(+))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2817
Passed tests 2503
Skipped tests: 301
Affected tests: 13

Action taken

Found 13 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccVPCAccessConnectorDatasource_basic|TestAccComputeNetworkEndpoints_networkEndpointsBasic|TestAccCloudFunctionsFunction_vpcConnector|TestAccCloudRunV2Job_cloudrunv2JobVpcaccessExample|TestAccCloudRunV2Service_cloudrunv2ServiceFullUpdate|TestAccCloudRunV2Service_cloudrunv2ServiceVpcaccessExample|TestAccCloudRunV2Job_cloudrunv2JobFullUpdate|TestAccComputeFirewallPolicyRule_multipleRules|TestAccAppEngineStandardAppVersion_update|TestAccVPCAccessConnector_vpcAccessConnectorThroughput|TestAccVPCAccessConnector_vpcAccessConnectorMachineAndInstancesChanged|TestAccVPCAccessConnector_vpcAccessConnectorExample|TestAccVPCAccessConnector_vpcAccessConnectorSharedVpcExample

Get to know how VCR tests work

@jashansudan

jashansudan commented Jun 30, 2023

Copy link
Copy Markdown
Contributor Author

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field max_throughput default value changed from 300 to on google_vpc_access_connector - reference
  • Field min_throughput default value changed from 200 to on google_vpc_access_connector - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 5 files changed, 188 insertions(+), 9 deletions(-)) Terraform Beta: Diff ( 5 files changed, 188 insertions(+), 9 deletions(-)) TF Conversion: Diff ( 4 files changed, 15 insertions(+), 7 deletions(-)) TF OiCS: Diff ( 2 files changed, 4 insertions(+))

I discussed with the Google terraform provider team and I believe this change should not be breaking.

@SarahFrench SarahFrench self-assigned this Jul 5, 2023

@SarahFrench SarahFrench left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @jashansudan, thanks for your patience when waiting for my review 🙏 .

I can see via the acceptance test that the three mutable fields can be updated successfully. And thank you for checking about the suspected breaking changes in relation to default values.

Also, I confirmed that updates where the values of min_instances and max_instances are reduced results in a forced replacement of the resource. The testing framework doesn't expose an easy way to assert whether an update or force-replace action occurs, and workarounds usually need access to a "create_time" field (which this resource lacks). Because of this, I'm happy to merge this PR without a test that checks the behaviour introduced via resource_definition.

@SarahFrench

Copy link
Copy Markdown
Contributor

I'm going to re-run the acceptance tests in our CI, as I can see it timed out previously. The new test added in this PR passed when I ran it locally, so I don't expect any issues, but it would be good to have the test pass here before merging.

/gcbrun

@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field max_throughput default value changed from 300 to on google_vpc_access_connector - reference
  • Field min_throughput default value changed from 200 to on google_vpc_access_connector - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 5 files changed, 188 insertions(+), 9 deletions(-))
Terraform Beta: Diff ( 5 files changed, 188 insertions(+), 9 deletions(-))
TF Conversion: Diff ( 4 files changed, 15 insertions(+), 7 deletions(-))
TF OiCS: Diff ( 2 files changed, 4 insertions(+))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2848
Passed tests 2539
Skipped tests: 295
Affected tests: 14

Action taken

Found 14 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccVPCAccessConnector_vpcAccessConnectorMachineAndInstancesChanged|TestAccVPCAccessConnector_vpcAccessConnectorThroughput|TestAccVPCAccessConnector_vpcAccessConnectorExample|TestAccVPCAccessConnector_vpcAccessConnectorSharedVpcExample|TestAccVPCAccessConnectorDatasource_basic|TestAccProjectIamPolicy_invalidMembers|TestAccContainerAwsNodePool_BetaBasicHandWritten|TestAccCloudRunV2Job_cloudrunv2JobVpcaccessExample|TestAccCloudFunctionsFunction_vpcConnector|TestAccCloudRunV2Service_cloudrunv2ServiceFullUpdate|TestAccCloudRunV2Service_cloudrunv2ServiceVpcaccessExample|TestAccCloudRunV2Job_cloudrunv2JobFullUpdate|TestAccAppEngineStandardAppVersion_update|TestAccComputeFirewallPolicyRule_multipleRules

Get to know how VCR tests work

@modular-magician

Copy link
Copy Markdown
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccVPCAccessConnector_vpcAccessConnectorMachineAndInstancesChanged[Debug log]
TestAccVPCAccessConnector_vpcAccessConnectorThroughput[Debug log]
TestAccVPCAccessConnector_vpcAccessConnectorSharedVpcExample[Debug log]
TestAccVPCAccessConnectorDatasource_basic[Debug log]
TestAccProjectIamPolicy_invalidMembers[Debug log]
TestAccCloudRunV2Job_cloudrunv2JobVpcaccessExample[Debug log]
TestAccCloudRunV2Service_cloudrunv2ServiceFullUpdate[Debug log]
TestAccCloudRunV2Service_cloudrunv2ServiceVpcaccessExample[Debug log]
TestAccCloudRunV2Job_cloudrunv2JobFullUpdate[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccVPCAccessConnector_vpcAccessConnectorExample[Error message] [Debug log]
TestAccContainerAwsNodePool_BetaBasicHandWritten[Error message] [Debug log]
TestAccCloudFunctionsFunction_vpcConnector[Error message] [Debug log]
TestAccAppEngineStandardAppVersion_update[Error message] [Debug log]
TestAccComputeFirewallPolicyRule_multipleRules[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@SarahFrench SarahFrench left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's a good thing I re-ran the tests, as a couple of failing tests are linked to this PR. Are you able to access the error message and debug logs linked in this message?

The tests that appear linked to this PR's changes are:

  • TestAccVPCAccessConnector_vpcAccessConnectorExample
    • Error = "Operation failed: Invalid IP CIDR range was provided. It conflicts with an existing subnetwork. Please delete the connector manually."
    • I'm not sure if it's something we can fix in this PR directly
  • TestAccCloudFunctionsFunction_vpcConnector
    • Error = "A Connector must specify either max_throughput or max_instances."
    • edits to this file should address that failure
  • TestAccAppEngineStandardAppVersion_update
    • Error = "A Connector must specify either max_throughput or max_instances."
    • edit to this file will address this

@jashansudan

Copy link
Copy Markdown
Contributor Author

I've went ahead and hopefully fixed all the tests.

@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field max_throughput default value changed from 300 to on google_vpc_access_connector - reference
  • Field min_throughput default value changed from 200 to on google_vpc_access_connector - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 8 files changed, 194 insertions(+), 14 deletions(-))
Terraform Beta: Diff ( 7 files changed, 194 insertions(+), 11 deletions(-))
TF Conversion: Diff ( 4 files changed, 15 insertions(+), 7 deletions(-))
TF OiCS: Diff ( 2 files changed, 5 insertions(+), 1 deletion(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2853
Passed tests 2546
Skipped tests: 296
Affected tests: 11

Action taken

Found 11 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccContainerAwsNodePool_BetaBasicHandWritten|TestAccClouddeployTarget_Target|TestAccVPCAccessConnector_vpcAccessConnectorExample|TestAccComputeFirewallPolicyRule_multipleRules|TestAccClouddeployDeliveryPipeline_VerifyDeliveryPipeline|TestAccClouddeployDeliveryPipeline_DeliveryPipeline|TestAccClouddeployDeliveryPipeline_CanaryrunDeliveryPipeline|TestAccClouddeployDeliveryPipeline_CanaryServiceNetworkingDeliveryPipeline|TestAccClouddeployDeliveryPipeline_CanaryDeliveryPipeline|TestAccCloudFunctionsFunction_vpcConnector|TestAccAppEngineStandardAppVersion_update

Get to know how VCR tests work

@modular-magician

Copy link
Copy Markdown
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccClouddeployTarget_Target[Debug log]
TestAccVPCAccessConnector_vpcAccessConnectorExample[Debug log]
TestAccClouddeployDeliveryPipeline_VerifyDeliveryPipeline[Debug log]
TestAccClouddeployDeliveryPipeline_DeliveryPipeline[Debug log]
TestAccClouddeployDeliveryPipeline_CanaryrunDeliveryPipeline[Debug log]
TestAccClouddeployDeliveryPipeline_CanaryServiceNetworkingDeliveryPipeline[Debug log]
TestAccClouddeployDeliveryPipeline_CanaryDeliveryPipeline[Debug log]
TestAccCloudFunctionsFunction_vpcConnector[Debug log]
TestAccAppEngineStandardAppVersion_update[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccContainerAwsNodePool_BetaBasicHandWritten[Error message] [Debug log]
TestAccComputeFirewallPolicyRule_multipleRules[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@SarahFrench

Copy link
Copy Markdown
Contributor

Looks like the tests are all fixed, thanks! The two tests that failed above are unrelated to this PR.

I'm seeing an unexpected diff in the diff report - affecting the .teamcity/components/generated/services.kt file in the GA provider repo. That file is generated based on the service package directories present in the provider, and there were some new service packages created since this PR was started. Usually we'd ask for PRs to be rebased but in this case I believe that the unexpected diff won't actually happen after merging this PR. I want to test my understanding, so will approve and merge.

Thanks for your patience!

@SarahFrench

Copy link
Copy Markdown
Contributor

Ah, main branch is currently protected to help preparation of a patch release. I'll merge once it's possible.

ericayyliu pushed a commit to ericayyliu/magic-modules that referenced this pull request Jul 26, 2023
…atform#8205)

* Add Update Connetor Support for VPC Access Connectors

* fix lint

* fix go lint

* fix tests
hao-nan-li added a commit to hao-nan-li/magic-modules that referenced this pull request Jul 26, 2023
hao-nan-li added a commit that referenced this pull request Jul 27, 2023
NickElliot pushed a commit to NickElliot/magic-modules that referenced this pull request Jul 31, 2023
wj-chen pushed a commit to wj-chen/magic-modules that referenced this pull request Aug 1, 2023
…atform#8205)

* Add Update Connetor Support for VPC Access Connectors

* fix lint

* fix go lint

* fix tests
DanielRieske pushed a commit to bschaatsbergen/magic-modules that referenced this pull request Aug 2, 2023
…atform#8205)

* Add Update Connetor Support for VPC Access Connectors

* fix lint

* fix go lint

* fix tests
DanielRieske pushed a commit to bschaatsbergen/magic-modules that referenced this pull request Aug 2, 2023
hao-nan-li pushed a commit to hao-nan-li/magic-modules that referenced this pull request Aug 9, 2023
…atform#8205)

* Add Update Connetor Support for VPC Access Connectors

* fix lint

* fix go lint

* fix tests
hao-nan-li added a commit to hao-nan-li/magic-modules that referenced this pull request Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants