feat(provider): add teams data-source

Closes #13
This commit is contained in:
Julien Dessaux 2025-05-14 22:34:19 +02:00
parent b3d51bca03
commit c9449084fc
Signed by: adyxax
GPG key ID: F92E51B86E07177E
6 changed files with 232 additions and 0 deletions

View file

@ -0,0 +1,50 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "forgejo_teams Data Source - terraform-provider-forgejo"
subcategory: ""
description: |-
Use this data source to retrieve information about existing forgejo teams belonging to an organization.
---
# forgejo_teams (Data Source)
Use this data source to retrieve information about existing forgejo teams belonging to an organization.
## Example Usage
```terraform
data "forgejo_organizations" "main" {}
data "forgejo_teams" "main" {
for_each = toset([for org in data.forgejo_organizations.main.elements :
org.name
])
organization_name = each.key
}
```
<!-- schema generated by tfplugindocs -->
## Schema
### Required
- `organization_name` (String) The name of the organization the teams are a part of.
### Read-Only
- `elements` (Attributes List) The list of teams for an organization. (see [below for nested schema](#nestedatt--elements))
<a id="nestedatt--elements"></a>
### Nested Schema for `elements`
Read-Only:
- `can_create_org_repo` (Boolean) Whether members of this team can create repositories that will belong to the organization.
- `description` (String) A description string.
- `id` (Number) The identifier of the team.
- `includes_all_repositories` (Boolean) Whether members of this team can access all the repositories that belong to the organization.
- `name` (String) The team's name are a part of.
- `permission` (String) The members' permission level on the organization.
- `units` (List of String) The list of units permissions.
- `units_map` (Map of String) The map of units permissions and their level.