terraform-provider-opensearch icon indicating copy to clipboard operation
terraform-provider-opensearch copied to clipboard

[BUG] HTTP 403 when basic authentication is configured

Open Sovietaced opened this issue 1 year ago • 1 comments

What is the bug?

If you configure the provider to use basic authentication you will receive HTTP 403s unless you explicitly disable sign_aws_requests. The error message is quite confusing since the credentials are correct.

│ Error: HTTP 403 Forbidden: Permission denied. Please ensure that the correct credentials are being used to access the cluster.

How can one reproduce the bug?

provider "opensearch" {
  url               = "..."
  username          = "..."
  password          = "..."
  healthcheck       = false
  # sign_aws_requests = false
}

What is the expected behavior?

The provider should work by just specify a username and password for HTTP basic auth.

I'm thinking about filing a pull request which just uses a normal HTTP client when basic auth is configured.

Sovietaced avatar Oct 27 '23 02:10 Sovietaced

[Untriage] Thanks @Sovietaced, a document PR went in https://github.com/opensearch-project/terraform-provider-opensearch/pull/114 and an open PR https://github.com/opensearch-project/terraform-provider-opensearch/pull/117 to auto disable sign_aws_requests when using basic auth, pending adding some unit tests and review. Thank you Adding @bbarani @rblcoder

prudhvigodithi avatar Nov 05 '23 18:11 prudhvigodithi