Skip to content

Commit

Permalink
Merge branch 'main' into PL-38498
Browse files Browse the repository at this point in the history
  • Loading branch information
adiyaar24 committed May 5, 2023
2 parents 0419855 + 3176794 commit 42be622
Show file tree
Hide file tree
Showing 24 changed files with 1,065 additions and 22 deletions.
3 changes: 3 additions & 0 deletions .changelog/492.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/harness_platform_triggers: added documentation links
```
3 changes: 3 additions & 0 deletions .changelog/522.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
data-source/platform_manual_freeze - Added quarterly recurrence support for manual deployment freeze resource in Harness terraform provider
```
3 changes: 3 additions & 0 deletions .changelog/523.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
platform_connector_tas - Added tas connector resource in Harness terraform provider
```
61 changes: 61 additions & 0 deletions docs/data-sources/platform_connector_tas.md
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_platform_connector_tas Data Source - terraform-provider-harness"
subcategory: "Next Gen"
description: |-
Datasource for looking up an Tas Connector.
---

# harness_platform_connector_tas (Data Source)

Datasource for looking up an Tas Connector.

## Example Usage

```terraform
data "harness_platform_connector_tas" "example" {
identifier = "identifier"
}
```

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

### Required

- `identifier` (String) Unique identifier of the resource.

### Optional

- `name` (String) Name of the resource.
- `org_id` (String) Unique identifier of the organization.
- `project_id` (String) Unique identifier of the project.

### Read-Only

- `credentials` (List of Object) Contains Tas connector credentials. (see [below for nested schema](#nestedatt--credentials))
- `delegate_selectors` (Set of String) Tags to filter delegates for connection.
- `description` (String) Description of the resource.
- `execute_on_delegate` (Boolean) Execute on delegate or not.
- `id` (String) The ID of this resource.
- `tags` (Set of String) Tags to associate with the resource.

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

Read-Only:

- `tas_manual_details` (List of Object) (see [below for nested schema](#nestedobjatt--credentials--tas_manual_details))
- `type` (String)

<a id="nestedobjatt--credentials--tas_manual_details"></a>
### Nested Schema for `credentials.tas_manual_details`

Read-Only:

- `endpoint_url` (String)
- `password_ref` (String)
- `username` (String)
- `username_ref` (String)


2 changes: 1 addition & 1 deletion docs/data-sources/platform_infrastructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ data "harness_platform_infrastructure" "example" {
- `description` (String) Description of the resource.
- `id` (String) The ID of this resource.
- `tags` (Set of String) Tags to associate with the resource.
- `type` (String) Type of Infrastructure. Valid values are KubernetesDirect, KubernetesGcp, ServerlessAwsLambda, Pdc, KubernetesAzure, SshWinRmAzure, SshWinRmAws, AzureWebApp, ECS, GitOps, CustomDeployment.
- `type` (String) Type of Infrastructure. Valid values are KubernetesDirect, KubernetesGcp, ServerlessAwsLambda, Pdc, KubernetesAzure, SshWinRmAzure, SshWinRmAws, AzureWebApp, ECS, GitOps, CustomDeployment, TAS.
- `yaml` (String) Infrastructure YAML


17 changes: 9 additions & 8 deletions docs/data-sources/platform_manual_freeze.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,34 +52,35 @@ data "harness_platform_manual_freeze" "example" {

Read-Only:

- `end_time` (Number)
- `start_time` (Number)
- `end_time` (Number) End time of the freeze
- `start_time` (Number) Start time of the freeze


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

Read-Only:

- `duration` (String)
- `end_time` (String)
- `duration` (String) Duration of the freeze
- `end_time` (String) End time of the freeze
- `recurrence` (List of Object) (see [below for nested schema](#nestedobjatt--freeze_windows--recurrence))
- `start_time` (String)
- `time_zone` (String)
- `start_time` (String) Start time of the freeze
- `time_zone` (String) Timezone

<a id="nestedobjatt--freeze_windows--recurrence"></a>
### Nested Schema for `freeze_windows.recurrence`

Read-Only:

- `recurrence_spec` (List of Object) (see [below for nested schema](#nestedobjatt--freeze_windows--recurrence--recurrence_spec))
- `type` (String)
- `type` (String) Recurrence type(Daily, Weekly, Monthly, Yearly)

<a id="nestedobjatt--freeze_windows--recurrence--recurrence_spec"></a>
### Nested Schema for `freeze_windows.recurrence.recurrence_spec`

Read-Only:

- `until` (String)
- `until` (String) Recurrence until timestamp
- `value` (Number) Value of n, for n months recurrence


110 changes: 110 additions & 0 deletions docs/resources/platform_connector_tas.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "harness_platform_connector_tas Resource - terraform-provider-harness"
subcategory: "Next Gen"
description: |-
Resource for creating an Tas in Harness.
---

# harness_platform_connector_tas (Resource)

Resource for creating an Tas in Harness.

## Example Usage

```terraform
# Create Tas connector using username as plain text and password ref
resource "harness_platform_connector_tas" "tas" {
identifier = "example_tas_cloud_provider"
name = "Example tas cloud provider"
description = "description of tas connector"
tags = ["foo:bar"]
credentials {
type = "ManualConfig"
tas_manual_details {
endpoint_url = "https://tas.example.com"
username = "admin"
password_ref = "account.secret_id"
}
}
}
# Create Tas connector using username ref and password ref, and execute on delegate
resource "harness_platform_connector_tas" "tas" {
identifier = "example_tas_cloud_provider"
name = "Example tas cloud provider"
description = "description of tas connector"
tags = ["foo:bar"]
credentials {
type = "ManualConfig"
tas_manual_details {
endpoint_url = "https://tas.example.com"
username_ref = "account.username_id"
password_ref = "account.secret_id"
}
}
delegate_selectors = ["harness-delegate"]
execute_on_delegate = true
}
```

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

### Required

- `credentials` (Block List, Min: 1, Max: 1) Contains Tas connector credentials. (see [below for nested schema](#nestedblock--credentials))
- `identifier` (String) Unique identifier of the resource.
- `name` (String) Name of the resource.

### Optional

- `delegate_selectors` (Set of String) Tags to filter delegates for connection.
- `description` (String) Description of the resource.
- `execute_on_delegate` (Boolean) Execute on delegate or not.
- `org_id` (String) Unique identifier of the organization.
- `project_id` (String) Unique identifier of the project.
- `tags` (Set of String) Tags to associate with the resource.

### Read-Only

- `id` (String) The ID of this resource.

<a id="nestedblock--credentials"></a>
### Nested Schema for `credentials`

Required:

- `tas_manual_details` (Block List, Min: 1, Max: 1) Authenticate to Tas using manual details. (see [below for nested schema](#nestedblock--credentials--tas_manual_details))
- `type` (String) Type can be ManualConfig.

<a id="nestedblock--credentials--tas_manual_details"></a>
### Nested Schema for `credentials.tas_manual_details`

Required:

- `endpoint_url` (String) URL of the Tas server.
- `password_ref` (String) Reference of the secret for the password. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.

Optional:

- `username` (String) Username to use for authentication.
- `username_ref` (String) Reference to a secret containing the username to use for authentication. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.

## Import

Import is supported using the following syntax:

```shell
# Import account level tas connector
terraform import harness_platform_connector_tas.example <connector_id>

