Skip to content

Commit

Permalink
Improve documentation for HTTP basic authentication (#114)
Browse files Browse the repository at this point in the history
* Update template

Signed-off-by: Jason Parraga <[email protected]>

* Generate docs using tfplugindocs

Signed-off-by: Jason Parraga <[email protected]>

---------

Signed-off-by: Jason Parraga <[email protected]>
  • Loading branch information
Sovietaced authored Nov 2, 2023
1 parent e7a05c4 commit 4de3492
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 15 deletions.
2 changes: 0 additions & 2 deletions docs/data-sources/host.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,3 @@ data "opensearch_host" "test" {

- `id` (String) The ID of this resource.
- `url` (String) the url of the active cluster


25 changes: 23 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ EOF
<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `url` (String) Opensearch URL

### Optional

- `aws_access_key` (String) The access key for use with AWS opensearch Service domains
Expand All @@ -78,7 +82,6 @@ EOF
- `sniff` (Boolean) Set the node sniffing option for the opensearch client. Client won't work with sniffing if nodes are not routable.
- `token` (String) A bearer token or ApiKey for an Authorization header, e.g. Active Directory API key.
- `token_name` (String) The type of token, usually ApiKey or Bearer
- `url` (String) Opensearch URL
- `username` (String) Username to use to connect to opensearch using basic auth
- `version_ping_timeout` (Number) Version ping timeout in seconds

Expand All @@ -97,7 +100,9 @@ If a [custom domain](https://docs.aws.amazon.com/opensearch-service/latest/devel

#### Static credentials

Static credentials can be provided by adding an `aws_access_key` and `aws_secret_key` in-line in the provider block. If applicable, you may also specify a `aws_token` value.
##### IAM user management

If your AWS OpenSearch domain uses IAM user management, static credentials can be provided by adding an `aws_access_key` and `aws_secret_key` in-line in the provider block. If applicable, you may also specify a `aws_token` value.

Example usage:

Expand All @@ -110,6 +115,22 @@ provider "opensearch" {
}
```

##### HTTP basic auth

If your AWS OpenSearch domain uses an internal user database, static credentials can be provided by adding a `username` and `password` in-line in the provider block. Note: You will need to explicitly disabled request signing.

Example usage:

```tf
provider "opensearch" {
url = "https://search-foo-bar-pqrhr4w3u4dzervg41frow4mmy.us-east-1.es.amazonaws.com"
username = "ausername"
password = "apassword"
# Must be disabled for basic auth
sign_aws_requests = false
}
```

#### Assume role configuration

You can instruct the provider to assume a role in AWS before interacting with the cluster by setting the `aws_assume_role_arn` variable.
Expand Down
2 changes: 0 additions & 2 deletions docs/resources/anomaly_detection.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,3 @@ EOF
### Read-Only

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


2 changes: 0 additions & 2 deletions docs/resources/channel_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,3 @@ Provides an OpenSearch channel configuration. Please refer to the OpenSearch cha
### Read-Only

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


2 changes: 0 additions & 2 deletions docs/resources/cluster_settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,3 @@ resource "opensearch_cluster_settings" "global" {
### Read-Only

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


2 changes: 0 additions & 2 deletions docs/resources/dashboard_object.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,3 @@ EOF
### Read-Only

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


2 changes: 0 additions & 2 deletions docs/resources/data_stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,3 @@ resource "opensearch_data_stream" "foo" {
### Read-Only

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


20 changes: 19 additions & 1 deletion templates/index.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ If a [custom domain](https://docs.aws.amazon.com/opensearch-service/latest/devel

#### Static credentials

Static credentials can be provided by adding an `aws_access_key` and `aws_secret_key` in-line in the provider block. If applicable, you may also specify a `aws_token` value.
##### IAM user management

If your AWS OpenSearch domain uses IAM user management, static credentials can be provided by adding an `aws_access_key` and `aws_secret_key` in-line in the provider block. If applicable, you may also specify a `aws_token` value.

Example usage:

Expand All @@ -49,6 +51,22 @@ provider "opensearch" {
}
```

##### HTTP basic auth

If your AWS OpenSearch domain uses an internal user database, static credentials can be provided by adding a `username` and `password` in-line in the provider block. Note: You will need to explicitly disabled request signing.

Example usage:

```tf
provider "opensearch" {
url = "https://search-foo-bar-pqrhr4w3u4dzervg41frow4mmy.us-east-1.es.amazonaws.com"
username = "ausername"
password = "apassword"
# Must be disabled for basic auth
sign_aws_requests = false
}
```

#### Assume role configuration

You can instruct the provider to assume a role in AWS before interacting with the cluster by setting the `aws_assume_role_arn` variable.
Expand Down

0 comments on commit 4de3492

Please sign in to comment.