-
Notifications
You must be signed in to change notification settings - Fork 0
docs(azure-customrole): update docs and added examples #907
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
Draft
pablosanchezpaz
wants to merge
4
commits into
main
Choose a base branch
from
add/azure-customrole-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
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" # this is required | ||
|
|
||
| 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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,66 +1,86 @@ | ||||||
| <!-- BEGIN_TF_DOCS --> | ||||||
| # Azure Custom Role Terraform Module | ||||||
|
|
||||||
| ## Overview | ||||||
|
|
||||||
| This Terraform module allows you to create a custom role in Azure, specifying actions, data actions, and the assignable scopes. | ||||||
|
|
||||||
| ## Main features | ||||||
| - Create custom roles in Azure. | ||||||
| - Flexible definition of actions, data actions, not actions, and not data actions. | ||||||
| - Support for multiple assignable scopes. | ||||||
|
|
||||||
| ## Ejemplo completo | ||||||
|
|
||||||
| Puedes encontrar un ejemplo completo en [`_examples/basic/values.yaml`](../\_examples/basic/values.yaml). | ||||||
|
|
||||||
| ## File structure | ||||||
|
|
||||||
| ``` | ||||||
| . | ||||||
| ├── main.tf | ||||||
| ├── variables.tf | ||||||
| ├── outputs.tf | ||||||
| ├── versions.tf | ||||||
| ├── README.md | ||||||
| ├── CHANGELOG.md | ||||||
| └── docs/ | ||||||
| ├── header.md | ||||||
| └── footer.md | ||||||
| ``` | ||||||
|
|
||||||
| ## Requirements | ||||||
|
|
||||||
| | Name | Version | | ||||||
| |------|---------| | ||||||
| | <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.7.5 | | ||||||
| | <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.7.0 | | ||||||
| | <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | ~> 4.16.0 | | ||||||
|
|
||||||
| ## Providers | ||||||
|
|
||||||
| | Name | Version | | ||||||
| |------|---------| | ||||||
| | <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | ~= 4.16.0 | | ||||||
| | <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | ~> 4.16.0 | | ||||||
|
|
||||||
| ## Modules | ||||||
|
|
||||||
| No modules. | ||||||
|
|
||||||
| ## Resources | ||||||
|
|
||||||
| | Name | Type | | ||||||
| |------|------| | ||||||
| | [azurerm_role_definition](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_definition) | source | | ||||||
| | [azurerm_role_definition.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_definition) | resource | | ||||||
|
|
||||||
| ## Inputs | ||||||
|
|
||||||
| | Name | Description | Type | Default | Required | | ||||||
| |------|-------------|------|---------|:--------:| | ||||||
| | name | The name of the Role Definition | `string` | n/a | yes | | ||||||
| | assignable_scopes | One or more assignable scopes for this Role Definition. The first one will become de scope at which the Role Definition applies to. | `list(string)` | n/a | yes | | ||||||
| | permissions | A permissions block with possible 'actions', 'data_actions', 'not_actions' and/or 'not_data_actions'. | <pre>object({<br> actions = list(string) (optional)<br> data_actions = list(string) (optional)<br> not_actions = list(string) (optional)<br> not_data_actions = list(string) (optional)<br>})</pre> | n/a | yes | | ||||||
| | <a name="input_assignable_scopes"></a> [assignable\_scopes](#input\_assignable\_scopes) | One or more assignable scopes for this Role Definition. The first one will become de scope at which the Role Definition applies to. | `list(string)` | n/a | yes | | ||||||
| | <a name="input_name"></a> [name](#input\_name) | The name of the Role Definition | `string` | n/a | yes | | ||||||
| | <a name="input_permissions"></a> [permissions](#input\_permissions) | A permissions block with possible 'actions', 'data\_actions', 'not\_actions' and/or 'not\_data\_actions'. | <pre>object({<br/> actions = optional(list(string), [])<br/> data_actions = optional(list(string), [])<br/> not_actions = optional(list(string), [])<br/> not_data_actions = optional(list(string), [])<br/> })</pre> | n/a | yes | | ||||||
|
|
||||||
| ## Outputs | ||||||
|
|
||||||
| | Name | Description | | ||||||
| |------|-------------| | ||||||
| | <a name="output_role_definition_id"></a> [role_definition_id](#output\_role\_definition\_id"></a>) | The ID of the Role Definition. | | ||||||
|
|
||||||
| ## Example | ||||||
|
|
||||||
| ### HCL | ||||||
| ```hcl | ||||||
| { | ||||||
| name: "Custom Role" | ||||||
| assignable_scopes: ["yyy", "zzz"] | ||||||
| permissions: { | ||||||
| actions = [ | ||||||
| "Microsoft.Compute/disks/read", | ||||||
| "Microsoft.Compute/disks/write", | ||||||
| ] | ||||||
| not_actions = [ | ||||||
| "Microsoft.Compute/disks/read", | ||||||
| "Microsoft.Compute/disks/write", | ||||||
| ] | ||||||
| } | ||||||
| } | ||||||
| ``` | ||||||
| | <a name="output_id"></a> [id](#output\_id) | # OUTPUTS SECTION Role Definition Id | | ||||||
|
||||||
| | <a name="output_id"></a> [id](#output\_id) | # OUTPUTS SECTION Role Definition Id | | |
| | <a name="output_id"></a> [id](#output\_id) | The ID of the created custom role definition. | |
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,6 @@ | ||
| module "custom_role" { | ||
| source = "../../" | ||
| name = var.name | ||
| assignable_scopes = var.assignable_scopes | ||
| permissions = var.permissions | ||
| } |
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,11 @@ | ||
| name: "Custom Role" | ||
| assignable_scopes: | ||
| - "/subscriptions/xxx" | ||
| - "/subscriptions/yyy" | ||
| permissions: | ||
| actions: | ||
| - "Microsoft.Compute/disks/read" | ||
| - "Microsoft.Compute/disks/write" | ||
| notActions: | ||
pablosanchezpaz marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - "Microsoft.Authorization/*/Delete" | ||
| - "Microsoft.Authorization/*/Write" | ||
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,17 @@ | ||
| --- | ||
|
|
||
| ## Examples | ||
|
|
||
| For detailed examples, refer to the [module examples](https://github.com/prefapp/tfm/tree/main/modules/azure-customrole/_examples): | ||
|
|
||
| - [basic](https://github.com/prefapp/tfm/tree/main/modules/azure-customrole/_examples/basic) - Basic custom role definition with assignable scopes and permissions. | ||
|
|
||
| ## Additional resources | ||
|
|
||
| - [Azure Custom Roles](https://learn.microsoft.com/en-us/azure/role-based-access-control/custom-roles) | ||
| - [Terraform AzureRM Provider - azurerm_role_definition](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_definition) | ||
| - [Official Terraform documentation](https://www.terraform.io/docs) | ||
|
|
||
| ## 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,29 @@ | ||
| # Azure Custom Role Terraform Module | ||
|
|
||
| ## Overview | ||
|
|
||
| This Terraform module allows you to create a custom role in Azure, specifying actions, data actions, and the assignable scopes. | ||
|
|
||
| ## Main features | ||
| - Create custom roles in Azure. | ||
| - Flexible definition of actions, data actions, not actions, and not data actions. | ||
| - Support for multiple assignable scopes. | ||
|
|
||
| ## Ejemplo completo | ||
|
|
||
| Puedes encontrar un ejemplo completo en [`_examples/basic/values.yaml`](../_examples/basic/values.yaml). | ||
pablosanchezpaz marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## File structure | ||
|
|
||
| ``` | ||
| . | ||
| ├── main.tf | ||
| ├── variables.tf | ||
| ├── outputs.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.
Uh oh!
There was an error while loading. Please reload this page.