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

Fix Datastream private connection resource destruction #11394

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

sagiyosefia
Copy link
Contributor

@sagiyosefia sagiyosefia commented Aug 8, 2024

Fix Datastream private connection resource destruction. The current private connection resource deletion fails as a result of sub resource existence.
This fix will always force the resource deletion, as the sub resources deletion is taking care the the API anyway.

Fixes hashicorp/terraform-provider-google#17290
hashicorp/terraform-provider-google#13054

compute:  fixed issue where sub-resources managed by `google_compute_forwarding_rule` prevented resource deletion

@sagiyosefia sagiyosefia changed the title add pre delete logic for private connection Support force destruction of DataStream private connection resource Aug 8, 2024
Copy link

github-actions bot commented Aug 8, 2024

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@ScottSuarez, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Aug 8, 2024
@sagiyosefia sagiyosefia changed the title Support force destruction of DataStream private connection resource Fix Datastream private connection resource destruction Aug 8, 2024
Copy link
Contributor

@ScottSuarez ScottSuarez left a comment

Choose a reason for hiding this comment

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

Are your routes not managed through terraform?

I can see why this behavior might be needed but if everything is within terraform this should be a non-issue.

We could potentially make this opt in but let me understand your usecase before I suggest anything.

@joshbautista
Copy link

Are your routes not managed through terraform?

@ScottSuarez More details in hashicorp/terraform-provider-google#17290 but the gist is:

The following supporting resources are not managed or created explicitly by Terraform when instantiating a google_datastream_private_connection:

  • VPC Peering Connection with a Google owned VPC
  • VPC Peering Routes
  • Allocated IP Range for Private Services Access

From what I can tell, the Datastream API takes it upon itself to manage the lifecycle of these resources on your behalf and doesn't expect (or possibly want) the end user to have created these resources beforehand.

@modular-magician modular-magician added service/datastream and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Aug 13, 2024
@modular-magician
Copy link
Collaborator

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

Diff report

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

google provider: Diff ( 1 file changed, 6 insertions(+))
google-beta provider: Diff ( 1 file changed, 6 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 12
Passed tests: 3
Skipped tests: 8
Affected tests: 1

Click here to see the affected service packages
  • datastream

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDatastreamPrivateConnection_datastreamPrivateConnectionFullExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccDatastreamPrivateConnection_datastreamPrivateConnectionFullExample[Debug log]

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


$\textcolor{green}{\textsf{All tests passed!}}$

View the build log or the debug log for each test

@ScottSuarez ScottSuarez merged commit 7230c21 into GoogleCloudPlatform:main Aug 13, 2024
17 of 19 checks passed
BBBmau pushed a commit to bschaatsbergen/magic-modules that referenced this pull request Aug 21, 2024
rainshen49 pushed a commit to rainshen49/magic-modules that referenced this pull request Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support force_destroy on Datastream Private Connections
4 participants