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

Improve documentation for HTTP basic authentication #114

Merged
merged 2 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Copy link
Contributor Author

@Sovietaced Sovietaced Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am confused as to why someone had documented this as optional, considering the variable looks like it is 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
Loading