Skip to content

Commit 7c04973

Browse files
committed
Add support workspace_vcs resource
1 parent 2061ee3 commit 7c04973

File tree

5 files changed

+466
-2
lines changed

5 files changed

+466
-2
lines changed

docs/resources/workspace_vcs.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "terrakube_workspace_vcs Resource - terraform-provider-terrakube"
4+
subcategory: ""
5+
description: |-
6+
7+
---
8+
9+
# terrakube_workspace_vcs (Resource)
10+
11+
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `branch` (String) Workspace VCS branch
21+
- `description` (String) Workspace VCS description
22+
- `execution_mode` (String) Workspace VCS execution mode (remote or local)
23+
- `git_repository` (String) Workspace VCS repository
24+
- `iac_type` (String) Workspace VCS IaC type (Supported values terraform or tofu)
25+
- `iac_version` (String) Workspace VCS VCS type
26+
- `name` (String) Workspace VCS name
27+
- `organization_id` (String) Terrakube organization id
28+
29+
### Read-Only
30+
31+
- `id` (String) Workspace CLI Id
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
resource "terrakube_workspace_cli" "sample1" {
2+
organization_id = data.terrakube_organization.org.id
3+
name = "work-from-provider1"
4+
description = "sample"
5+
execution_mode = "remote"
6+
repository = "https://github.com/AzBuilder/terrakube-docker-compose.git"
7+
branch = "main"
8+
iac_type = "terraform"
9+
iac_version = "1.5.7"
10+
}

internal/provider/provider.go

+1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ func (p *TerrakubeProvider) Resources(ctx context.Context) []func() resource.Res
173173
NewModuleResource,
174174
NewOrganizationResource,
175175
NewWorkspaceCliResource,
176+
NewWorkspaceVcsResource,
176177
NewWorkspaceVariableResource,
177178
NewOrganizationVariableResource,
178179
}

internal/provider/workspace_cli_resource.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -387,13 +387,13 @@ func (r *WorkspaceCliResource) Delete(ctx context.Context, req resource.DeleteRe
387387
workspaceCliRequest.Header.Add("Authorization", fmt.Sprintf("Bearer %s", r.token))
388388
workspaceCliRequest.Header.Add("Content-Type", "application/vnd.api+json")
389389
if err != nil {
390-
resp.Diagnostics.AddError("Error creating team resource request", fmt.Sprintf("Error creating team resource request: %s", err))
390+
resp.Diagnostics.AddError("Error creating vcs resource request", fmt.Sprintf("Error creating vcs resource request: %s", err))
391391
return
392392
}
393393

394394
workspaceCliResponse, err := r.client.Do(workspaceCliRequest)
395395
if err != nil {
396-
resp.Diagnostics.AddError("Error executing team resource request", fmt.Sprintf("Error executing team resource request: %s", err))
396+
resp.Diagnostics.AddError("Error executing vcs resource request", fmt.Sprintf("Error executing vcs resource request: %s", err))
397397
return
398398
}
399399

0 commit comments

Comments
 (0)