Skip to content

Commit

Permalink
feat: [OIP-880]: updated custom healthsource for grafana loki (#677)
Browse files Browse the repository at this point in the history
* feat: [OIP-880]: updated custom healthsource for graphana loki

* feat: [OIP-880]: updated category tags.

* feat: [OIP-880]: updated change log and dependency
  • Loading branch information
n00bitax committed Sep 8, 2023
1 parent 20bb7e1 commit ee88e34
Show file tree
Hide file tree
Showing 12 changed files with 721 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .changelog/677.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
```release-note:enhancement
platform_connector_customhealthsource.md Added documentation for custom health connector
resource.tf Example of loki health source with custom health source connector added
provider.go : Added new data source harness_platform_connector_customhealthsource
custom_health_data_source.go Schema and CRUD of custom health source connector
custom_health_data_source_test.go Test for Schema and CRUD of custom health source connector
customhealthsource.go Schema and CRUD of custom health source connector
customhealthsource_test.go Test for Schema and CRUD of custom health source connector
```
60 changes: 60 additions & 0 deletions docs/data-sources/platform_connector_customhealthsource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "harness_platform_connector_customhealthsource Data Source - terraform-provider-harness"
subcategory: "Next Gen"
description: |-
Datasource for looking up a Custom Health source connector.
---

# harness_platform_connector_customhealthsource (Data Source)

Datasource for looking up a Custom Health source connector.



<!-- 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

- `delegate_selectors` (Set of String) Tags to filter delegates for connection.
- `description` (String) Description of the resource.
- `headers` (Set of Object) Headers. (see [below for nested schema](#nestedatt--headers))
- `id` (String) The ID of this resource.
- `method` (String) HTTP Verb Method for the API Call
- `params` (Set of Object) Parameters. (see [below for nested schema](#nestedatt--params))
- `tags` (Set of String) Tags to associate with the resource.
- `url` (String) URL of the Custom Health source server.
- `validation_body` (String) Body to be sent with the API Call
- `validation_path` (String) Path to be added to the base URL for the API Call

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

Read-Only:

- `encrypted_value_ref` (String)
- `key` (String)
- `value` (String)
- `value_encrypted` (Boolean)


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

Read-Only:

- `encrypted_value_ref` (String)
- `key` (String)
- `value` (String)
- `value_encrypted` (Boolean)
102 changes: 102 additions & 0 deletions docs/resources/platform_connector_customhealthsource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "harness_platform_connector_customhealthsource Resource - terraform-provider-harness"
subcategory: "Next Gen"
description: |-
Resource for creating a Custom Health source connector.
---

# harness_platform_connector_customhealthsource (Resource)

Resource for creating a Custom Health source connector.

## Example Usage

```terraform
# Authentication mechanism as username and password
resource "harness_platform_connector_customhealthsource" "test" {
identifier = "identifier"
name = "name"
description = "test"
tags = ["foo:bar"]
url = "https://prometheus.com/"
delegate_selectors = ["harness-delegate"]
method = "GET"
validation_path = "loki/api/v1/labels"
headers {
encrypted_value_ref = "account.doNotDeleteHSM"
value_encrypted = true
key = "key"
value = "value"
}
}
```

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

### Required

- `identifier` (String) Unique identifier of the resource.
- `method` (String) HTTP Verb Method for the API Call
- `name` (String) Name of the resource.
- `url` (String) URL of the Custom Healthsource controller.

### Optional

- `delegate_selectors` (Set of String) Tags to filter delegates for connection.
- `description` (String) Description of the resource.
- `headers` (Block Set) Headers. (see [below for nested schema](#nestedblock--headers))
- `org_id` (String) Unique identifier of the organization.
- `params` (Block Set) Parameters (see [below for nested schema](#nestedblock--params))
- `project_id` (String) Unique identifier of the project.
- `tags` (Set of String) Tags to associate with the resource.
- `validation_body` (String) Body to be sent with the API Call
- `validation_path` (String) Path to be added to the base URL for the API Call

### Read-Only

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

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

Required:

- `key` (String) Key.

Optional:

- `encrypted_value_ref` (String) Reference to the Harness secret containing the encrypted value. 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}.
- `value` (String) Value.
- `value_encrypted` (Boolean) Encrypted value.


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

Required:

- `key` (String) Key.

Optional:

- `encrypted_value_ref` (String) Reference to the Harness secret containing the encrypted value. 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}.
- `value` (String) Value.
- `value_encrypted` (Boolean) Encrypted value.

## Import

Import is supported using the following syntax:

```shell
# Import account level elasticsearch connector
terraform import harness_platform_connector_customhealthsource.example <connector_id>

# Import org level elasticsearch connector
terraform import harness_platform_connector_customhealthsource.example <ord_id>/<connector_id>

# Import project level elasticsearch connector
terraform import harness_platform_connector_customhealthsource.example <org_id>/<project_id>/<connector_id>
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Import account level elasticsearch connector
terraform import harness_platform_connector_customhealthsource.example <connector_id>

# Import org level elasticsearch connector
terraform import harness_platform_connector_customhealthsource.example <ord_id>/<connector_id>

# Import project level elasticsearch connector
terraform import harness_platform_connector_customhealthsource.example <org_id>/<project_id>/<connector_id>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Authentication mechanism as username and password
resource "harness_platform_connector_customhealthsource" "test" {
identifier = "identifier"
name = "name"
description = "test"
tags = ["foo:bar"]

url = "https://prometheus.com/"
delegate_selectors = ["harness-delegate"]
method = "GET"
validation_path = "loki/api/v1/labels"
headers {
encrypted_value_ref = "account.doNotDeleteHSM"
value_encrypted = true
key = "key"
value = "value"
}
}
17 changes: 16 additions & 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 v24.0.5+incompatible
github.com/harness/harness-go-sdk v0.3.48
github.com/harness/harness-go-sdk v0.3.49
github.com/harness/harness-openapi-go-client v0.0.18
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/go-retryablehttp v0.7.4
Expand All @@ -17,10 +17,15 @@ require (

require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
Expand All @@ -30,6 +35,7 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
Expand All @@ -43,16 +49,20 @@ require (
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.18.1 // indirect
github.com/hashicorp/terraform-json v0.17.1 // indirect
github.com/hashicorp/terraform-plugin-docs v0.16.0 // indirect
github.com/hashicorp/terraform-plugin-go v0.18.0 // indirect
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
github.com/hashicorp/terraform-registry-address v0.2.2 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/jhump/protoreflect v1.6.1 // indirect
github.com/jinzhu/copier v0.4.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mitchellh/cli v1.1.5 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
Expand All @@ -62,12 +72,17 @@ require (
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc4 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/russross/blackfriday v1.6.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/t-tomalak/logrus-easy-formatter v0.0.0-20190827215021-c074f06c5816 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/zclconf/go-cty v1.13.2 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/oauth2 v0.11.0 // indirect
Expand Down
Loading

0 comments on commit ee88e34

Please sign in to comment.