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_role_definition - terraform import now sets scope to prevent a force recreate #7424

Merged
merged 1 commit into from Jun 22, 2020

Conversation

logachev
Copy link
Contributor

When running terraform import for azurerm_role_definition resources, Read operation doesn't expand Scope.

As a result, on terraform apply or terraform plan, this resource is forced to be recreated which is impossible due to existing role assignments.

This is a simple fix to populate scope from id.

Also, removed trim / from parseResourceId, unclear why this is required. Delete operation works regardless of / symbol + input requires scope to use / as a first symbol.

@ghost ghost added the size/XS label Jun 22, 2020
@logachev logachev changed the title azurerm_role_definition: terraform import doesn't import scope azurerm_role_definition: terraform import doesn't set scope, forces recreate Jun 22, 2020
Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

LGTM!

@mbfrahry mbfrahry changed the title azurerm_role_definition: terraform import doesn't set scope, forces recreate azurerm_role_definition - terraform import now sets scope to prevent a force recreate Jun 22, 2020
@mbfrahry mbfrahry added this to the v2.16.0 milestone Jun 22, 2020
@mbfrahry mbfrahry merged commit d45dc27 into hashicorp:master Jun 22, 2020
mbfrahry added a commit that referenced this pull request Jun 22, 2020
@mbfrahry
Copy link
Member

Thanks for this @logachev!
Fixes #4351

@ghost
Copy link

ghost commented Jun 25, 2020

This has been released in version 2.16.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.16.0"
}
# ... other configuration ...

jrauschenbusch pushed a commit to jrauschenbusch/terraform-provider-azurerm that referenced this pull request Jun 29, 2020
jrauschenbusch pushed a commit to jrauschenbusch/terraform-provider-azurerm that referenced this pull request Jun 29, 2020
jrauschenbusch pushed a commit to jrauschenbusch/terraform-provider-azurerm that referenced this pull request Jun 29, 2020
jrauschenbusch pushed a commit to jrauschenbusch/terraform-provider-azurerm that referenced this pull request Jun 29, 2020
@ghost
Copy link

ghost commented Jul 23, 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 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked and limited conversation to collaborators Jul 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants