opensearch-project / terraform-provider-opensearch

https://registry.terraform.io/providers/opensearch-project/opensearch
Apache License 2.0
73 stars 56 forks source link

[BUG] HTTP 403 when basic authentication is configured #116

Open Sovietaced opened 10 months ago

Sovietaced commented 10 months ago

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.

prudhvigodithi commented 9 months ago

[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