# Import organization level tas connector
terraform import harness_platform_connector_tas.example <organization_id>/<connector_id>

# Import project level tas connector
terraform import harness_platform_connector_tas.example <organization_id>/<project_id>/<connector_id>
```
2 changes: 1 addition & 1 deletion docs/resources/platform_infrastructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ resource "harness_platform_infrastructure" "example" {
- `env_id` (String) Environment Identifier.
- `identifier` (String) Unique identifier of the resource.
- `name` (String) Name of the resource.
- `type` (String) Type of Infrastructure. Valid values are KubernetesDirect, KubernetesGcp, ServerlessAwsLambda, Pdc, KubernetesAzure, SshWinRmAzure, SshWinRmAws, AzureWebApp, ECS, GitOps, CustomDeployment.
- `type` (String) Type of Infrastructure. Valid values are KubernetesDirect, KubernetesGcp, ServerlessAwsLambda, Pdc, KubernetesAzure, SshWinRmAzure, SshWinRmAws, AzureWebApp, ECS, GitOps, CustomDeployment, TAS.
- `yaml` (String) Infrastructure YAML. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.

### Optional
Expand Down
17 changes: 9 additions & 8 deletions docs/resources/platform_manual_freeze.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,35 +78,36 @@ resource "harness_platform_manual_freeze" "example" {

Read-Only:

- `end_time` (Number)
- `start_time` (Number)
- `end_time` (Number) End time of the freeze
- `start_time` (Number) Start time of the freeze


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

Read-Only:

- `duration` (String)
- `end_time` (String)
- `duration` (String) Duration of the freeze
- `end_time` (String) End time of the freeze
- `recurrence` (List of Object) (see [below for nested schema](#nestedobjatt--freeze_windows--recurrence))
- `start_time` (String)
- `time_zone` (String)
- `start_time` (String) Start time of the freeze
- `time_zone` (String) Timezone

<a id="nestedobjatt--freeze_windows--recurrence"></a>
### Nested Schema for `freeze_windows.recurrence`

Read-Only:

- `recurrence_spec` (List of Object) (see [below for nested schema](#nestedobjatt--freeze_windows--recurrence--recurrence_spec))
- `type` (String)
- `type` (String) Recurrence type(Daily, Weekly, Monthly, Yearly)

<a id="nestedobjatt--freeze_windows--recurrence--recurrence_spec"></a>
### Nested Schema for `freeze_windows.recurrence.recurrence_spec`

Read-Only:

- `until` (String)
- `until` (String) Recurrence until timestamp
- `value` (Number) Value of n, for n months recurrence

## Import

Expand Down
5 changes: 5 additions & 0 deletions docs/resources/platform_triggers.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ description: |-

Resource for creating triggers in Harness.

References:
- For details on how to onboard with Terraform, please see [Harness Terraform Provider Overview](https://developer.harness.io/docs/platform/terraform/harness-terraform-provider-overview/)
- To understand how to use the Triggers, please see [Documentation](https://developer.harness.io/docs/category/triggers)
- To get more information about Api, please see [API documentation](https://apidocs.harness.io/tag/Triggers)

## Example Usage

```terraform
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "harness_platform_connector_tas" "example" {
identifier = "identifier"
}
8 changes: 8 additions & 0 deletions examples/resources/harness_platform_connector_tas/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Import account level tas connector
terraform import harness_platform_connector_tas.example <connector_id>

