generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IAC-1124: add iacm workspaces (#726)
* IAC-1124: iac resources * IAC-1124: update go sdk version * IAC-1124: add resources to provider.go * IAC-1124: changelog * IAC-1124: add docs sub category * IAC-1124: fix docs and changelog * IAC-1124: fix change log * IAC-1124: better error handling
- Loading branch information
1 parent
dc2bfc2
commit 4f99a30
Showing
17 changed files
with
1,462 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
```release-note:new-resource | ||
harness_platform_workspace - added a new resource for iacm workspaces | ||
harness_platform_workspace - added a new data source for iacm workspaces | ||
harness_platform_workspace_output - added a new data source for iacm workspace outputs | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "harness_platform_workspace Data Source - terraform-provider-harness" | ||
subcategory: "Next Gen" | ||
description: |- | ||
Data source for retrieving workspaces. | ||
--- | ||
|
||
# harness_platform_workspace (Data Source) | ||
|
||
Data source for retrieving workspaces. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "harness_platform_workspace" "test" { | ||
identifier = "identifier" | ||
org_id = "org_id" | ||
project_id = "project_id" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `identifier` (String) Identifier of the Workspace | ||
- `org_id` (String) Organization Identifier | ||
- `project_id` (String) Project Identifier | ||
|
||
### Optional | ||
|
||
- `description` (String) Description of the Workspace | ||
- `repository_branch` (String) Repository Branch in which the code should be accessed | ||
- `repository_commit` (String) Repository Commit/Tag in which the code should be accessed | ||
|
||
### Read-Only | ||
|
||
- `cost_estimation_enabled` (Boolean) If enabled cost estimation operations will be performed in this workspace | ||
- `environment_variable` (Block Set) Environment variables configured on the workspace (see [below for nested schema](#nestedblock--environment_variable)) | ||
- `id` (String) The ID of this resource. | ||
- `name` (String) Name of the Workspace | ||
- `provider_connector` (String) Provider Connector is the reference to the connector for the infrastructure provider | ||
- `provisioner_type` (String) Provisioner type defines the provisioning tool to use. | ||
- `provisioner_version` (String) Provisioner Version defines the tool version to use | ||
- `repository` (String) Repository is the name of the repository to use | ||
- `repository_connector` (String) Repository Connector is the reference to the connector to use for this code | ||
- `repository_path` (String) Repository Path is the path in which the infra code resides | ||
- `terraform_variable` (Block Set) Terraform variables configured on the workspace (see [below for nested schema](#nestedblock--terraform_variable)) | ||
- `terraform_variable_file` (Block Set) Terraform variables files configured on the workspace (see [below for nested schema](#nestedblock--terraform_variable_file)) | ||
|
||
<a id="nestedblock--environment_variable"></a> | ||
### Nested Schema for `environment_variable` | ||
|
||
Read-Only: | ||
|
||
- `key` (String) Key is the identifier for the variable` | ||
- `value` (String) value is the value of the variable | ||
- `value_type` (String) Value type indicates the value type of the variable, text or secret | ||
|
||
|
||
<a id="nestedblock--terraform_variable"></a> | ||
### Nested Schema for `terraform_variable` | ||
|
||
Read-Only: | ||
|
||
- `key` (String) Key is the identifier for the variable` | ||
- `value` (String) value is the value of the variable | ||
- `value_type` (String) Value type indicates the value type of the variable, text or secret | ||
|
||
|
||
<a id="nestedblock--terraform_variable_file"></a> | ||
### Nested Schema for `terraform_variable_file` | ||
|
||
Read-Only: | ||
|
||
- `repository` (String) Repository is the name of the repository to use | ||
- `repository_branch` (String) Repository Branch in which the code should be accessed | ||
- `repository_commit` (String) Repository Commit/Tag in which the code should be accessed | ||
- `repository_connector` (String) Repository Connector is the reference to the connector to use for this code | ||
- `repository_path` (String) Repository Commit/Tag in which the code should be accessed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "harness_platform_workspace_output Data Source - terraform-provider-harness" | ||
subcategory: "Next Gen" | ||
description: |- | ||
Data source for retrieving workspace outputs. | ||
--- | ||
|
||
# harness_platform_workspace_output (Data Source) | ||
|
||
Data source for retrieving workspace outputs. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "harness_platform_workspace_output" "test" { | ||
identifier = "identifier" | ||
org_id = "org_id" | ||
project_id = "project_id" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `identifier` (String) Identifier of the Workspace. | ||
- `org_id` (String) Organization identifier of the organization the workspace resides in. | ||
- `project_id` (String) Project identifier of the project the workspace resides in. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
- `outputs` (List of Object) (see [below for nested schema](#nestedatt--outputs)) | ||
|
||
<a id="nestedatt--outputs"></a> | ||
### Nested Schema for `outputs` | ||
|
||
Read-Only: | ||
|
||
- `name` (String) | ||
- `sensitive` (Boolean) | ||
- `value` (String) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "harness_platform_workspace Resource - terraform-provider-harness" | ||
subcategory: "Next Gen" | ||
description: |- | ||
Resource for managing Workspaces | ||
--- | ||
|
||
# harness_platform_workspace (Resource) | ||
|
||
Resource for managing Workspaces | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "harness_platform_workspace" "example" { | ||
name = "example" | ||
identifier = "example" | ||
org_id = "org_id" | ||
project_id = "project_id" | ||
provisioner = "terraform" | ||
provisioner_version = "1.5.6" | ||
repository = "https://github.com/org/repo" | ||
repository_branch = "main" | ||
repository_commit = "349d90bb9c90f4a3482981c259080de31609e6f6" | ||
repository_path = "tf/aws/basic" | ||
cost_estimation_enabled = true | ||
provider_connector = "account.connector" | ||
repository_connector = "account.connector" | ||
terraform_variable { | ||
key = "key1" | ||
value = "val1" | ||
value_type = "string" | ||
} | ||
terraform_variable { | ||
key = "key2" | ||
value = "val2" | ||
value_type = "string" | ||
} | ||
environment_variable { | ||
key = "key1" | ||
value = "val1" | ||
value_type = "string" | ||
} | ||
environment_variable { | ||
key = "key2" | ||
value = "val2" | ||
value_type = "string" | ||
} | ||
terraform_variable_file { | ||
repository = "https://github.com/org/repo" | ||
repository_branch = "main" | ||
repository_path = "tf/gcp/basic" | ||
repository_connector = "account.connector" | ||
} | ||
terraform_variable_file { | ||
repository = "https://github.com/org/repo" | ||
repository_branch = "main" | ||
repository_path = "tf/aws/basic" | ||
repository_connector = "account.connector" | ||
} | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `cost_estimation_enabled` (Boolean) Cost estimation enabled determines if cost estimation operations are performed. | ||
- `identifier` (String) Unique identifier of the resource. | ||
- `name` (String) Name of the resource. | ||
- `org_id` (String) Unique identifier of the organization. | ||
- `project_id` (String) Unique identifier of the project. | ||
- `provider_connector` (String) Provider connector is the reference to the connector for the infrastructure provider | ||
- `provisioner_type` (String) Provisioner type defines the provisioning tool to use. Currently only terraform is supported. | ||
- `provisioner_version` (String) Provisioner version defines the tool version to use. Currently we support versions of terraform less than or equal 1.5.6 | ||
- `repository` (String) Repository is the name of the repository to fetch the code from. | ||
- `repository_connector` (String) Repository connector is the reference to the connector used to fetch the code. | ||
- `repository_path` (String) Repository path is the path in which the code resides. | ||
|
||
### Optional | ||
|
||
- `description` (String) Description of the resource. | ||
- `environment_variable` (Block Set) Environment variables configured on the workspace (see [below for nested schema](#nestedblock--environment_variable)) | ||
- `repository_branch` (String) Repository branch is the name of the branch to fetch the code from. This cannot be set if repository commit is set. | ||
- `repository_commit` (String) Repository commit is commit or tag to fetch the code from. This cannot be set if repository branch is set. | ||
- `tags` (Set of String) Tags to associate with the resource. | ||
- `terraform_variable` (Block Set) Terraform variables configured on the workspace. Terraform variable keys must be unique within the workspace. (see [below for nested schema](#nestedblock--terraform_variable)) | ||
- `terraform_variable_file` (Block Set) Terraform variables files configured on the workspace (see [below for nested schema](#nestedblock--terraform_variable_file)) | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
|
||
<a id="nestedblock--environment_variable"></a> | ||
### Nested Schema for `environment_variable` | ||
|
||
Required: | ||
|
||
- `key` (String) Key is the identifier for the variable. Must be unique within the workspace. | ||
- `value` (String) Value is the value of the variable. For string value types this field should contain the value of the variable. For secret value types this should contain a reference to a valid harness secret. | ||
- `value_type` (String) Value type indicates the value type of the variable. Currently we support string and secret. | ||
|
||
|
||
<a id="nestedblock--terraform_variable"></a> | ||
### Nested Schema for `terraform_variable` | ||
|
||
Required: | ||
|
||
- `key` (String) Key is the identifier for the variable. Must be unique within the workspace. | ||
- `value` (String) Value is the value of the variable. For string value types this field should contain the value of the variable. For secret value types this should contain a reference to a valid harness secret. | ||
- `value_type` (String) Value type indicates the value type of the variable. Currently we support string and secret. | ||
|
||
|
||
<a id="nestedblock--terraform_variable_file"></a> | ||
### Nested Schema for `terraform_variable_file` | ||
|
||
Required: | ||
|
||
- `repository` (String) Repository is the name of the repository to fetch the code from. | ||
- `repository_connector` (String) Repository connector is the reference to the connector used to fetch the variables. | ||
|
||
Optional: | ||
|
||
- `repository_branch` (String) Repository branch is the name of the branch to fetch the variables from. This cannot be set if repository commit is set | ||
- `repository_commit` (String) Repository commit is commit or tag to fetch the variables from. This cannot be set if repository branch is set. | ||
- `repository_path` (String) Repository path is the path in which the variables reside. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
terraform import harness_platform_workspace.example <org_id>/<project_id>/<workspace_id> | ||
``` |
5 changes: 5 additions & 0 deletions
5
examples/data-sources/harness_platform_workspace/data-source.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
data "harness_platform_workspace" "test" { | ||
identifier = "identifier" | ||
org_id = "org_id" | ||
project_id = "project_id" | ||
} |
5 changes: 5 additions & 0 deletions
5
examples/data-sources/harness_platform_workspace_output/data-source.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
data "harness_platform_workspace_output" "test" { | ||
identifier = "identifier" | ||
org_id = "org_id" | ||
project_id = "project_id" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
terraform import harness_platform_workspace.example <org_id>/<project_id>/<slo_id> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
resource "harness_platform_workspace" "example" { | ||
name = "example" | ||
identifier = "example" | ||
org_id = harness_platform_organization.test.id | ||
project_id = harness_platform_project.test.id | ||
provisioner = "terraform" | ||
provisioner_version = "1.5.6" | ||
repository = "https://github.com/org/repo" | ||
repository_branch = "main" | ||
repository_commit = "349d90bb9c90f4a3482981c259080de31609e6f6" | ||
repository_path = "tf/aws/basic" | ||
cost_estimation_enabled = true | ||
provider_connector = harness_platform_connector_github.test.id | ||
repository_connector = harness_platform_connector_github.test.id | ||
|
||
terraform_variable { | ||
key = "key1" | ||
value = "val1" | ||
value_type = "string" | ||
} | ||
terraform_variable { | ||
key = "key2" | ||
value = "val2" | ||
value_type = "string" | ||
} | ||
|
||
environment_variable { | ||
key = "key1" | ||
value = "val1" | ||
value_type = "string" | ||
} | ||
environment_variable { | ||
key = "key2" | ||
value = "val2" | ||
value_type = "string" | ||
} | ||
|
||
terraform_variable_file { | ||
repository = "https://github.com/org/repo" | ||
repository_branch = "main" | ||
repository_path = "tf/gcp/basic" | ||
repository_connector = harness_platform_connector_github.test.id | ||
} | ||
terraform_variable_file { | ||
repository = "https://github.com/org/repo" | ||
repository_branch = "main" | ||
repository_path = "tf/aws/basic" | ||
repository_connector = harness_platform_connector_github.test.id | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.