Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for http observability on vault_cluster resource #660

Merged
merged 24 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
37baf59
Added fields and validation for
jaireddjawed Oct 30, 2023
43619f5
Added tests for http observability
jaireddjawed Oct 30, 2023
01b6283
Noted http observability provider
jaireddjawed Oct 30, 2023
d62f5b4
Ran go generate
jaireddjawed Oct 30, 2023
41460bd
Merge branch 'main' into jaireddjawed-hcpv-http
jaireddjawed Oct 30, 2023
b0a09af
Merge branch 'main' into jaireddjawed-hcpv-http
jaireddjawed Nov 1, 2023
9de6e27
renamed missingParamsError
jaireddjawed Nov 2, 2023
026ac0c
updated http_bearer_token, http_basic_user, and http_basic_password t…
jaireddjawed Nov 2, 2023
bad8ace
Specified allowed values for http_codec
jaireddjawed Nov 2, 2023
fd25524
validate that http_codec
jaireddjawed Nov 2, 2023
bd1b490
validated httpMethod so ensure
jaireddjawed Nov 2, 2023
439a809
added strings.toUpper for httpMethod and httpCodec
jaireddjawed Nov 2, 2023
b97bbc3
Merge branch 'main' into jaireddjawed-hcpv-http
jaireddjawed Nov 2, 2023
3fd4d79
Merge branch 'jaireddjawed-hcpv-http' of github.com:hashicorp/terrafo…
jaireddjawed Nov 2, 2023
f5c4771
updated http_basic_user
jaireddjawed Nov 2, 2023
230d250
separated http validation into separate function
jaireddjawed Nov 2, 2023
b73f1b3
added comment to validateHTTPAuth
jaireddjawed Nov 2, 2023
4fd2cf7
changed validateHttpAuth to validateHTTPAuth
jaireddjawed Nov 2, 2023
9103005
return httpConfigError last in validateHttpAuth
jaireddjawed Nov 6, 2023
071d2ee
Merge branch 'main' into jaireddjawed-hcpv-http
jaireddjawed Nov 7, 2023
4927342
renamed missingParamError to invalidProviderConfigError
jaireddjawed Nov 7, 2023
143659a
Ran 'go generate'
jaireddjawed Nov 7, 2023
4538814
removed httpConfigError from
jaireddjawed Nov 7, 2023
6fadcac
Made sure that httpBasicAuth is
jaireddjawed Nov 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/660.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
Add custom http endpoints as an observability provider for streaming audit logs and metrics from HCP Vault clusters.
```
20 changes: 20 additions & 0 deletions docs/data-sources/vault_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ Read-Only:
- `elasticsearch_user` (String) ElasticSearch user for streaming audit logs
- `grafana_endpoint` (String) Grafana endpoint for streaming audit logs
- `grafana_user` (String) Grafana user for streaming audit logs
- `http_basic_password` (String) HTTP basic authentication password for streaming audit logs, one of the two available authentication methods, can be specified only if http_bearer_token is not provided
jaireddjawed marked this conversation as resolved.
Show resolved Hide resolved
- `http_basic_user` (String) HTTP basic authentication username for streaming audit logs, one of the two available authentication methods, can be specified only if http_bearer_token is not provided.
jaireddjawed marked this conversation as resolved.
Show resolved Hide resolved
- `http_bearer_token` (String) HTTP bearer authentication token for streaming audit logs, one of the two available authentication methods, can be specified only if http_basic_user and http_basic_password are not provided
- `http_codec` (String) HTTP codec for streaming audit logs, allowed values are JSON and NDJSON
- `http_compression` (Boolean) HTTP compression flag for streaming audit logs
- `http_headers` (Map of String) HTTP headers for streaming audit logs
- `http_method` (String) HTTP payload method for streaming audit logs, allowed values are PATCH, POST, or PUT
- `http_payload_prefix` (String) HTTP payload prefix for streaming audit logs
- `http_payload_suffix` (String) HTTP payload suffix for streaming audit logs
- `http_uri` (String) HTTP URI for streaming audit logs
- `splunk_hecendpoint` (String) Splunk endpoint for streaming audit logs


Expand Down Expand Up @@ -110,4 +120,14 @@ Read-Only:
- `elasticsearch_user` (String) ElasticSearch user for streaming metrics
- `grafana_endpoint` (String) Grafana endpoint for streaming metrics
- `grafana_user` (String) Grafana user for streaming metrics
- `http_basic_password` (String) HTTP basic authentication password for streaming metrics, one of the two available authentication methods, can be specified only if http_bearer_token is not provided
jaireddjawed marked this conversation as resolved.
Show resolved Hide resolved
- `http_basic_user` (String) HTTP basic authentication username for streaming metrics, one of the two available authentication methods, can be specified only if http_bearer_token is not provided.
- `http_bearer_token` (String) HTTP bearer authentication token for streaming metrics, one of the two available authentication methods, can be specified only if http_basic_user and http_basic_password are not provided
- `http_codec` (String) HTTP codec for streaming metrics, allowed values are JSON and NDJSON
- `http_compression` (Boolean) HTTP compression flag for streaming metrics
- `http_headers` (Map of String) HTTP headers for streaming metrics
- `http_method` (String) HTTP payload method for streaming metrics, allowed values are PATCH, POST, or PUT
- `http_payload_prefix` (String) HTTP payload prefix for streaming metrics
- `http_payload_suffix` (String) HTTP payload suffix for streaming metrics
- `http_uri` (String) HTTP URI for streaming metrics
- `splunk_hecendpoint` (String) Splunk endpoint for streaming metrics
20 changes: 20 additions & 0 deletions docs/resources/vault_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ Optional:
- `grafana_endpoint` (String) Grafana endpoint for streaming audit logs
- `grafana_password` (String, Sensitive) Grafana password for streaming audit logs
- `grafana_user` (String) Grafana user for streaming audit logs
- `http_basic_password` (String, Sensitive) HTTP basic authentication password for streaming audit logs, one of the two available authentication methods, can be specified only if http_bearer_token is not provided
jaireddjawed marked this conversation as resolved.
Show resolved Hide resolved
- `http_basic_user` (String) HTTP basic authentication username for streaming audit logs, one of the two available authentication methods, can be specified only if http_bearer_token is not provided.
- `http_bearer_token` (String, Sensitive) HTTP bearer authentication token for streaming audit logs, one of the two available authentication methods, can be specified only if http_basic_user and http_basic_password are not provided
- `http_codec` (String) HTTP codec for streaming audit logs, allowed values are JSON and NDJSON
- `http_compression` (Boolean) HTTP compression flag for streaming audit logs
- `http_headers` (Map of String) HTTP headers for streaming audit logs
- `http_method` (String) HTTP payload method for streaming audit logs, , allowed values are PATCH, POST, or PUT
- `http_payload_prefix` (String) HTTP payload prefix for streaming audit logs
- `http_payload_suffix` (String) HTTP payload suffix for streaming audit logs
- `http_uri` (String) HTTP URI for streaming audit logs
- `splunk_hecendpoint` (String) Splunk endpoint for streaming audit logs
- `splunk_token` (String, Sensitive) Splunk token for streaming audit logs

Expand Down Expand Up @@ -133,6 +143,16 @@ Optional:
- `grafana_endpoint` (String) Grafana endpoint for streaming metrics
- `grafana_password` (String, Sensitive) Grafana password for streaming metrics
- `grafana_user` (String) Grafana user for streaming metrics
- `http_basic_password` (String, Sensitive) HTTP basic authentication password for streaming metrics
jaireddjawed marked this conversation as resolved.
Show resolved Hide resolved
- `http_basic_user` (String) HTTP basic authentication username for streaming metrics
- `http_bearer_token` (String, Sensitive) HTTP bearer authentication token for streaming metrics, one of the two available authentication methods, can be specified only if http_basic_user and http_basic_password are not provided
- `http_codec` (String) HTTP codec for streaming metrics, allowed values are JSON and NDJSON
- `http_compression` (Boolean) HTTP compression flag for streaming metrics
- `http_headers` (Map of String) HTTP headers for streaming metrics
- `http_method` (String) HTTP payload method for streaming metrics, allowed values are PATCH, POST, or PUT
- `http_payload_prefix` (String) HTTP payload prefix for streaming metrics
- `http_payload_suffix` (String) HTTP payload suffix for streaming metrics
- `http_uri` (String) HTTP URI for streaming metrics
- `splunk_hecendpoint` (String) Splunk endpoint for streaming metrics
- `splunk_token` (String, Sensitive) Splunk token for streaming metrics

Expand Down
100 changes: 100 additions & 0 deletions internal/providersdkv2/data_source_vault_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,56 @@ If a project is not configured in the HCP Provider config block, the oldest proj
Type: schema.TypeString,
Computed: true,
},
"http_basic_user": {
Description: "HTTP basic authentication username for streaming metrics, one of the two available authentication methods, can be specified only if http_bearer_token is not provided.",
Type: schema.TypeString,
Computed: true,
},
"http_basic_password": {
Description: "HTTP basic authentication password for streaming metrics, one of the two available authentication methods, can be specified only if http_bearer_token is not provided",
Type: schema.TypeString,
Computed: true,
},
"http_bearer_token": {
Description: "HTTP bearer authentication token for streaming metrics, one of the two available authentication methods, can be specified only if http_basic_user and http_basic_password are not provided",
Type: schema.TypeString,
Computed: true,
},
"http_headers": {
Description: "HTTP headers for streaming metrics",
Type: schema.TypeMap,
Computed: true,
},
"http_codec": {
Description: "HTTP codec for streaming metrics, allowed values are JSON and NDJSON",
Type: schema.TypeString,
Computed: true,
},
"http_compression": {
Description: "HTTP compression flag for streaming metrics",
Type: schema.TypeBool,
Computed: true,
},
"http_method": {
Description: "HTTP payload method for streaming metrics, allowed values are PATCH, POST, or PUT",
Type: schema.TypeString,
Computed: true,
},
"http_payload_prefix": {
Description: "HTTP payload prefix for streaming metrics",
Type: schema.TypeString,
Computed: true,
},
"http_payload_suffix": {
Description: "HTTP payload suffix for streaming metrics",
Type: schema.TypeString,
Computed: true,
},
"http_uri": {
Description: "HTTP URI for streaming metrics",
Type: schema.TypeString,
Computed: true,
},
},
},
},
Expand Down Expand Up @@ -276,6 +326,56 @@ If a project is not configured in the HCP Provider config block, the oldest proj
Type: schema.TypeString,
Computed: true,
},
"http_basic_user": {
Description: "HTTP basic authentication username for streaming audit logs, one of the two available authentication methods, can be specified only if http_bearer_token is not provided.",
Type: schema.TypeString,
Computed: true,
},
"http_basic_password": {
Description: "HTTP basic authentication password for streaming audit logs, one of the two available authentication methods, can be specified only if http_bearer_token is not provided",
Type: schema.TypeString,
Computed: true,
},
"http_bearer_token": {
Description: "HTTP bearer authentication token for streaming audit logs, one of the two available authentication methods, can be specified only if http_basic_user and http_basic_password are not provided",
Type: schema.TypeString,
Computed: true,
},
"http_headers": {
Description: "HTTP headers for streaming audit logs",
Type: schema.TypeMap,
Computed: true,
},
"http_codec": {
Description: "HTTP codec for streaming audit logs, allowed values are JSON and NDJSON",
Type: schema.TypeString,
Computed: true,
},
"http_compression": {
Description: "HTTP compression flag for streaming audit logs",
Type: schema.TypeBool,
Computed: true,
},
"http_method": {
Description: "HTTP payload method for streaming audit logs, allowed values are PATCH, POST, or PUT",
Type: schema.TypeString,
Computed: true,
},
"http_payload_prefix": {
Description: "HTTP payload prefix for streaming audit logs",
Type: schema.TypeString,
Computed: true,
},
"http_payload_suffix": {
Description: "HTTP payload suffix for streaming audit logs",
Type: schema.TypeString,
Computed: true,
},
"http_uri": {
Description: "HTTP URI for streaming audit logs",
Type: schema.TypeString,
Computed: true,
},
},
},
},
Expand Down
Loading