-
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 2 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,75 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- 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 = ["User.Read.All"] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+4
to
+62
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## 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 = ["User.Read.All"] | |
| 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 | |
| ``` | |
| <!-- | |
| NOTE: | |
| This README is generated by terraform-docs. | |
| The human-maintained overview, examples, and additional resources | |
| live in: | |
| - docs/header.md | |
| - docs/footer.md | |
| To update this documentation, edit those files and re-run terraform-docs. | |
| --> |
Copilot
AI
Feb 10, 2026
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 Providers table mixes version constraints (~> 3.3.0) with n/a for time, which can be confusing (terraform-docs provider tables typically communicate concrete versions or consistently communicate constraints). Re-run/adjust the docs generation so provider version info is accurate and consistent, or clarify that these are constraints rather than resolved versions.
| | <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,55 @@ | ||||||
| # 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 = ["User.Read.All"] | ||||||
pablosanchezpaz marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| redirects = [{ | ||||||
| platform = "web" | ||||||
|
||||||
| platform = "web" | |
| platform = "Web" |
Uh oh!
There was an error while loading. Please reload this page.