Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions docs/data-sources/team.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "singlestoredb_team Data Source - terraform-provider-singlestoredb"
subcategory: ""
description: |-
Retrieve a specific team using its ID with this data source.
---

# singlestoredb_team (Data Source)

Retrieve a specific team using its ID with this data source.

## Example Usage

```terraform
provider "singlestoredb" {
// The SingleStoreDB Terraform provider uses the SINGLESTOREDB_API_KEY environment variable for authentication.
// Please set this environment variable with your SingleStore Management API key.
// You can generate this key from the SingleStore Portal at https://portal.singlestore.com/organizations/org-id/api-keys.
}

data "singlestoredb_team" "this" {
id = "24f31e2d-847f-4a62-9a93-a10e9bcd0dae" # Replace with the actual ID of the team.
}

output "this_team" {
value = data.singlestoredb_team.this
}
```

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

### Required

- `id` (String) The unique identifier of the team.

### Read-Only

- `created_at` (String) The timestamp of when the team was created.
- `description` (String) The description of the team.
- `member_teams` (Attributes List) List of teams that are members of this team. (see [below for nested schema](#nestedatt--member_teams))
- `member_users` (Attributes List) List of users that are members of this team. (see [below for nested schema](#nestedatt--member_users))
- `name` (String) The name of the team.

<a id="nestedatt--member_teams"></a>
### Nested Schema for `member_teams`

Read-Only:

- `description` (String) The description of the team.
- `name` (String) The name of the team.
- `team_id` (String) The unique identifier of the team.


<a id="nestedatt--member_users"></a>
### Nested Schema for `member_users`

Read-Only:

- `email` (String) The email of the user.
- `first_name` (String) The first name of the user.
- `last_name` (String) The last name of the user.
- `user_id` (String) The unique identifier of the user.


72 changes: 72 additions & 0 deletions docs/data-sources/teams.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "singlestoredb_teams Data Source - terraform-provider-singlestoredb"
subcategory: ""
description: |-
This data source provides a list of teams that the user has access to.
---

# singlestoredb_teams (Data Source)

This data source provides a list of teams that the user has access to.

## Example Usage

```terraform
provider "singlestoredb" {
// The SingleStoreDB Terraform provider uses the SINGLESTOREDB_API_KEY environment variable for authentication.
// Please set this environment variable with your SingleStore Management API key.
// You can generate this key from the SingleStore Portal at https://portal.singlestore.com/organizations/org-id/api-keys.
}

data "singlestoredb_teams" "all" {}

output "all_teams" {
value = data.singlestoredb_teams.all
}
```

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

### Read-Only

- `id` (String) The ID of this resource.
- `teams` (Attributes List) (see [below for nested schema](#nestedatt--teams))

<a id="nestedatt--teams"></a>
### Nested Schema for `teams`

Required:

- `id` (String) The unique identifier of the team.

Read-Only:

- `created_at` (String) The timestamp of when the team was created.
- `description` (String) The description of the team.
- `member_teams` (Attributes List) List of teams that are members of this team. (see [below for nested schema](#nestedatt--teams--member_teams))
- `member_users` (Attributes List) List of users that are members of this team. (see [below for nested schema](#nestedatt--teams--member_users))
- `name` (String) The name of the team.

<a id="nestedatt--teams--member_teams"></a>
### Nested Schema for `teams.member_teams`

Read-Only:

- `description` (String) The description of the team.
- `name` (String) The name of the team.
- `team_id` (String) The unique identifier of the team.


<a id="nestedatt--teams--member_users"></a>
### Nested Schema for `teams.member_users`

Read-Only:

- `email` (String) The email of the user.
- `first_name` (String) The first name of the user.
- `last_name` (String) The last name of the user.
- `user_id` (String) The unique identifier of the user.


52 changes: 52 additions & 0 deletions docs/resources/team.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "singlestoredb_team Resource - terraform-provider-singlestoredb"
subcategory: ""
description: |-
Manage SingleStoreDB teams with this resource.
---

# singlestoredb_team (Resource)

Manage SingleStoreDB teams with this resource.

## Example Usage

```terraform
provider "singlestoredb" {
// The SingleStoreDB Terraform provider uses the SINGLESTOREDB_API_KEY environment variable for authentication.
// Please set this environment variable with your SingleStore Management API key.
// You can generate this key from the SingleStore Portal at https://portal.singlestore.com/organizations/org-id/api-keys.
}

resource "singlestoredb_team" "this" {
name = "terrafrom-test-team"
description = "Terrafrom test team"
member_users = []
member_teams = []
}

output "singlestoredb_team_id" {
value = singlestoredb_team.this.id
}
```

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

### Required

- `name` (String) The name of the team.

### Optional

- `description` (String) The description of the team.
- `member_teams` (List of String) List of team UUIDs that are members of this team.
- `member_users` (List of String) List of user UUIDs that are members of this team.

### Read-Only

- `created_at` (String) The timestamp of when the team was created.
- `id` (String) The unique identifier of the team.


13 changes: 13 additions & 0 deletions examples/data-sources/singlestoredb_team/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
provider "singlestoredb" {
// The SingleStoreDB Terraform provider uses the SINGLESTOREDB_API_KEY environment variable for authentication.
// Please set this environment variable with your SingleStore Management API key.
// You can generate this key from the SingleStore Portal at https://portal.singlestore.com/organizations/org-id/api-keys.
}

data "singlestoredb_team" "this" {
id = "24f31e2d-847f-4a62-9a93-a10e9bcd0dae" # Replace with the actual ID of the team.
}

output "this_team" {
value = data.singlestoredb_team.this
}
11 changes: 11 additions & 0 deletions examples/data-sources/singlestoredb_teams/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
provider "singlestoredb" {
// The SingleStoreDB Terraform provider uses the SINGLESTOREDB_API_KEY environment variable for authentication.
// Please set this environment variable with your SingleStore Management API key.
// You can generate this key from the SingleStore Portal at https://portal.singlestore.com/organizations/org-id/api-keys.
}

data "singlestoredb_teams" "all" {}

output "all_teams" {
value = data.singlestoredb_teams.all
}
3 changes: 3 additions & 0 deletions examples/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ var (
UserListDataSource = mustRead("data-sources/singlestoredb_users/data-source.tf")
InvitationsGetDataSource = mustRead("data-sources/singlestoredb_invitation/data-source.tf")
InvitationsListDataSource = mustRead("data-sources/singlestoredb_invitations/data-source.tf")
TeamsGetDataSource = mustRead("data-sources/singlestoredb_team/data-source.tf")
TeamsResource = mustRead("resources/singlestoredb_team/resource.tf")
TeamsListDataSource = mustRead("data-sources/singlestoredb_teams/data-source.tf")
)

func mustRead(path string) string {
Expand Down
16 changes: 16 additions & 0 deletions examples/resources/singlestoredb_team/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
provider "singlestoredb" {
// The SingleStoreDB Terraform provider uses the SINGLESTOREDB_API_KEY environment variable for authentication.
// Please set this environment variable with your SingleStore Management API key.
// You can generate this key from the SingleStore Portal at https://portal.singlestore.com/organizations/org-id/api-keys.
}

resource "singlestoredb_team" "this" {
name = "terrafrom-test-team"
description = "Terrafrom test team"
member_users = []
member_teams = []
}

output "singlestoredb_team_id" {
value = singlestoredb_team.this.id
}
4 changes: 4 additions & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/singlestore-labs/terraform-provider-singlestoredb/internal/provider/privateconnections"
"github.com/singlestore-labs/terraform-provider-singlestoredb/internal/provider/regions"
regions_v2 "github.com/singlestore-labs/terraform-provider-singlestoredb/internal/provider/regionsv2"
"github.com/singlestore-labs/terraform-provider-singlestoredb/internal/provider/teams"
"github.com/singlestore-labs/terraform-provider-singlestoredb/internal/provider/users"
"github.com/singlestore-labs/terraform-provider-singlestoredb/internal/provider/util"
"github.com/singlestore-labs/terraform-provider-singlestoredb/internal/provider/workspacegroups"
Expand Down Expand Up @@ -168,6 +169,8 @@ func (p *singlestoreProvider) DataSources(_ context.Context) []func() datasource
users.NewDataSourceList,
invitations.NewDataSourceList,
invitations.NewDataSourceGet,
teams.NewDataSourceList,
teams.NewDataSourceGet,
}
}

Expand All @@ -178,6 +181,7 @@ func (p *singlestoreProvider) Resources(_ context.Context) []func() resource.Res
workspaces.NewResource,
privateconnections.NewResource,
users.NewResource,
teams.NewResource,
}
}

Expand Down
Loading