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

azurerm_mssql_managed_instance fix identity bug and updating subnet_id #28319

Merged
merged 7 commits into from
Jan 3, 2025

Conversation

wyattfry
Copy link
Collaborator

@wyattfry wyattfry commented Dec 17, 2024

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

Fixes a bug that introduced a discrepancy between Azure's API behavior and the provider's behavior, namely, Azure allows MSSQL managed instances to have either a System Assigned or User Assigned identity, or both. The provider only allowed for one or the other.

Also, it seems that subnet_id may have been immutable but is now mutable, and thus must be included in the Update command. This PR adds subnet_id to the command.

PR Checklist

  • I have followed the guidelines in our Contributing Documentation.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • I have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work.
    For example: “resource_name_here - description of change e.g. adding property new_property_name_here

Changes to existing Resource / Data Source

  • I have added an explanation of what my changes do and why I'd like you to include them (This may be covered by linking to an issue above, but may benefit from additional explanation).
  • I have written new tests for my resource or datasource changes & updated any relevent documentation.
  • I have successfully run tests with my changes locally. If not, please provide details on testing challenges that prevented you running the tests.
  • (For changes that include a state migration only). I have manually tested the migration path between relevant versions of the provider.

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

This is a (please select all that apply):

  • Bug Fix
  • New Feature (ie adding a service, resource, or data source)
  • Enhancement
  • Breaking Change

Related Issue(s)

Fixes #28320
Fixes #21214
Fixes #19802
Fixes https://hashicorp.atlassian.net/browse/IPL-6520

Note

If this PR changes meaningfully during the course of review please update the title and description as required.

@wyattfry wyattfry changed the title wip azurerm_mssql_managed_instance fix identity bug and subnet changing Dec 19, 2024
@wyattfry wyattfry changed the title azurerm_mssql_managed_instance fix identity bug and subnet changing azurerm_mssql_managed_instance fix identity bug and updating subnet_id Dec 19, 2024
@wyattfry wyattfry changed the title azurerm_mssql_managed_instance fix identity bug and updating subnet_id azurerm_mssql_managed_instance fix identity bug and updating subnet_id Dec 19, 2024
@wyattfry
Copy link
Collaborator Author