# Import organization level tas connector
terraform import harness_platform_connector_tas.example <organization_id>/<connector_id>

# Import project level tas connector
terraform import harness_platform_connector_tas.example <organization_id>/<project_id>/<connector_id>
36 changes: 36 additions & 0 deletions examples/resources/harness_platform_connector_tas/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Create Tas connector using username as plain text and password ref

resource "harness_platform_connector_tas" "tas" {
identifier = "example_tas_cloud_provider"
name = "Example tas cloud provider"
description = "description of tas connector"
tags = ["foo:bar"]
credentials {
type = "ManualConfig"
tas_manual_details {
endpoint_url = "https://tas.example.com"
username = "admin"
password_ref = "account.secret_id"
}
}
}


# Create Tas connector using username ref and password ref, and execute on delegate

resource "harness_platform_connector_tas" "tas" {
identifier = "example_tas_cloud_provider"
name = "Example tas cloud provider"
description = "description of tas connector"
tags = ["foo:bar"]
credentials {
type = "ManualConfig"
tas_manual_details {
endpoint_url = "https://tas.example.com"
username_ref = "account.username_id"
password_ref = "account.secret_id"
}
}
delegate_selectors = ["harness-delegate"]
execute_on_delegate = true
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.18
require (
github.com/antihax/optional v1.0.0
github.com/docker/docker v20.10.22+incompatible
github.com/harness/harness-go-sdk v0.3.24
github.com/harness/harness-go-sdk v0.3.25
github.com/harness/harness-openapi-go-client v0.0.17
github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1
github.com/pkg/errors v0.9.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/harness/harness-go-sdk v0.3.24 h1:zTsTGoT/ton60QuVqFolKa6dJPgJV6KaZJjzcpW7zcI=
github.com/harness/harness-go-sdk v0.3.24/go.mod h1:CPXydorp4zd5Dz2u2FXiHyWL4yd5PQafOMN69cgPSvk=
github.com/harness/harness-go-sdk v0.3.25 h1:mvNlTDAHhHQqbSsvB7L4qkJE+NUY7P982jhqWKPZfi8=
github.com/harness/harness-go-sdk v0.3.25/go.mod h1:CPXydorp4zd5Dz2u2FXiHyWL4yd5PQafOMN69cgPSvk=
github.com/harness/harness-openapi-go-client v0.0.17 h1:EZneIyi6sV+dlTgXbawxdVD0OoDmG3mnGHEJbwslRzc=
github.com/harness/harness-openapi-go-client v0.0.17/go.mod h1:u0vqYb994BJGotmEwJevF4L3BNAdU9i8ui2d22gmLPA=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
Expand Down
2 changes: 2 additions & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ func Provider(version string) func() *schema.Provider {
"harness_user": user.DataSourceUser(),
"harness_yaml_config": yamlconfig.DataSourceYamlConfig(),
"harness_platform_connector_azure_cloud_provider": connector.DataSourceConnectorAzureCloudProvider(),
"harness_platform_connector_tas": connector.DataSourceConnectorTas(),
"harness_trigger": cd_trigger.DataSourceTrigger(),
"harness_platform_policy": policy.DataSourcePolicy(),
"harness_platform_policyset": policyset.DataSourcePolicyset(),
Expand Down Expand Up @@ -315,6 +316,7 @@ func Provider(version string) func() *schema.Provider {
"harness_user": user.ResourceUser(),
"harness_yaml_config": yamlconfig.ResourceYamlConfig(),
"harness_platform_connector_azure_cloud_provider": connector.ResourceConnectorAzureCloudProvider(),
"harness_platform_connector_tas": connector.ResourceConnectorTas(),
"harness_platform_policy": policy.ResourcePolicy(),
"harness_platform_policyset": policyset.ResourcePolicyset(),
"harness_platform_manual_freeze": manual_freeze.ResourceManualFreeze(),
Expand Down
Loading

0 comments on commit 42be622

Please sign in to comment.