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 Assignments / Role Definitions #414

Merged
merged 11 commits into from
Oct 11, 2017
Merged

Role Assignments / Role Definitions #414

merged 11 commits into from
Oct 11, 2017

Conversation

tombuildsstuff
Copy link
Contributor

Sorry this is one large PR, but everything depended on everything else :(

  • New Data Source: azurerm_role_definition
  • New Resource: azurerm_role_assignment
  • New Resource: azurerm_role_definition

```
$ acctests azurerm TestAccDataSourceAzureRMBuiltInRoleDefinition_
=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_contributor
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_contributor (8.53s)
=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_owner
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_owner (7.24s)
=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_reader
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_reader (7.39s)
=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_virtualMachineContributor
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_virtualMachineContributor (7.36s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm    30.535s
```
```
$ acctests azurerm TestAccDataSourceAzureRMBuiltInRoleDefinition_

=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_contributor
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_contributor (9.49s)
=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_owner
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_owner (9.08s)
=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_reader
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_reader (9.02s)
=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_virtualMachineContributor
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_virtualMachineContributor (8.61s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm    36.220s
```
```
$ acctests azurerm TestAccAzureRMRoleDefinition_
=== RUN   TestAccAzureRMRoleDefinition_basic
--- PASS: TestAccAzureRMRoleDefinition_basic (13.76s)
=== RUN   TestAccAzureRMRoleDefinition_complete
--- PASS: TestAccAzureRMRoleDefinition_complete (13.51s)
=== RUN   TestAccAzureRMRoleDefinition_update
--- PASS: TestAccAzureRMRoleDefinition_update (22.73s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm    50.032s
```
```
$ acctests azurerm TestAccDataSourceAzureRMBuiltInRoleDefinition_
=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_contributor
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_contributor (10.38s)
=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_owner
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_owner (10.01s)
=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_reader
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_reader (8.22s)
=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_virtualMachineContributor
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_virtualMachineContributor (9.02s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm    37.663s
```
```
$ acctests azurerm TestAccDataSourceAzureRMRoleDefinition_
=== RUN   TestAccDataSourceAzureRMRoleDefinition_basic
--- PASS: TestAccDataSourceAzureRMRoleDefinition_basic (14.58s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm    14.603s
```
```
$ acctests azurerm TestAccAzureRMRoleAssignment_
=== RUN   TestAccAzureRMRoleAssignment_builtin
--- PASS: TestAccAzureRMRoleAssignment_builtin (18.73s)
=== RUN   TestAccAzureRMRoleAssignment_custom
--- PASS: TestAccAzureRMRoleAssignment_custom (20.58s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm    39.335s
```
```
$ acctests azurerm TestAccAzureRMRoleAssignment_import
=== RUN   TestAccAzureRMRoleAssignment_importBasic
--- PASS: TestAccAzureRMRoleAssignment_importBasic (20.94s)
=== RUN   TestAccAzureRMRoleAssignment_importCustom
--- PASS: TestAccAzureRMRoleAssignment_importCustom (17.62s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm    38.579s
```
```
$ acctests azurerm TestAccAzureRMRoleDefinition_import
=== RUN   TestAccAzureRMRoleDefinition_importBasic
--- PASS: TestAccAzureRMRoleDefinition_importBasic (16.32s)
=== RUN   TestAccAzureRMRoleDefinition_importComplete
--- PASS: TestAccAzureRMRoleDefinition_importComplete (14.12s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm    30.462s
```
client := meta.(*ArmClient).roleDefinitionsClient
name := d.Get("name").(string)
roleDefinitionIds := map[string]string{
"Contributor": "/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c",
Copy link
Member

@mbfrahry mbfrahry Oct 11, 2017

Choose a reason for hiding this comment

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

Are these values (Contributor, Owner, Reader, VirtualMachineContributor) specific to our account or azure in general?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They're Azure in General - this Data Source is mostly there so users don't have to refer to GUIDs tbh

Copy link
Member

Choose a reason for hiding this comment

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

Perfect!

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 tombuildsstuff merged commit 93e2b51 into master Oct 11, 2017
@tombuildsstuff tombuildsstuff deleted the authorization branch October 11, 2017 16:02
tombuildsstuff added a commit that referenced this pull request Oct 11, 2017
@ghost
Copy link

ghost commented Apr 1, 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 and limited conversation to collaborators Apr 1, 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.

2 participants