diff --git a/docs/resources/organization_group_project.md b/docs/resources/organization_group_project.md index 17096f067..314510967 100644 --- a/docs/resources/organization_group_project.md +++ b/docs/resources/organization_group_project.md @@ -13,15 +13,26 @@ Adds and manages a [group](https://aiven.io/docs/platform/concepts/projects_acco ## Example Usage ```terraform +resource "aiven_project" "example_project" { + project = "Example project" + parent_id = aiven_organization.main.id +} + resource "aiven_organization_user_group" "example" { description = "Example group of users." organization_id = aiven_organization.main.id name = "Example group" } +resource "aiven_organization_user_group_member" "project_admin" { + group_id = aiven_organization_user_group.example.group_id + organization_id = aiven_organization.main.id + user_id = "u123a456b7890c" +} + resource "aiven_organization_group_project" "example" { group_id = aiven_organization_user_group.example.group_id - project = aiven_project.example.project + project = aiven_project.example_project.project role = "admin" } ``` diff --git a/examples/resources/aiven_organization_group_project/resource copy.tf b/examples/resources/aiven_organization_group_project/resource copy.tf deleted file mode 100644 index 3486c5f14..000000000 --- a/examples/resources/aiven_organization_group_project/resource copy.tf +++ /dev/null @@ -1,16 +0,0 @@ -resource "aiven_project" "example_project" { - project = "Example project" - parent_id = aiven_organization.main.id -} - -resource "aiven_organization_user_group" "example" { - description = "Example group of users." - organization_id = aiven_organization.main.id - name = "Example group" -} - -resource "aiven_organization_user_group_member" "project_admin" { - group_id = aiven_organization_user_group.example.group_id - organization_id = aiven_organization.main.id - user_id = "u123a456b7890c" -} \ No newline at end of file diff --git a/examples/resources/aiven_organization_group_project/resource.tf b/examples/resources/aiven_organization_group_project/resource.tf index c3c5c54c0..23b5356fb 100644 --- a/examples/resources/aiven_organization_group_project/resource.tf +++ b/examples/resources/aiven_organization_group_project/resource.tf @@ -1,3 +1,7 @@ +resource "aiven_project" "example_project" { + project = "Example project" + parent_id = aiven_organization.main.id +} resource "aiven_organization_user_group" "example" { description = "Example group of users." @@ -5,8 +9,14 @@ resource "aiven_organization_user_group" "example" { name = "Example group" } +resource "aiven_organization_user_group_member" "project_admin" { + group_id = aiven_organization_user_group.example.group_id + organization_id = aiven_organization.main.id + user_id = "u123a456b7890c" +} + resource "aiven_organization_group_project" "example" { group_id = aiven_organization_user_group.example.group_id - project = aiven_project.example.project + project = aiven_project.example_project.project role = "admin" -} +} \ No newline at end of file