-
Notifications
You must be signed in to change notification settings - Fork 0
docs(azure-resource-group): update docs and added examples #893
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
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
6c4148a
docs(azure-resource-group): update docs and added examples
pablosanchezpaz 1528b54
docs(azure-role-assignment): update docs and added examples
pablosanchezpaz 813a3b0
Update Readme
pablosanchezpaz 5d0ea39
Revert "docs(azure-resource-group): update docs and added examples"
pablosanchezpaz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| formatter: "markdown" | ||
|
|
||
| version: "" | ||
|
|
||
| header-from: docs/header.md | ||
| footer-from: docs/footer.md | ||
|
|
||
| recursive: | ||
| enabled: false | ||
| path: modules | ||
| include-main: true | ||
|
|
||
| sections: | ||
| hide: [] | ||
| show: [] | ||
|
|
||
| content: "" | ||
|
|
||
| output: | ||
| file: "README.md" | ||
| mode: inject | ||
| template: |- | ||
| <!-- BEGIN_TF_DOCS --> | ||
| {{ .Content }} | ||
| <!-- END_TF_DOCS --> | ||
|
|
||
| output-values: | ||
| enabled: false | ||
| from: "" | ||
|
|
||
| sort: | ||
| enabled: true | ||
| by: name | ||
|
|
||
| settings: | ||
| anchor: true | ||
| color: true | ||
| default: true | ||
| description: false | ||
| escape: true | ||
| hide-empty: false | ||
| html: true | ||
| indent: 2 | ||
| lockfile: true | ||
| read-comments: true | ||
| required: true | ||
| sensitive: true | ||
| type: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| module "azure_role_assignment" { | ||
| source = "../../" | ||
|
|
||
| role_assignments = { | ||
| foo = { | ||
| scope = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup" | ||
| role_definition_name = "Reader" | ||
| target_id = "12345678-1234-1234-1234-123456789012" | ||
| } | ||
| bar = { | ||
| scope = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" | ||
| role_definition_id = "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/12345678-1234-1234-1234-123456789012" | ||
| target_id = "87654321-4321-4321-4321-210987654321" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| role_assignments: | ||
| foo: | ||
| scope: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup | ||
| role_definition_name: Reader | ||
| target_id: 12345678-1234-1234-1234-123456789012 | ||
| bar: | ||
| scope: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM | ||
| role_definition_id: /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/12345678-1234-1234-1234-123456789012 | ||
| target_id: 87654321-4321-4321-4321-210987654321 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| ## Resources and support | ||
|
|
||
| - [Official Azure Role Assignment documentation](https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal) | ||
| - [Terraform reference for azurerm_role_assignment](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment) | ||
|
|
||
| ## Support | ||
|
|
||
| For issues, questions, or contributions related to this module, please visit the [repository's issue tracker](https://github.com/prefapp/tfm/issues). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # Azure Role Assignment Terraform Module | ||
|
|
||
| ## Overview | ||
|
|
||
| This Terraform module allows you to create role assignments (RBAC) for User Assigned Identities, Service Principals, Users, or Groups in Azure, using either role definition names or IDs. | ||
|
|
||
| ## Main features | ||
| - Assign roles to Service Principals, Users, or Groups at any scope. | ||
| - Support for both role definition names and IDs. | ||
| - Flexible configuration using HCL or YAML. | ||
| - Realistic configuration example. | ||
|
|
||
| ## Complete usage example | ||
|
|
||
| ### HCL | ||
| ```hcl | ||
| role_assignments = { | ||
| foo = { | ||
| scope = "/subscriptions/424f653a-bb14-441f-bc4a-6c4f3409cb41/resourceGroups/myResourceGroup" | ||
| role_definition_name = "Reader" | ||
| target_id = "12345678-1234-1234-1234-123456789012" | ||
| }, | ||
| bar = { | ||
| scope = "/subscriptions/424f653a-bb14-441f-bc4a-6c4f3409cb41/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" | ||
| role_definition_id = "/subscriptions/424f653a-bb14-441f-bc4a-6c4f3409cb41/providers/Microsoft.Authorization/roleDefinitions/12345678-1234-1234-1234-123456789012" | ||
| target_id = "87654321-4321-4321-4321-210987654321" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### YAML | ||
| ```yaml | ||
| role_assignments: | ||
| foo: | ||
| scope: "/subscriptions/424f653a-bb14-441f-bc4a-6c4f3409cb41/resourceGroups/myResourceGroup" | ||
| role_definition_name: "Reader" | ||
| target_id: "12345678-1234-1234-1234-123456789012" | ||
| bar: | ||
| scope: "/subscriptions/424f653a-bb14-441f-bc4a-6c4f3409cb41/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM" | ||
| role_definition_id: "/subscriptions/424f653a-bb14-441f-bc4a-6c4f3409cb41/providers/Microsoft.Authorization/roleDefinitions/12345678-1234-1234-1234-123456789012" | ||
| target_id: "87654321-4321-4321-4321-210987654321" | ||
| ``` | ||
|
|
||
| ## Notes | ||
| - You can use either `role_definition_name` or `role_definition_id` for each assignment. | ||
| - The `target_id` can be a Service Principal, User, or Group object ID. | ||
| - Assignments can be created at any Azure scope (subscription, resource group, resource, etc). | ||
|
|
||
| ## File structure | ||
|
|
||
| ``` | ||
| . | ||
| ├── role_assignment.tf | ||
| ├── variables.tf | ||
| ├── versions.tf | ||
| ├── README.md | ||
| ├── CHANGELOG.md | ||
| └── docs/ | ||
| ├── header.md | ||
| └── footer.md | ||
| ``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The input description says 'The key is the scope', but the provided examples use keys like 'foo' and 'bar' and place the scope inside the object. This is misleading for module consumers. Update the variable description (source of terraform-docs output) to reflect that the map key is an arbitrary assignment name/key, while 'scope' is a field in the value object.