Skip to content

Commit

Permalink
feat: Adding workspace access resource
Browse files Browse the repository at this point in the history
  • Loading branch information
alfespa17 committed Jan 21, 2025
1 parent b9d6aa4 commit 2e21c1a
Show file tree
Hide file tree
Showing 4 changed files with 413 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docs/resources/workspace_access.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "terrakube_workspace_access Resource - terrakube"
subcategory: ""
description: |-
Manage workspace access.
---

# terrakube_workspace_access (Resource)

Manage workspace access.



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

### Required

- `name` (String) Team name
- `organization_id` (String) Terrakube organization id
- `workspace_id` (String) Terrakube workspace id

### Optional

- `manage_job` (Boolean) Allow to manage and trigger jobs
- `manage_state` (Boolean) Allow to manage Terraform/OpenTofu state
- `manage_workspace` (Boolean) Allow to manage workspaces

### Read-Only

- `id` (String) Access Id
8 changes: 8 additions & 0 deletions internal/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ type WorkspaceVariableEntity struct {
Hcl bool `jsonapi:"attr,hcl"`
}

type WorkspaceAccessEntity struct {
ID string `jsonapi:"primary,access"`
ManageState bool `jsonapi:"attr,manageState"`
ManageWorkspace bool `jsonapi:"attr,manageWorkspace"`
ManageJob bool `jsonapi:"attr,manageJob"`
Name string `jsonapi:"attr,name"`
}

type OrganizationVariableEntity struct {
ID string `jsonapi:"primary,globalvar"`
Key string `jsonapi:"attr,key"`
Expand Down
1 change: 1 addition & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ func (p *TerrakubeProvider) Resources(ctx context.Context) []func() resource.Res
NewCollectionItemResource,
NewCollectionReferenceResource,
NewAgentResource,
NewWorkspaceAccessResource,
}
}

Expand Down
Loading

0 comments on commit 2e21c1a

Please sign in to comment.