generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
902 additions
and
47 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,4 @@ | ||
```relese-note:fix | ||
harness_platform_connector_aws: Added Support for execute_on_delegate param. | ||
harness_platform_connector_azure_cloud_provider: Added Support for execute_on_delegate param. | ||
``` |
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 |
---|---|---|
|
@@ -41,3 +41,4 @@ test-report.xml | |
terraform-provider-harness | ||
|
||
.terraform.lock.hcl | ||
local.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "harness_chaos_infrastructure Data Source - terraform-provider-harness" | ||
subcategory: "Next Gen" | ||
description: |- | ||
Data source for retrieving a chaos infrastructure. | ||
--- | ||
|
||
# harness_chaos_infrastructure (Data Source) | ||
|
||
Data source for retrieving a chaos infrastructure. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "harness_chaos_infrastructure" "example" { | ||
identifier = "identifier" | ||
org_id = "org_id" | ||
project_id = "project_id" | ||
environment_id = "env_id" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
|
||
## Schema | ||
|
||
### Required | ||
|
||
- `environment_id` (String) Environment identifier of the chaos infrastructure. | ||
- `identifier` (String) Identifier of the chaos infrastructure. | ||
- `org_id` (String) Identifier of the organization in which the chaos infrastructure is configured. | ||
- `project_id` (String) Identifier of the project in which the chaos infrastructure is configured. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "harness_chaos_infrastructure Resource - terraform-provider-harness" | ||
subcategory: "Next Gen" | ||
description: |- | ||
Resource for creating a Chaos Infrastructure. | ||
--- | ||
|
||
# harness_chaos_infrastructure (Resource) | ||
|
||
Resource for creating a Chaos Infrastructure. | ||
|
||
### References: | ||
|
||
- For details on how to onboard with Terraform, please see [Harness Terraform Provider Overview](https://developer.harness.io/docs/platform/automation/terraform/harness-terraform-provider-overview/) | ||
|
||
## Example to create Chaos Infrastructure | ||
|
||
```terraform | ||
resource "harness_chaos_infrastructure" "example" { | ||
identifier = "identifier" | ||
name = "name" | ||
org_id = "org_id" | ||
project_id = "project_id" | ||
environment_id = "env_id" | ||
namespace = "namespace" | ||
service_account = "service_acc_name" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
|
||
## Schema | ||
|
||
### Required | ||
|
||
- `org_id` (String) Unique identifier of the organization. | ||
- `project_id` (String) Unique identifier of the project. | ||
- `environment_id` (String) Environment ID of the chaos infrastructure. | ||
- `identifier` (String) Unique identifier of the resource. | ||
- `name` (String) Name of the resource. | ||
- `namespace` (String) Namespace of the chaos infrastructure. | ||
- `service_account` (String) Service Account of the chaos infrastructure. | ||
|
||
### Optional | ||
|
||
- `description` (String) Description of the resource. | ||
- `tags` (Set of String) Tags to associate with the resource. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
# Import using the Chaos Infra ID. | ||
terraform import harness_chaos_infrastructure.example <chaos_infra_id> | ||
``` |
6 changes: 6 additions & 0 deletions
6
examples/data-sources/harness_chaos_infrastructure/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,6 @@ | ||
data "harness_chaos_infrastructure" "example" { | ||
identifier = "identifier" | ||
org_id = "org_id" | ||
project_id = "project_id" | ||
environment_id= "env_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,2 @@ | ||
# Import using the Harness chaos_infra_id. | ||
terraform import harness_chaos_infrastructure.example <chaos_infra_id> |
11 changes: 11 additions & 0 deletions
11
examples/resources/harness_chaos_infrastructure/resource.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,11 @@ | ||
|
||
# Sample resource for chaos infrastructure | ||
resource "harness_chaos_infrastructure" "example" { | ||
identifier = "identifier" | ||
name = "name" | ||
org_id = "org_id" | ||
project_id = "project_id" | ||
environment_id = "env_id" | ||
namespace = "namespace" | ||
service_account = "service_acc_name" | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package helpers | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/antihax/optional" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestBuildFieldForInt32_Int(t *testing.T) { | ||
|
||
var value = 14 | ||
expected := optional.NewInt32(int32(value)) | ||
|
||
resource := createTestResourceForBuildField() | ||
data := map[string]interface{}{ | ||
"field_int": value, | ||
} | ||
|
||
d := schema.TestResourceDataRaw(t, resource.Schema, data) | ||
|
||
assert.Equal(t, expected, BuildFieldInt32(d, "field_int")) | ||
} | ||
|
||
func TestBuildFieldForInt32_Missing(t *testing.T) { | ||
|
||
expected := optional.EmptyInt32() | ||
|
||
resource := createTestResourceForBuildField() | ||
data := map[string]interface{}{} | ||
|
||
d := schema.TestResourceDataRaw(t, resource.Schema, data) | ||
|
||
assert.Equal(t, expected, BuildFieldInt32(d, "field_int")) | ||
} | ||
|
||
func createTestResourceForBuildField() *schema.Resource { | ||
return &schema.Resource{ | ||
Schema: map[string]*schema.Schema{ | ||
"field_int": { | ||
Type: schema.TypeInt, | ||
}, | ||
}, | ||
} | ||
} |
Oops, something went wrong.