Skip to content

Commit

Permalink
docs: add teams deprecation info to relevant resources (#1601)
Browse files Browse the repository at this point in the history
  • Loading branch information
staceysalamon-aiven authored Feb 19, 2024
1 parent 1bb4a14 commit 4bea2c9
Show file tree
Hide file tree
Showing 12 changed files with 148 additions and 84 deletions.
22 changes: 10 additions & 12 deletions docs/resources/account_team.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "aiven_account_team Resource - terraform-provider-aiven"
subcategory: ""
description: |-
The Account Team resource allows the creation and management of an Account Team.
Creates and manages a team.
---

# aiven_account_team (Resource)
Creates and manages a team.

The Account Team resource allows the creation and management of an Account Team.
~> **Teams are becoming groups**
Groups are an easier way to control access to your organization's projects and
services for a group of users.
[Migrate your teams](https://aiven.io/docs/tools/terraform/howto/migrate-from-teams-to-groups) to groups.

## Example Usage

## Example Usage
```terraform
resource "aiven_account_team" "account_team1" {
account_id = aiven_account.<ACCOUNT_RESOURCE>.account_id
name = "<ACCOUNT_TEAM_NAME>"
resource "aiven_account_team" "example_team" {
account_id = aiven_account.ACCOUNT_RESOURCE_NAME.account_id
name = "Example team"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

Expand Down Expand Up @@ -48,11 +49,8 @@ Optional:
- `delete` (String)
- `read` (String)
- `update` (String)

## Import

Import is supported using the following syntax:

```shell
terraform import aiven_account_team.account_team1 account_id/team_id
```
38 changes: 16 additions & 22 deletions docs/resources/account_team_member.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "aiven_account_team_member Resource - terraform-provider-aiven"
subcategory: ""
description: |-
The Account Team Member resource allows the creation and management of an Aiven Account Team Member.
During the creation of aiven_account_team_memberresource, an email invitation will be sent
to a user using user_email address. If the user accepts an invitation, he or she will become
a member of the account team. The deletion of aiven_account_team_member will not only
delete the invitation if one was sent but not yet accepted by the user, it will also
eliminate an account team member if one has accepted an invitation previously.
Adds a user as a team member.
During the creation of this resource, an invite is sent to the address specified in user_email.
The user is added to the team after they accept the invite. Deleting aiven_account_team_member
deletes the pending invite if not accepted or removes the user from the team if they already accepted the invite.
---

# aiven_account_team_member (Resource)
Adds a user as a team member.

The Account Team Member resource allows the creation and management of an Aiven Account Team Member.
During the creation of this resource, an invite is sent to the address specified in `user_email`.
The user is added to the team after they accept the invite. Deleting `aiven_account_team_member`
deletes the pending invite if not accepted or removes the user from the team if they already accepted the invite.

During the creation of `aiven_account_team_member`resource, an email invitation will be sent
to a user using `user_email` address. If the user accepts an invitation, he or she will become
a member of the account team. The deletion of `aiven_account_team_member` will not only
delete the invitation if one was sent but not yet accepted by the user, it will also
eliminate an account team member if one has accepted an invitation previously.
~> **Teams are becoming groups**
Groups are an easier way to control access to your organization's projects and
services for a group of users.
[Migrate your teams](https://aiven.io/docs/tools/terraform/howto/migrate-from-teams-to-groups) to groups.

## Example Usage

## Example Usage
```terraform
resource "aiven_account_team_member" "foo" {
account_id = aiven_account.<ACCOUNT_RESOURCE>.account_id
team_id = aiven_account_team.<TEAM_RESOURCE>.team_id
resource "aiven_account_team_member" "main" {
account_id = aiven_account.ACCOUNT_RESOURCE_NAME.account_id
team_id = aiven_account_team.TEAM_RESOURCE_NAME.team_id
user_email = "[email protected]"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

Expand Down Expand Up @@ -61,11 +58,8 @@ Optional:
- `delete` (String)
- `read` (String)
- `update` (String)

## Import

Import is supported using the following syntax:

```shell
terraform import aiven_account_team_member.foo account_id/team_id/user_email
```
38 changes: 17 additions & 21 deletions docs/resources/account_team_project.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "aiven_account_team_project Resource - terraform-provider-aiven"
subcategory: ""
description: |-
The Account Team Project resource allows the creation and management of an Account Team Project.
It is intended to link an existing project to the existing account team.
It is important to note that the project should have an account_id property set equal to the
account team you are trying to link to this project.
Links an existing project to an existing team. Both the project and team should have the same account_id.
---

# aiven_account_team_project (Resource)
Links an existing project to an existing team. Both the project and team should have the same `account_id`.

The Account Team Project resource allows the creation and management of an Account Team Project.
~> **Teams are becoming groups**
Groups are an easier way to control access to your organization's projects and
services for a group of users.
[Migrate your teams](https://aiven.io/docs/tools/terraform/howto/migrate-from-teams-to-groups) to groups.

It is intended to link an existing project to the existing account team.
It is important to note that the project should have an `account_id` property set equal to the
account team you are trying to link to this project.

## Example Usage

```terraform
resource "aiven_project" "<PROJECT>" {
resource "aiven_project" "example_project" {
project = "project-1"
account_id = aiven_account_team.<ACCOUNT_RESOURCE>.account_id
account_id = aiven_account_team.ACCOUNT_RESOURCE_NAME.account_id
}
resource "aiven_account_team" "example_team" {
account_id = aiven_account.ACCOUNT_RESOURCE_NAME.account_id
name = "Example team"
}
resource "aiven_account_team_project" "account_team_project1" {
account_id = aiven_account.<ACCOUNT_RESOURCE>.account_id
team_id = aiven_account_team.<TEAM_RESOURCE>.team_id
project_name = aiven_project.<PROJECT>.project
resource "aiven_account_team_project" "main" {
account_id = aiven_account.ACCOUNT_RESOURCE_NAME.account_id
team_id = aiven_account_team.example_team.team_id
project_name = aiven_project.example_project.project
team_type = "admin"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

Expand Down Expand Up @@ -61,11 +60,8 @@ Optional:
- `delete` (String)
- `read` (String)
- `update` (String)

## Import

Import is supported using the following syntax:

```shell
terraform import aiven_account_team_project.account_team_project1 account_id/team_id/project_name
```
6 changes: 3 additions & 3 deletions examples/resources/aiven_account_team/resource.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource "aiven_account_team" "account_team1" {
account_id = aiven_account.<ACCOUNT_RESOURCE>.account_id
name = "<ACCOUNT_TEAM_NAME>"
resource "aiven_account_team" "example_team" {
account_id = aiven_account.ACCOUNT_RESOURCE_NAME.account_id
name = "Example team"
}
6 changes: 3 additions & 3 deletions examples/resources/aiven_account_team_member/resource.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "aiven_account_team_member" "foo" {
account_id = aiven_account.<ACCOUNT_RESOURCE>.account_id
team_id = aiven_account_team.<TEAM_RESOURCE>.team_id
resource "aiven_account_team_member" "main" {
account_id = aiven_account.ACCOUNT_RESOURCE_NAME.account_id
team_id = aiven_account_team.TEAM_RESOURCE_NAME.team_id
user_email = "[email protected]"
}
17 changes: 11 additions & 6 deletions examples/resources/aiven_account_team_project/resource.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
resource "aiven_project" "<PROJECT>" {
resource "aiven_project" "example_project" {
project = "project-1"
account_id = aiven_account_team.<ACCOUNT_RESOURCE>.account_id
account_id = aiven_account_team.ACCOUNT_RESOURCE_NAME.account_id
}

resource "aiven_account_team_project" "account_team_project1" {
account_id = aiven_account.<ACCOUNT_RESOURCE>.account_id
team_id = aiven_account_team.<TEAM_RESOURCE>.team_id
project_name = aiven_project.<PROJECT>.project
resource "aiven_account_team" "example_team" {
account_id = aiven_account.ACCOUNT_RESOURCE_NAME.account_id
name = "Example team"
}

resource "aiven_account_team_project" "main" {
account_id = aiven_account.ACCOUNT_RESOURCE_NAME.account_id
team_id = aiven_account_team.example_team.team_id
project_name = aiven_project.example_project.project
team_type = "admin"
}
9 changes: 4 additions & 5 deletions internal/sdkprovider/service/account/account_team.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import (
"context"

"github.com/aiven/aiven-go-client/v2"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"

"github.com/aiven/terraform-provider-aiven/internal/common"
"github.com/aiven/terraform-provider-aiven/internal/schemautil"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

var aivenAccountTeamSchema = map[string]*schema.Schema{
Expand Down Expand Up @@ -41,7 +40,7 @@ var aivenAccountTeamSchema = map[string]*schema.Schema{

func ResourceAccountTeam() *schema.Resource {
return &schema.Resource{
Description: "The Account Team resource allows the creation and management of an Account Team.",
Description: `Creates and manages a team.`,
CreateContext: resourceAccountTeamCreate,
ReadContext: resourceAccountTeamRead,
UpdateContext: resourceAccountTeamUpdate,
Expand All @@ -52,7 +51,7 @@ func ResourceAccountTeam() *schema.Resource {
Timeouts: schemautil.DefaultResourceTimeouts(),

Schema: aivenAccountTeamSchema,
DeprecationMessage: "This resource is deprecated",
DeprecationMessage: "This resource is deprecated. Use aiven_organization_user_group instead.",
}
}

Expand Down
12 changes: 5 additions & 7 deletions internal/sdkprovider/service/account/account_team_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,11 @@ var aivenAccountTeamMemberSchema = map[string]*schema.Schema{
func ResourceAccountTeamMember() *schema.Resource {
return &schema.Resource{
Description: `
The Account Team Member resource allows the creation and management of an Aiven Account Team Member.
Adds a user as a team member.
During the creation of ` + "`aiven_account_team_member`" + `resource, an email invitation will be sent
to a user using ` + "`user_email`" + ` address. If the user accepts an invitation, he or she will become
a member of the account team. The deletion of ` + "`aiven_account_team_member`" + ` will not only
delete the invitation if one was sent but not yet accepted by the user, it will also
eliminate an account team member if one has accepted an invitation previously.
During the creation of this resource, an invite is sent to the address specified in ` + "`user_email`" + `.
The user is added to the team after they accept the invite. Deleting ` + "`aiven_account_team_member`" + `
deletes the pending invite if not accepted or removes the user from the team if they already accepted the invite.
`,
CreateContext: resourceAccountTeamMemberCreate,
ReadContext: resourceAccountTeamMemberRead,
Expand All @@ -73,7 +71,7 @@ eliminate an account team member if one has accepted an invitation previously.
Timeouts: schemautil.DefaultResourceTimeouts(),

Schema: aivenAccountTeamMemberSchema,
DeprecationMessage: "This resource is deprecated",
DeprecationMessage: "This resource is deprecated. Use aiven_organization_user_group_member instead.",
}
}

Expand Down
9 changes: 4 additions & 5 deletions internal/sdkprovider/service/account/account_team_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ var aivenAccountTeamProjectSchema = map[string]*schema.Schema{
func ResourceAccountTeamProject() *schema.Resource {
return &schema.Resource{
Description: `
The Account Team Project resource allows the creation and management of an Account Team Project.
It is intended to link an existing project to the existing account team.
It is important to note that the project should have an ` + "`account_id`" + ` property set equal to the
account team you are trying to link to this project.
Links an existing project to an existing team. Both the project and team should have the same ` + "`account_id`" + `.
`,
CreateContext: resourceAccountTeamProjectCreate,
ReadContext: resourceAccountTeamProjectRead,
Expand All @@ -56,6 +52,9 @@ account team you are trying to link to this project.
Timeouts: schemautil.DefaultResourceTimeouts(),

Schema: aivenAccountTeamProjectSchema,
DeprecationMessage: `
This resource is deprecated. Use aiven_organization_group_project instead.
`,
}
}

Expand Down
25 changes: 25 additions & 0 deletions templates/resources/account_team.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}"
subcategory: ""
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---
# {{.Name}} ({{.Type}})
{{ .Description | trimspace }}

~> **Teams are becoming groups**
Groups are an easier way to control access to your organization's projects and
services for a group of users.
[Migrate your teams](https://aiven.io/docs/tools/terraform/howto/migrate-from-teams-to-groups) to groups.


{{ if .HasExample -}}
## Example Usage
{{ tffile .ExampleFile }}
{{- end }}
{{ .SchemaMarkdown | trimspace }}
{{ if .HasImport -}}
## Import
Import is supported using the following syntax:
{{ codefile "shell" .ImportFile }}
{{- end }}
25 changes: 25 additions & 0 deletions templates/resources/account_team_member.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}"
subcategory: ""
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---
# {{.Name}} ({{.Type}})
{{ .Description | trimspace }}

~> **Teams are becoming groups**
Groups are an easier way to control access to your organization's projects and
services for a group of users.
[Migrate your teams](https://aiven.io/docs/tools/terraform/howto/migrate-from-teams-to-groups) to groups.


{{ if .HasExample -}}
## Example Usage
{{ tffile .ExampleFile }}
{{- end }}
{{ .SchemaMarkdown | trimspace }}
{{ if .HasImport -}}
## Import
Import is supported using the following syntax:
{{ codefile "shell" .ImportFile }}
{{- end }}
25 changes: 25 additions & 0 deletions templates/resources/account_team_project.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}"
subcategory: ""
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---
# {{.Name}} ({{.Type}})
{{ .Description | trimspace }}

~> **Teams are becoming groups**
Groups are an easier way to control access to your organization's projects and
services for a group of users.
[Migrate your teams](https://aiven.io/docs/tools/terraform/howto/migrate-from-teams-to-groups) to groups.


{{ if .HasExample -}}
## Example Usage
{{ tffile .ExampleFile }}
{{- end }}
{{ .SchemaMarkdown | trimspace }}
{{ if .HasImport -}}
## Import
Import is supported using the following syntax:
{{ codefile "shell" .ImportFile }}
{{- end }}

0 comments on commit 4bea2c9

Please sign in to comment.