From 84b0d8bbad62d18086720725a840d33afa322ded Mon Sep 17 00:00:00 2001 From: David Debeau Date: Wed, 28 Aug 2024 08:55:28 -0500 Subject: [PATCH] Update documentation and examples --- .../organization_team_permission.md | 50 ++++++++++++++++ docs/resources/organization_team.md | 2 +- .../resources/organization_team_permission.md | 57 +++++++++++++++++++ .../data-source.tf | 21 +++++++ .../import.sh | 2 + .../resource.tf | 22 +++++++ 6 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 docs/data-sources/organization_team_permission.md create mode 100644 docs/resources/organization_team_permission.md create mode 100644 examples/data-sources/quay_organization_team_permission/data-source.tf create mode 100644 examples/resources/quay_organization_team_permission/import.sh create mode 100644 examples/resources/quay_organization_team_permission/resource.tf diff --git a/docs/data-sources/organization_team_permission.md b/docs/data-sources/organization_team_permission.md new file mode 100644 index 0000000..1d1c83e --- /dev/null +++ b/docs/data-sources/organization_team_permission.md @@ -0,0 +1,50 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "quay_organization_team_permission Data Source - quay" +subcategory: "" +description: |- + +--- + +# quay_organization_team_permission (Data Source) + + + +## Example Usage + +```terraform +resource "quay_organization" "org" { + name = "org" + email = "quay+org@example.com" +} + +resource "quay_repository" "repo" { + name = "repo" + namespace = quay_organization.org.name +} + +resource "quay_organization_team" "team" { + name = "team" + orgname = quay_organization.org.name + role = "member" +} + +data "quay_organization_team_permission" "permission" { + orgname = quay_organization.org.name + reponame = quay_repository.repo.name + teamname = quay_organization_team.team.name +} +``` + + +## Schema + +### Required + +- `orgname` (String) Organization name +- `reponame` (String) Repository name +- `teamname` (String) Team name + +### Read-Only + +- `permission` (String) Team permission diff --git a/docs/resources/organization_team.md b/docs/resources/organization_team.md index 896946e..1b0d416 100644 --- a/docs/resources/organization_team.md +++ b/docs/resources/organization_team.md @@ -40,7 +40,7 @@ resource "quay_organization_team" "admin" { - `name` (String) Team name - `orgname` (String) Organization name -- `role` (String) Team permission. Should be admin, creator, or member. +- `role` (String) Team role. Should be admin, creator, or member. ### Optional diff --git a/docs/resources/organization_team_permission.md b/docs/resources/organization_team_permission.md new file mode 100644 index 0000000..c71652c --- /dev/null +++ b/docs/resources/organization_team_permission.md @@ -0,0 +1,57 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "quay_organization_team_permission Resource - quay" +subcategory: "" +description: |- + +--- + +# quay_organization_team_permission (Resource) + + + +## Example Usage + +```terraform +resource "quay_organization" "org" { + name = "org" + email = "quay+org@example.com" +} + +resource "quay_repository" "repo" { + name = "repo" + namespace = quay_organization.org.name +} + +resource "quay_organization_team" "team" { + name = "team" + orgname = quay_organization.org.name + role = "member" +} + +resource "quay_organization_team_permission" "permission" { + orgname = quay_organization.org.name + reponame = quay_repository.repo.name + teamname = quay_organization_team.team.name + permission = "read" +} +``` + + +## Schema + +### Required + +- `orgname` (String) Organization name +- `permission` (String) Team permission. Should be read, write or admin. +- `reponame` (String) Repository name +- `teamname` (String) Team name + +## Import + +Import is supported using the following syntax: + +```shell +# An organization team permission can be imported using the corresponding organization, repository and team name. +terraform import quay_organization_team_permission.permission org repo team +``` diff --git a/examples/data-sources/quay_organization_team_permission/data-source.tf b/examples/data-sources/quay_organization_team_permission/data-source.tf new file mode 100644 index 0000000..112b6af --- /dev/null +++ b/examples/data-sources/quay_organization_team_permission/data-source.tf @@ -0,0 +1,21 @@ +resource "quay_organization" "org" { + name = "org" + email = "quay+org@example.com" +} + +resource "quay_repository" "repo" { + name = "repo" + namespace = quay_organization.org.name +} + +resource "quay_organization_team" "team" { + name = "team" + orgname = quay_organization.org.name + role = "member" +} + +data "quay_organization_team_permission" "permission" { + orgname = quay_organization.org.name + reponame = quay_repository.repo.name + teamname = quay_organization_team.team.name +} diff --git a/examples/resources/quay_organization_team_permission/import.sh b/examples/resources/quay_organization_team_permission/import.sh new file mode 100644 index 0000000..be411ee --- /dev/null +++ b/examples/resources/quay_organization_team_permission/import.sh @@ -0,0 +1,2 @@ +# An organization team permission can be imported using the corresponding organization, repository and team name. +terraform import quay_organization_team_permission.permission org repo team diff --git a/examples/resources/quay_organization_team_permission/resource.tf b/examples/resources/quay_organization_team_permission/resource.tf new file mode 100644 index 0000000..7e92a2b --- /dev/null +++ b/examples/resources/quay_organization_team_permission/resource.tf @@ -0,0 +1,22 @@ +resource "quay_organization" "org" { + name = "org" + email = "quay+org@example.com" +} + +resource "quay_repository" "repo" { + name = "repo" + namespace = quay_organization.org.name +} + +resource "quay_organization_team" "team" { + name = "team" + orgname = quay_organization.org.name + role = "member" +} + +resource "quay_organization_team_permission" "permission" { + orgname = quay_organization.org.name + reponame = quay_repository.repo.name + teamname = quay_organization_team.team.name + permission = "read" +}