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: Sets all attributes of Azure mongodbatlas_network_peering as ForceNew, forcing recreation of the resource when updating #2299

Merged
merged 9 commits into from
May 24, 2024

Conversation

oarbusi
Copy link
Collaborator

@oarbusi oarbusi commented May 23, 2024

Description

Sets all attributes when updating an Azure network peering resource.
Fixes #2281

Link to any related issue(s): CLOUDP-249269

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contributing guides
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals, I defined an isolated PR with a relevant title as it will be used in the auto-generated changelog.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

@oarbusi oarbusi changed the title bug: Sets all necessary attributes for update of Azure network_peering fix: Sets all necessary attributes for update of Azure network_peering May 23, 2024
@github-actions github-actions bot added the bug label May 23, 2024
@oarbusi oarbusi marked this pull request as ready for review May 23, 2024 13:06
@oarbusi oarbusi requested review from a team as code owners May 23, 2024 13:06
Copy link
Contributor

APIx bot: a message has been sent to Docs Slack channel

@oarbusi oarbusi changed the title fix: Sets all necessary attributes for update of Azure network_peering fix: Sets all necessary attributes for update of Azure mongodbatlas_network_peering May 23, 2024
@@ -64,6 +64,50 @@ func TestAccNetworkRSNetworkPeering_basicAzure(t *testing.T) {
})
}

func TestAccNetworkRSNetworkPeering_updateBasicAzure(t *testing.T) {
acc.SkipTestForCI(t) // needs Azure configuration
Copy link
Collaborator

Choose a reason for hiding this comment

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

:( is it hard to have this information in our CI setup so that we can actually have it running?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Main issue I found while running them locally is the limitation of network_container that in AWS and Azure there can only be one container per cloud provider region and that you can't delete a network peering container if your project contains clusters. I'll work around that so that we can have the tests run in the CI

Copy link
Member

Choose a reason for hiding this comment

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

in case it can help, we improved cleanup process to delete endpoints: https://github.com/mongodb/terraform-provider-mongodbatlas/blob/master/scripts/cleanup-test-env.sh#L19
we could improve it to delete these projects as well if needed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done! Now the tests run in the CI

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thank you very much!

Co-authored-by: Agustin Bettati <[email protected]>
@oarbusi
Copy link
Collaborator Author

oarbusi commented May 24, 2024

After adding ForceNew to the Azure attributes, Azure update does not have to be handled in the Update method. Will investigate if AWS and GCP have the same behaviour and create a follow up PR if needed

Copy link
Member

@AgustinBettati AgustinBettati left a comment

Choose a reason for hiding this comment

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

LGTM

@oarbusi oarbusi changed the title fix: Sets all necessary attributes for update of Azure mongodbatlas_network_peering fix: Sets all attributes of Azure mongodbatlas_network_peering as ForceNew, forcing recreation of the resource when updating May 24, 2024
@oarbusi oarbusi merged commit 69eeb93 into master May 24, 2024
35 checks passed
@oarbusi oarbusi deleted the CLOUDP-249269 branch May 24, 2024 14:28
svc-apix-Bot added a commit that referenced this pull request May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants