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

desktopvirtualization: adding a state migration for the new ID format #9495

Merged
merged 7 commits into from
Nov 26, 2020

Conversation

tombuildsstuff
Copy link
Contributor

This PR introduces a state migration for each of the Desktop Virtualization resources - allowing these to be parsed insensitively and then patched up to match the apply.

This adds support for a conditional "insensitive" option within the Resource ID generator - intentionally named rewrite, since that's what it's intended to do - which is intentionally disabled by default, since this should be a last-resort to work around a broken API response prior to patching it.

You'll want to review this commit by commit, since the last one is a regeneration of all the parse functions to add some documentation to account for the optional {Insensitive} parser

Ultimately this issue fixes #9491

…ve parsing functions

These are intended only to be used to handle a broken API Response and to rewrite this
within the Provider side to avoid conflicts between Core, which expects a 1:1 Plan <-> Apply
and the Azure API response, which doesn't do that.
…appropriate

This allows us to workaround a bug where Core expects the Plan to 1:1 the Apply
but the Azure API returns the Resource ID's in a case-insensitive manner depending on
which API is being called.

This clearly isn't ideal, but allows for consistency on the Terraform side whilst
working around a broken API on the Azure side.
@tombuildsstuff tombuildsstuff added this to the v2.38.0 milestone Nov 26, 2020
@tombuildsstuff tombuildsstuff requested a review from a team November 26, 2020 14:04
@ghost ghost added the size/XXL label Nov 26, 2020

{
// mixed-cased segment names
Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.DesktopVirtualization/ApPlIcAtIoNgRoUpS/applicationGroup1",
Copy link
Contributor

Choose a reason for hiding this comment

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

😄

Copy link
Contributor

@manicminer manicminer left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@tombuildsstuff
Copy link
Contributor Author

Tests pass:

Screenshot 2020-11-26 at 16 44 44

@tombuildsstuff tombuildsstuff merged commit 4738f07 into master Nov 26, 2020
@tombuildsstuff tombuildsstuff deleted the b/desktop-virtualization/ids-patch-up branch November 26, 2020 15:45
tombuildsstuff added a commit that referenced this pull request Nov 26, 2020
@ghost
Copy link

ghost commented Nov 27, 2020

This has been released in version 2.38.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.38.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Dec 27, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Dec 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants