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

New Data Source: azurerm_builtin_role_definition #384

Merged
merged 5 commits into from
Oct 3, 2017

Conversation

tombuildsstuff
Copy link
Contributor

Adding a new data source for the built-in Azure role definitions to be able to specify friendly names rather than GUID's

$ acctests azurerm TestAccDataSourceAzureRMBuiltInRoleDefinition_
=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_contributor
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_contributor (8.28s)
=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_owner
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_owner (7.63s)
=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_reader
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_reader (7.06s)
=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_virtualMachineContributor
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_virtualMachineContributor (7.68s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm    30.676s

```
$ acctests azurerm TestAccDataSourceAzureRMBuiltInRoleDefinition_
=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_contributor
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_contributor (8.28s)
=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_owner
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_owner (7.63s)
=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_reader
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_reader (7.06s)
=== RUN   TestAccDataSourceAzureRMBuiltInRoleDefinition_virtualMachineContributor
--- PASS: TestAccDataSourceAzureRMBuiltInRoleDefinition_virtualMachineContributor (7.68s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm    30.676s
```
}
roleDefinitionId := roleDefinitionIds[name]

// TODO: when the API's fixed - pull out additional information from the API
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll open a bug shortly and link that here

"Contributor": "b24988ac-6180-42a0-ab88-20f7382dd24c",
"Owner": "8e3af657-a8ff-443c-a75c-2fe8c4bcb635",
"Reader": "acdd72a7-3385-48ef-bd42-f606fba81ae7",
"VirtualMachineContributor": "d73bb868-a0df-4d4d-bd69-98a00b01fccb",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these are Constants within Azure - I've confirmed this within the Azure Portal and in a third-party ARM Template.

Copy link
Member

Choose a reason for hiding this comment

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

Is this documented anywhere publicly - i.e. can we possibly link to any doc page from here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not that I've seen, I found these in an ARM Template and confirmed the values in the HTML source of the Azure Portal - so I can confirm they're right.

A search for the GUID doesn't bring up anything official from MS - but does confirm it's a global constant ¯_(ツ)_/¯

@tombuildsstuff tombuildsstuff force-pushed the data-source-builtin-role-definitions branch from 72df91e to b387d67 Compare October 3, 2017 09:24
"Contributor": "b24988ac-6180-42a0-ab88-20f7382dd24c",
"Owner": "8e3af657-a8ff-443c-a75c-2fe8c4bcb635",
"Reader": "acdd72a7-3385-48ef-bd42-f606fba81ae7",
"VirtualMachineContributor": "d73bb868-a0df-4d4d-bd69-98a00b01fccb",
Copy link
Member

Choose a reason for hiding this comment

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

Is this documented anywhere publicly - i.e. can we possibly link to any doc page from here?

@tombuildsstuff tombuildsstuff merged commit 82da283 into master Oct 3, 2017
@tombuildsstuff tombuildsstuff deleted the data-source-builtin-role-definitions branch October 3, 2017 10:59
tombuildsstuff added a commit that referenced this pull request Oct 3, 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 👉 hashibot-feedback@hashicorp.com. 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