1 failing acceptance test, due to timeout, rerunning that one test
image

        API Response:
        ----[start]----
        {"name":"31930286-4dff-48ff-a098-15853e0712d0","status":"Failed","startTime":"2024-12-20T17:23:44.937Z","error":{"code":"ConflictingServerOperation","message":"Server
        'acctestsqlserver241220165729791029' is busy with another operation. Please
        try your operation later."}}
        -----[end]-----
--- FAIL: TestAccMsSqlManagedInstance_identity (4482.45s)

@wyattfry wyattfry marked this pull request as ready for review January 2, 2025 14:49
@wyattfry wyattfry requested a review from a team as a code owner January 2, 2025 14:49
Comment on lines +420 to +422
AdministratorLogin: pointer.To(state.AdministratorLogin),
AdministratorLoginPassword: pointer.To(state.AdministratorLoginPassword),
SubnetId: pointer.To(state.SubnetId),
Copy link
Collaborator Author

@wyattfry wyattfry Jan 2, 2025

Choose a reason for hiding this comment

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

because subnet_id has since become mutable (idk about the admin creds, but the op fails without them), it must now be included in resource updates.

@wyattfry
Copy link
Collaborator Author

wyattfry commented Jan 2, 2025

1 failing acceptance test, due to timeout, rerunning that one test image

        API Response:
        ----[start]----
        {"name":"31930286-4dff-48ff-a098-15853e0712d0","status":"Failed","startTime":"2024-12-20T17:23:44.937Z","error":{"code":"ConflictingServerOperation","message":"Server
        'acctestsqlserver241220165729791029' is busy with another operation. Please
        try your operation later."}}
        -----[end]-----
--- FAIL: TestAccMsSqlManagedInstance_identity (4482.45s)

Test succeeded on the first retry
image

@wyattfry wyattfry self-assigned this Jan 2, 2025
@github-actions github-actions bot added the bug label Jan 2, 2025
Copy link
Member

@catriona-m catriona-m left a comment

Choose a reason for hiding this comment

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

Thanks @wyattfry - I left a couple of minor comments inline but otherwise this is looking pretty good 😄

Copy link
Member

@catriona-m catriona-m left a comment

Choose a reason for hiding this comment

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

Thanks @wyattfry LGTM ✨

@wyattfry wyattfry merged commit 76b7ef2 into main Jan 3, 2025
40 checks passed
@wyattfry wyattfry deleted the wyatt/mssql-managed-instance-identity-bug branch January 3, 2025 14:55
@github-actions github-actions bot added this to the v4.15.0 milestone Jan 3, 2025
wyattfry added a commit that referenced this pull request Jan 8, 2025
jackofallops pushed a commit that referenced this pull request Jan 10, 2025
jackofallops added a commit that referenced this pull request Jan 10, 2025
* Update CHANGELOG.md for #28233

* Update for #28215

* Update CHANGELOG.md for #28279

* Update CHANGELOG.md #28269

* Update CHANGELOG.md #27876

* Update CHANGELOG.md #28069

* Update CHANGELOG.md for #28312

* Update CHANGELOG.md for #28278

* Update CHANGELOG.md #28311

* Update CHANGELOG.md undo 28311

* Update CHANGELOG.md #27874

* Update CHANGELOG.md

* Update CHANGELOG for #28352

* Update CHANGELOG.md for #28390

* Update CHANGELOG.md for #28398

* Update CHANGELOG.md for #28425

* Update CHANGELOG.md #28427

* Update CHANGELOG.md #28280

* Update CHANGELOG.md for #28319

* Update CHANGELOG.md #24801

* Update for #28360 #28216 #27830 #28404 #27401 #27122 #27931 #28442

* Update for #28379

* Update CHANGELOG.md for #28281

* Update for #28380

* Update for #27375

* Update for #25695

* Update CHANGELOG.md #27985

* Update CHANGELOG.md - update release date manually until can be scripted

* Update CHANGELOG.md revert date change as script available

* pre-release script updates

---------

Co-authored-by: stephybun <steph@hashicorp.com>
Co-authored-by: catriona-m <86247157+catriona-m@users.noreply.github.com>
Co-authored-by: Wyatt Fry <wyattfry@gmail.com>
Co-authored-by: sreallymatt <106555974+sreallymatt@users.noreply.github.com>
Co-authored-by: Matthew Frahry <mbfrahry@gmail.com>
Co-authored-by: kt <kt@katbyte.me>
NotTheEvilOne pushed a commit to b1-systems/terraform-provider-azurerm that referenced this pull request Jan 20, 2025
…net_id` (hashicorp#28319)

* wip

* wip

* Support Identity Types, changing Subnets

* remove superfluous example

* pr suggestions
NotTheEvilOne pushed a commit to b1-systems/terraform-provider-azurerm that referenced this pull request Jan 20, 2025
* Update CHANGELOG.md for hashicorp#28233

* Update for hashicorp#28215

* Update CHANGELOG.md for hashicorp#28279

* Update CHANGELOG.md hashicorp#28269

* Update CHANGELOG.md hashicorp#27876

* Update CHANGELOG.md hashicorp#28069

* Update CHANGELOG.md for hashicorp#28312

* Update CHANGELOG.md for hashicorp#28278

* Update CHANGELOG.md hashicorp#28311

* Update CHANGELOG.md undo 28311

* Update CHANGELOG.md hashicorp#27874

* Update CHANGELOG.md

* Update CHANGELOG for hashicorp#28352

* Update CHANGELOG.md for hashicorp#28390

* Update CHANGELOG.md for hashicorp#28398

* Update CHANGELOG.md for hashicorp#28425

* Update CHANGELOG.md hashicorp#28427

* Update CHANGELOG.md hashicorp#28280

* Update CHANGELOG.md for hashicorp#28319

* Update CHANGELOG.md hashicorp#24801

* Update for hashicorp#28360 hashicorp#28216 hashicorp#27830 hashicorp#28404 hashicorp#27401 hashicorp#27122 hashicorp#27931 hashicorp#28442

* Update for hashicorp#28379

* Update CHANGELOG.md for hashicorp#28281

* Update for hashicorp#28380

* Update for hashicorp#27375

* Update for hashicorp#25695

* Update CHANGELOG.md hashicorp#27985

* Update CHANGELOG.md - update release date manually until can be scripted

* Update CHANGELOG.md revert date change as script available

* pre-release script updates

---------

Co-authored-by: stephybun <steph@hashicorp.com>
Co-authored-by: catriona-m <86247157+catriona-m@users.noreply.github.com>
Co-authored-by: Wyatt Fry <wyattfry@gmail.com>
Co-authored-by: sreallymatt <106555974+sreallymatt@users.noreply.github.com>
Co-authored-by: Matthew Frahry <mbfrahry@gmail.com>
Co-authored-by: kt <kt@katbyte.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment