Skip to content

Commit

Permalink
Add Team Resource (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
ichung08 authored Aug 1, 2024
1 parent 1697d2e commit c9b9fb0
Show file tree
Hide file tree
Showing 36 changed files with 1,529 additions and 205 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/testacc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ jobs:
HYBRID_ORGANIZATION_ID: clx44v7op01nf01m5iohqjkk6
HOSTED_ORGANIZATION_API_TOKEN: ${{ secrets.DEV_HOSTED_ORGANIZATION_API_TOKEN }}
HOSTED_ORGANIZATION_ID: clx42kkcm01fo01o06agtmshg
HOSTED_SCIM_ORGANIZATION_API_TOKEN: ${{ secrets.DEV_HOSTED_SCIM_ORGANIZATION_API_TOKEN }}
HOSTED_SCIM_ORGANIZATION_ID: clz3bcmd3003m01qemptnfenp
HYBRID_CLUSTER_ID: clxkqfzvm001d01ncr9rs80si
HYBRID_DRY_RUN_CLUSTER_ID: clxko4djp008601njcuoxt4z5
HYBRID_NODE_POOL_ID: clxkqfzvm001c01nc1eosyxzg
ASTRO_API_HOST: https://api.astronomer-dev.io
SKIP_CLUSTER_RESOURCE_TESTS: ${{ env.SKIP_CLUSTER_RESOURCE_TESTS }}
HOSTED_TEAM_ID: clx44rvzr01nc01o06pze6qb7
HOSTED_USER_ID: clhpichn8002m01mqa4ocs7g6
HOSTED_USER_ID: clz3a4ymt004x01on8w5ydq8j
HOSTED_DEPLOYMENT_ID: clyn6kxud003x01mtxmccegnh
HOSTED_WORKSPACE_ID: clx42sxw501gl01o0gjenthnh
HOSTED_API_TOKEN_ID: clxm4836f00ql01me3nigmcr6
Expand Down Expand Up @@ -132,12 +134,14 @@ jobs:
HYBRID_ORGANIZATION_ID: clx46ca4y061z01jleyku7sr6
HOSTED_ORGANIZATION_API_TOKEN: ${{ secrets.STAGE_HOSTED_ORGANIZATION_API_TOKEN }}
HOSTED_ORGANIZATION_ID: clx46acvv060e01ilddqlbsmc
HOSTED_SCIM_ORGANIZATION_API_TOKEN: ${{ secrets.STAGE_HOSTED_SCIM_ORGANIZATION_API_TOKEN }}
HOSTED_SCIM_ORGANIZATION_ID: clz3blqb500lh01mtkwu9zk5z
HYBRID_CLUSTER_ID: clxm3xg9e05bl01ixsrhxje4e
HYBRID_DRY_RUN_CLUSTER_ID: clxm3y54805bs01ix5owqhfff
HYBRID_NODE_POOL_ID: clxm3xg9e05bk01ixrqk52cob
ASTRO_API_HOST: https://api.astronomer-stage.io
HOSTED_TEAM_ID: clx486hno068301il306nuhsm
HOSTED_USER_ID: cljftnljr00i001nl6bnngxdb
HOSTED_USER_ID: clz3a95hw00j301jj5jfmcgwd
HOSTED_DEPLOYMENT_ID: cly6exz4a00zd01k18t5bo1vf
HOSTED_WORKSPACE_ID: clx480rvx068u01j9mp7t7fqh
HOSTED_API_TOKEN_ID: clxm46ged05b301neuucdqwox
Expand Down Expand Up @@ -180,12 +184,14 @@ jobs:
HYBRID_ORGANIZATION_ID: clx44v7op01nf01m5iohqjkk6
HOSTED_ORGANIZATION_API_TOKEN: ${{ secrets.DEV_HOSTED_ORGANIZATION_API_TOKEN }}
HOSTED_ORGANIZATION_ID: clx42kkcm01fo01o06agtmshg
HOSTED_SCIM_ORGANIZATION_API_TOKEN: ${{ secrets.DEV_HOSTED_SCIM_ORGANIZATION_API_TOKEN }}
HOSTED_SCIM_ORGANIZATION_ID: clz3bcmd3003m01qemptnfenp
HYBRID_CLUSTER_ID: clxkqfzvm001d01ncr9rs80si
HYBRID_DRY_RUN_CLUSTER_ID: clxko4djp008601njcuoxt4z5
HYBRID_NODE_POOL_ID: clxkqfzvm001c01nc1eosyxzg
ASTRO_API_HOST: https://api.astronomer-dev.io
HOSTED_TEAM_ID: clx44rvzr01nc01o06pze6qb7
HOSTED_USER_ID: clhpichn8002m01mqa4ocs7g6
HOSTED_USER_ID: clz3a4ymt004x01on8w5ydq8j
HOSTED_DEPLOYMENT_ID: clyn6kxud003x01mtxmccegnh
HOSTED_WORKSPACE_ID: clx42sxw501gl01o0gjenthnh
HOSTED_API_TOKEN_ID: clxm4836f00ql01me3nigmcr6
Expand Down
12 changes: 6 additions & 6 deletions docs/data-sources/team.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ data "astro_team" "example" {

### Required

- `id` (String) Team identifier
- `id` (String) Team ID

### Read-Only

- `created_at` (String) Team creation timestamp
- `created_by` (Attributes) Team creator (see [below for nested schema](#nestedatt--created_by))
- `deployment_roles` (Attributes Set) The roles assigned to the deployments (see [below for nested schema](#nestedatt--deployment_roles))
- `deployment_roles` (Attributes Set) The roles assigned to the Deployments (see [below for nested schema](#nestedatt--deployment_roles))
- `description` (String) Team description
- `is_idp_managed` (Boolean) Whether the team is managed by an identity provider
- `is_idp_managed` (Boolean) Whether the Team is managed by an identity provider
- `name` (String) Team name
- `organization_role` (String) The role assigned to the organization
- `roles_count` (Number) Number of roles assigned to the team
- `organization_role` (String) The role assigned to the Organization
- `roles_count` (Number) Number of roles assigned to the Team
- `updated_at` (String) Team last updated timestamp
- `updated_by` (Attributes) Team updater (see [below for nested schema](#nestedatt--updated_by))
- `workspace_roles` (Attributes Set) The roles assigned to the workspaces (see [below for nested schema](#nestedatt--workspace_roles))
- `workspace_roles` (Attributes Set) The roles assigned to the Workspaces (see [below for nested schema](#nestedatt--workspace_roles))

<a id="nestedatt--created_by"></a>
### Nested Schema for `created_by`
Expand Down
12 changes: 6 additions & 6 deletions docs/data-sources/teams.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@ data "astro_teams" "example_teams_filter_by_names" {

Required:

- `id` (String) Team identifier
- `id` (String) Team ID

Read-Only:

- `created_at` (String) Team creation timestamp
- `created_by` (Attributes) Team creator (see [below for nested schema](#nestedatt--teams--created_by))
- `deployment_roles` (Attributes Set) The roles assigned to the deployments (see [below for nested schema](#nestedatt--teams--deployment_roles))
- `deployment_roles` (Attributes Set) The roles assigned to the Deployments (see [below for nested schema](#nestedatt--teams--deployment_roles))
- `description` (String) Team description
- `is_idp_managed` (Boolean) Whether the team is managed by an identity provider
- `is_idp_managed` (Boolean) Whether the Team is managed by an identity provider
- `name` (String) Team name
- `organization_role` (String) The role assigned to the organization
- `roles_count` (Number) Number of roles assigned to the team
- `organization_role` (String) The role assigned to the Organization
- `roles_count` (Number) Number of roles assigned to the Team
- `updated_at` (String) Team last updated timestamp
- `updated_by` (Attributes) Team updater (see [below for nested schema](#nestedatt--teams--updated_by))
- `workspace_roles` (Attributes Set) The roles assigned to the workspaces (see [below for nested schema](#nestedatt--teams--workspace_roles))
- `workspace_roles` (Attributes Set) The roles assigned to the Workspaces (see [below for nested schema](#nestedatt--teams--workspace_roles))

<a id="nestedatt--teams--created_by"></a>
### Nested Schema for `teams.created_by`
Expand Down
103 changes: 103 additions & 0 deletions docs/resources/team.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "astro_team Resource - astro"
subcategory: ""
description: |-
Team resource
---

# astro_team (Resource)

Team resource

## Example Usage

```terraform
resource "astro_team" "example" {
name = "team"
description = "team-description"
member_ids = ["clhpichn8002m01mqa4ocs7g6"]
organization_role = "ORGANIZATION_OWNER"
workspace_roles = [{
workspace_id = "clx42sxw501gl01o0gjenthnh"
role = "WORKSPACE_OWNER"
}]
deployment_roles = [{
deployment_id = "clyn6kxud003x01mtxmccegnh"
role = "DEPLOYMENT_ADMIN"
}]
}
resource "astro_team" "example_with_no_optional_fields" {
name = "team"
organization_role = "ORGANIZATION_OWNER"
}
```

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

### Required

- `name` (String) Team name
- `organization_role` (String) The role to assign to the Organization

### Optional

- `deployment_roles` (Attributes Set) The roles to assign to the Deployments (see [below for nested schema](#nestedatt--deployment_roles))
- `description` (String) Team description
- `member_ids` (Set of String) The IDs of the users to add to the Team
- `workspace_roles` (Attributes Set) The roles to assign to the Workspaces (see [below for nested schema](#nestedatt--workspace_roles))

### Read-Only

- `created_at` (String) Team creation timestamp
- `created_by` (Attributes) Team creator (see [below for nested schema](#nestedatt--created_by))
- `id` (String) Team ID
- `is_idp_managed` (Boolean) Whether the Team is managed by an identity provider
- `roles_count` (Number) Number of roles assigned to the Team
- `updated_at` (String) Team last updated timestamp
- `updated_by` (Attributes) Team updater (see [below for nested schema](#nestedatt--updated_by))

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

Required:

- `deployment_id` (String) The ID of the deployment to assign the role to
- `role` (String) The role to assign to the deployment


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

Required:

- `role` (String) The role to assign to the workspace
- `workspace_id` (String) The ID of the workspace to assign the role to


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

Read-Only:

- `api_token_name` (String)
- `avatar_url` (String)
- `full_name` (String)
- `id` (String)
- `subject_type` (String)
- `username` (String)


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

Read-Only:

- `api_token_name` (String)
- `avatar_url` (String)
- `full_name` (String)
- `id` (String)
- `subject_type` (String)
- `username` (String)
20 changes: 20 additions & 0 deletions examples/resources/astro_team/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
resource "astro_team" "example" {
name = "team"
description = "team-description"
member_ids = ["clhpichn8002m01mqa4ocs7g6"]
organization_role = "ORGANIZATION_OWNER"
workspace_roles = [{
workspace_id = "clx42sxw501gl01o0gjenthnh"
role = "WORKSPACE_OWNER"
}]
deployment_roles = [{
deployment_id = "clyn6kxud003x01mtxmccegnh"
role = "DEPLOYMENT_ADMIN"
}]
}

resource "astro_team" "example_with_no_optional_fields" {
name = "team"
organization_role = "ORGANIZATION_OWNER"
}

Loading

0 comments on commit c9b9fb0

Please sign in to comment.