-
Notifications
You must be signed in to change notification settings - Fork 0
docs(azure-application): update docs and added examples #909
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
base: main
Are you sure you want to change the base?
Changes from all commits
c00fc85
2c2c2f6
caa62cf
d6c7e5a
8c7264c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,19 +1,80 @@ | ||||||||||
| <!-- BEGIN_TF_DOCS --> | ||||||||||
| # Azure Application Registration Terraform Module | ||||||||||
|
|
||||||||||
| ## Overview | ||||||||||
|
|
||||||||||
| Este módulo de Terraform permite crear y gestionar un registro de aplicación en Azure Active Directory (Azure AD), incluyendo: | ||||||||||
| - Creación de la aplicación y service principal. | ||||||||||
| - Asignación de roles y permisos (incluyendo Microsoft Graph). | ||||||||||
| - Configuración de credenciales federadas y secretos. | ||||||||||
| - Soporte para redirecciones y miembros. | ||||||||||
| - Integración opcional con Azure Key Vault para almacenar secretos. | ||||||||||
|
|
||||||||||
| ## Características principales | ||||||||||
| - Registro de aplicación y service principal en Azure AD. | ||||||||||
| - Asignación de roles personalizados y de Microsoft Graph. | ||||||||||
| - Soporte para credenciales federadas (OIDC, GitHub Actions, etc). | ||||||||||
| - Gestión de secretos con rotación y almacenamiento seguro en Key Vault. | ||||||||||
| - Configuración flexible de redirecciones y miembros. | ||||||||||
|
|
||||||||||
| ## Ejemplo básico de uso | ||||||||||
|
|
||||||||||
| ```hcl | ||||||||||
| module "azure_application" { | ||||||||||
| source = "./modules/azure-application" | ||||||||||
| name = "my-app" | ||||||||||
| members = ["user1@dominio.com", "user2@dominio.com"] | ||||||||||
| msgraph_roles = [ | ||||||||||
| { | ||||||||||
| id = "User.Read.All" | ||||||||||
| delegated = true | ||||||||||
| } | ||||||||||
| ] | ||||||||||
| redirects = [{ | ||||||||||
| platform = "web" | ||||||||||
| redirect_uris = ["https://myapp.com/auth/callback"] | ||||||||||
| }] | ||||||||||
| client_secret = { | ||||||||||
| enabled = true | ||||||||||
| rotation_days = 90 | ||||||||||
| keyvault = { | ||||||||||
| id = azurerm_key_vault.example.id | ||||||||||
| key_name = "my-app-secret" | ||||||||||
| } | ||||||||||
| } | ||||||||||
| } | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ## Estructura de archivos | ||||||||||
|
|
||||||||||
| ``` | ||||||||||
| . | ||||||||||
| ├── 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.0 | | ||||||||||
| | <a name="requirement_azapi"></a> [azapi](#requirement\_azapi) | ~> 2.3.0 | | ||||||||||
| | <a name="requirement_azuread"></a> [azuread](#requirement\_azuread) | ~> 3.3.0 | | ||||||||||
| | <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | ~> 4.16.0 | | ||||||||||
|
|
||||||||||
| ## Providers | ||||||||||
|
|
||||||||||
| | Name | Version | | ||||||||||
| |------|---------| | ||||||||||
| | <a name="provider_azuread"></a> [azuread](#provider\_azuread) | 3.3.0 | | ||||||||||
| | <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | 4.16.0 | | ||||||||||
| | <a name="provider_time"></a> [time](#provider\_time) | 0.13.1 | | ||||||||||
| | <a name="provider_azuread"></a> [azuread](#provider\_azuread) | ~> 3.3.0 | | ||||||||||
| | <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | ~> 4.16.0 | | ||||||||||
| | <a name="provider_time"></a> [time](#provider\_time) | n/a | | ||||||||||
|
|
||||||||||
|
Comment on lines
+77
to
78
|
||||||||||
| | <a name="provider_time"></a> [time](#provider\_time) | n/a | | |
| | <a name="provider_time"></a> [time](#provider\_time) | n/a (no explicit version constraint; latest available will be used) | | |
| _Note: Provider versions shown here are version constraints (from \`versions.tf\`) or an absence of constraint (shown as \`n/a\`), not the exact resolved provider versions._ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // Basic example: Azure AD Application Registration using the module | ||
|
|
||
| module "azure_application" { | ||
| source = "../../" | ||
|
|
||
| name = "my-app" | ||
| members = [ | ||
| "user1@contoso.com", | ||
| "user2@contoso.com", | ||
| ] | ||
|
|
||
| msgraph_roles = [ | ||
| { | ||
| id = "role-id-user-read-all" | ||
| delegated = true | ||
| } | ||
| ] | ||
|
|
||
| redirects = [ | ||
| { | ||
| platform = "Web" | ||
| redirect_uris = ["https://myapp.com/auth/callback"] | ||
| } | ||
| ] | ||
|
|
||
| client_secret = { | ||
| enabled = true | ||
| rotation_days = 90 | ||
| keyvault = { | ||
| id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg/providers/Microsoft.KeyVault/vaults/example-kv" | ||
| key_name = "my-app-secret" | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Basic example values for Azure Application Registration module | ||
|
|
||
| name: my-app | ||
|
|
||
| members: | ||
| - user1@contoso.com | ||
| - user2@contoso.com | ||
|
|
||
| msgraph_roles: | ||
| - id: role-id-user-read-all | ||
| delegated: true | ||
|
|
||
| redirects: | ||
| - platform: Web | ||
| redirect_uris: | ||
| - https://myapp.com/auth/callback | ||
|
|
||
| client_secret: | ||
| enabled: true | ||
| rotation_days: 90 | ||
| keyvault: | ||
| id: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg/providers/Microsoft.KeyVault/vaults/example-kv | ||
| key_name: my-app-secret |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| --- | ||
|
|
||
| ## Examples | ||
|
|
||
| For detailed examples, refer to the [module examples](https://github.com/prefapp/tfm/tree/main/modules/azure-application/_examples): | ||
|
|
||
| - [basic](https://github.com/prefapp/tfm/tree/main/modules/azure-application/_examples/basic) - Azure AD App Registration with members, redirects, Microsoft Graph roles and client secret stored in Key Vault. | ||
|
|
||
| ## Recursos adicionales | ||
|
|
||
| - [Azure Active Directory App Registration](https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app) | ||
| - [Proveedor Terraform AzureAD](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/resources/application) | ||
| - [Proveedor Terraform AzureRM](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs) | ||
| - [Documentación oficial de Terraform](https://www.terraform.io/docs) | ||
|
|
||
| ## Soporte | ||
|
|
||
| Para dudas, incidencias o contribuciones, utiliza el issue tracker del repositorio: [https://github.com/prefapp/tfm/issues](https://github.com/prefapp/tfm/issues) |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,60 @@ | ||||||
| # Azure Application Registration Terraform Module | ||||||
|
|
||||||
| ## Overview | ||||||
|
|
||||||
| Este módulo de Terraform permite crear y gestionar un registro de aplicación en Azure Active Directory (Azure AD), incluyendo: | ||||||
| - Creación de la aplicación y service principal. | ||||||
| - Asignación de roles y permisos (incluyendo Microsoft Graph). | ||||||
| - Configuración de credenciales federadas y secretos. | ||||||
| - Soporte para redirecciones y miembros. | ||||||
| - Integración opcional con Azure Key Vault para almacenar secretos. | ||||||
|
|
||||||
| ## Características principales | ||||||
| - Registro de aplicación y service principal en Azure AD. | ||||||
| - Asignación de roles personalizados y de Microsoft Graph. | ||||||
| - Soporte para credenciales federadas (OIDC, GitHub Actions, etc). | ||||||
| - Gestión de secretos con rotación y almacenamiento seguro en Key Vault. | ||||||
| - Configuración flexible de redirecciones y miembros. | ||||||
|
|
||||||
| ## Ejemplo básico de uso | ||||||
|
|
||||||
| ```hcl | ||||||
| module "azure_application" { | ||||||
| source = "./modules/azure-application" | ||||||
| name = "my-app" | ||||||
| members = ["user1@dominio.com", "user2@dominio.com"] | ||||||
| msgraph_roles = [ | ||||||
| { | ||||||
| id = "User.Read.All" | ||||||
| delegated = true | ||||||
| } | ||||||
| ] | ||||||
| redirects = [{ | ||||||
| platform = "web" | ||||||
|
||||||
| platform = "web" | |
| platform = "Web" |
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 content in
README.mdappears duplicated with the newly addeddocs/header.mdanddocs/footer.md(same overview/example/resources). Keeping the same text in multiple places is likely to drift. Prefer a single source of truth: either generate the README via terraform-docs usingdocs/header.md/docs/footer.md, or remove the duplicate docs files if they aren't part of the generation pipeline.