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

Role Assignment/Definition: parsing the Resource ID's #1887

Merged
merged 2 commits into from
Sep 6, 2018

Conversation

tombuildsstuff
Copy link
Contributor

This PR switches both Role Assignments and Role Definitions to parsing the Resource ID during the Delete function, which fixes a bug where the config is deleted (and thus resource deletion fails).

Supersedes #1724 and #1827
Fixes #1540

```
 $ acctests azurerm TestAccAzureRMRoleAssignment
=== RUN   TestAccAzureRMRoleAssignment
=== RUN   TestAccAzureRMRoleAssignment/basic
=== RUN   TestAccAzureRMRoleAssignment/basic/builtin
=== RUN   TestAccAzureRMRoleAssignment/basic/custom
=== RUN   TestAccAzureRMRoleAssignment/basic/emptyName
=== RUN   TestAccAzureRMRoleAssignment/basic/roleName
=== RUN   TestAccAzureRMRoleAssignment/basic/dataActions
=== RUN   TestAccAzureRMRoleAssignment/import
=== RUN   TestAccAzureRMRoleAssignment/import/basic
=== RUN   TestAccAzureRMRoleAssignment/import/custom
--- PASS: TestAccAzureRMRoleAssignment (706.95s)
    --- PASS: TestAccAzureRMRoleAssignment/basic (280.44s)
        --- PASS: TestAccAzureRMRoleAssignment/basic/builtin (71.61s)
        --- PASS: TestAccAzureRMRoleAssignment/basic/custom (52.23s)
        --- PASS: TestAccAzureRMRoleAssignment/basic/emptyName (42.97s)
        --- PASS: TestAccAzureRMRoleAssignment/basic/roleName (55.43s)
        --- PASS: TestAccAzureRMRoleAssignment/basic/dataActions (58.20s)
    --- PASS: TestAccAzureRMRoleAssignment/import (426.51s)
        --- PASS: TestAccAzureRMRoleAssignment/import/basic (364.16s)
        --- PASS: TestAccAzureRMRoleAssignment/import/custom (62.35s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	707.329s
```
```
$ acctests azurerm TestAccAzureRMRoleDefinition

=== RUN   TestAccAzureRMRoleDefinition_importBasic
--- PASS: TestAccAzureRMRoleDefinition_importBasic (51.33s)
=== RUN   TestAccAzureRMRoleDefinition_importComplete
--- PASS: TestAccAzureRMRoleDefinition_importComplete (47.63s)
=== RUN   TestAccAzureRMRoleDefinition_basic
--- PASS: TestAccAzureRMRoleDefinition_basic (43.12s)
=== RUN   TestAccAzureRMRoleDefinition_complete
--- PASS: TestAccAzureRMRoleDefinition_complete (62.16s)
=== RUN   TestAccAzureRMRoleDefinition_update
--- PASS: TestAccAzureRMRoleDefinition_update (73.26s)
=== RUN   TestAccAzureRMRoleDefinition_emptyName
--- PASS: TestAccAzureRMRoleDefinition_emptyName (41.24s)
PASS
```
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

@tombuildsstuff
Copy link
Contributor Author

Role Assignment Tests pass:

 $ acctests azurerm TestAccAzureRMRoleAssignment
=== RUN   TestAccAzureRMRoleAssignment
=== RUN   TestAccAzureRMRoleAssignment/basic
=== RUN   TestAccAzureRMRoleAssignment/basic/builtin
=== RUN   TestAccAzureRMRoleAssignment/basic/custom
=== RUN   TestAccAzureRMRoleAssignment/basic/emptyName
=== RUN   TestAccAzureRMRoleAssignment/basic/roleName
=== RUN   TestAccAzureRMRoleAssignment/basic/dataActions
=== RUN   TestAccAzureRMRoleAssignment/import
=== RUN   TestAccAzureRMRoleAssignment/import/basic
=== RUN   TestAccAzureRMRoleAssignment/import/custom
--- PASS: TestAccAzureRMRoleAssignment (706.95s)
    --- PASS: TestAccAzureRMRoleAssignment/basic (280.44s)
        --- PASS: TestAccAzureRMRoleAssignment/basic/builtin (71.61s)
        --- PASS: TestAccAzureRMRoleAssignment/basic/custom (52.23s)
        --- PASS: TestAccAzureRMRoleAssignment/basic/emptyName (42.97s)
        --- PASS: TestAccAzureRMRoleAssignment/basic/roleName (55.43s)
        --- PASS: TestAccAzureRMRoleAssignment/basic/dataActions (58.20s)
    --- PASS: TestAccAzureRMRoleAssignment/import (426.51s)
        --- PASS: TestAccAzureRMRoleAssignment/import/basic (364.16s)
        --- PASS: TestAccAzureRMRoleAssignment/import/custom (62.35s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	707.329s

Role Definition Tests pass:

$ acctests azurerm TestAccAzureRMRoleDefinition

=== RUN   TestAccAzureRMRoleDefinition_importBasic
--- PASS: TestAccAzureRMRoleDefinition_importBasic (51.33s)
=== RUN   TestAccAzureRMRoleDefinition_importComplete
--- PASS: TestAccAzureRMRoleDefinition_importComplete (47.63s)
=== RUN   TestAccAzureRMRoleDefinition_basic
--- PASS: TestAccAzureRMRoleDefinition_basic (43.12s)
=== RUN   TestAccAzureRMRoleDefinition_complete
--- PASS: TestAccAzureRMRoleDefinition_complete (62.16s)
=== RUN   TestAccAzureRMRoleDefinition_update
--- PASS: TestAccAzureRMRoleDefinition_update (73.26s)
=== RUN   TestAccAzureRMRoleDefinition_emptyName
--- PASS: TestAccAzureRMRoleDefinition_emptyName (41.24s)
PASS

@tombuildsstuff tombuildsstuff merged commit 49736cc into master Sep 6, 2018
@tombuildsstuff tombuildsstuff deleted the role-assignment-definition-ids branch September 6, 2018 19:47
tombuildsstuff added a commit that referenced this pull request Sep 6, 2018
@ghost
Copy link

ghost commented Mar 6, 2019

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 and limited conversation to collaborators Mar 6, 2019
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.

Cannot update or delete an azurerm_role_definition
2 participants