Skip to content

docs(azuread-group): update docs and added examples#887

Draft
pablosanchezpaz wants to merge 6 commits intomainfrom
add/azuread-group-docs
Draft

docs(azuread-group): update docs and added examples#887
pablosanchezpaz wants to merge 6 commits intomainfrom
add/azuread-group-docs

Conversation

@pablosanchezpaz
Copy link
Contributor

No description provided.

@pablosanchezpaz pablosanchezpaz requested a review from a team as a code owner February 6, 2026 08:23
@jotasixto jotasixto changed the title Add/azuread group docs docs(azuread-group): update docs and added examples Feb 6, 2026
@jotasixto jotasixto requested a review from Copilot February 6, 2026 18:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates documentation for the modules/azuread-group Terraform module and introduces terraform-docs configuration to generate richer README content (header/footer + generated inputs/outputs).

Changes:

  • Added docs/header.md and docs/footer.md to serve as terraform-docs header/footer content.
  • Added .terraform-docs.yml to inject generated docs into README.md.
  • Updated README.md with an injected terraform-docs block containing module overview, examples, and generated tables.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
modules/azuread-group/docs/header.md New module header documentation + minimal YAML usage + known issues.
modules/azuread-group/docs/footer.md New footer with examples/resources/support links.
modules/azuread-group/README.md Adds terraform-docs injected block (currently appended, duplicating existing docs).
modules/azuread-group/.terraform-docs.yml Configures terraform-docs injection using the new header/footer files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 151 to 155
## Requirements
- Terraform >= 1.7.0
- Provider azuread ~> 2.52.0
- Provider azurerm = 4.16.0

Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The header content adds a ## Requirements section (bullet list) and terraform-docs also generates a ## Requirements section (table) later in the same injected block, which results in duplicate headings and conflicting-looking requirement info. Consider removing the Requirements block from docs/header.md (or hiding the auto-generated Requirements section in .terraform-docs.yml) so requirements are documented only once.

Copilot uses AI. Check for mistakes.

For detailed examples, refer to the [module examples](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples):

- [basic](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples) - Example showing group creation, members and PIM configuration.
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The README Examples section lists a basic example but links to the _examples root and the module only contains _examples/with_yaml_file. This link should be updated (likely via docs/footer.md) so the README points to real example directories.

Suggested change
- [basic](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples) - Example showing group creation, members and PIM configuration.
- [basic](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples/with_yaml_file) - Example showing group creation, members and PIM configuration.

Copilot uses AI. Check for mistakes.
Comment on lines 87 to 107
**values.yaml**
```yaml
name: example-group-1
description: Minimal test group
members:
- type: user
email: user-2@example.com
```

**main.tf**
```hcl
locals {
values = yamldecode(file("./values.yaml"))
}

module "azuread-group" {
source = "../.."
name = local.values.name
description = local.values.description
members = local.values.members
}
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The “Minimal usage example” is missing required module inputs. In variables.tf, both directory_roles and subscription_roles have no defaults, so omitting them will cause Terraform to fail. Update the YAML and module invocation to provide these (e.g., empty lists for a true minimal example, or a small realistic role sample).

Copilot uses AI. Check for mistakes.
}
```

> For a complete working example, see the `_examples/with_yaml_file` folder in this repository.
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

This note says _examples/with_yaml_file is a “complete working example”, but that example currently pins azurerm to ~>3.100.0 while this module requires azurerm = 4.16.0 (provider constraint conflict). Either update the example to use a compatible provider constraint or adjust the wording so it doesn’t claim it’s working as-is.

Suggested change
> For a complete working example, see the `_examples/with_yaml_file` folder in this repository.
> For a more complete example configuration, see the `_examples/with_yaml_file` folder in this repository. Ensure that provider versions in the example align with the Requirements section above.

Copilot uses AI. Check for mistakes.

For detailed examples, refer to the [module examples](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples):

- [basic](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples) - Example showing group creation, members and PIM configuration.
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The Examples section lists a basic example, but the link points to the _examples root and there is no basic example directory in this module (only _examples/with_yaml_file). Update the link text and URL to match the actual example folder(s).

Suggested change
- [basic](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples) - Example showing group creation, members and PIM configuration.
- [with_yaml_file](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples/with_yaml_file) - Example showing group creation, members and PIM configuration.

Copilot uses AI. Check for mistakes.
Comment on lines 146 to 150
<!-- BEGIN_TF_DOCS -->
# Azure AD Group Module

This Terraform module creates and manages Azure Active Directory (AD) groups, including role assignments, PIM (Privileged Identity Management), owners, and members. It supports configuration via YAML for easier management and reproducibility.

Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

terraform-docs content is being appended at the end of the README instead of replacing the existing generated docs at the top, leaving two separate documentation blocks in the same file. To align with other modules, move the <!-- BEGIN_TF_DOCS --> marker to the beginning of the README (and <!-- END_TF_DOCS --> to the end) so the whole README is managed by terraform-docs, and delete the older duplicated content outside the markers.

Copilot uses AI. Check for mistakes.
@pablosanchezpaz
Copy link
Contributor Author

Related to #786

@pablosanchezpaz pablosanchezpaz marked this pull request as draft February 11, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants