-
Notifications
You must be signed in to change notification settings - Fork 60
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
[BUG] Cannot authenticate against AWS OpenSearch Service domain using Basic Authentication #102
Comments
Yeah, I was getting a similar experience... @stagha - take a look at this GitHub issue. Although it's specific to Elasticsearch, it seems to have solved my issue. Testing locally, I was able to create a test user (a very basic task) within my OpenSearch domain (which has SAML enabled). provider "opensearch" {
url = "<INSERT_CUSTOM_DOMAIN_URL>"
sign_aws_requests = false
username = "REDACTED"
password = "REDACTED"
} I'll need to play around with this a little more. Ideally, I can just use an IAM role and/or my current AWS context. A repository secret to be passed in could be acceptable for the time being. So far, I haven't been able to get |
[Triage] @prudhvigodithi. |
Hey @jmurillo9 thanks, are you open to contribute with a fix for this bug? |
Hey @stagha for the AWS OpenSearch did you try with access policy Adding @bbarani @rishabh6788 |
@prudhvigodithi yes that option is checked. Note again that I was able to make requests from the cluster endpoint using curl and the master username/password. |
I encountered 403s when I had issues with request signing. If the credentials are wrong the provider just blows up. So maybe there is an issue when you have username/password sourced from environment variables and the request signing sourced from the provider config? Would be worth just trying to configure everything in the provider inline given that you validated that curl works. |
That is part of the problem. When I try to configure everything on the provider, I get errors as if the settings are completely missing. E.g. I get "URL missing" errors even if I have Perhaps this is the root of the problem? Perhaps |
The following configuration is working for AWS OpenSearch v2.9
|
I am getting 403s with AWS auth and basic auth. I have mapped my basic auth user and IAM role to all_access role. I can see it's authorisation not authentication because if I change the password I get 401 instead |
@joewragg Please share your terraform version, terraform provider version along with complete terraform code including provider configuration. |
terraform version: 1.5.6 code (redacted)
I have also tested locally with curl basic auth creds and get 200 OK |
@joewragg
|
I have tested these settings and versions and get the same error I wonder if it is related to these settings in AWS? : |
What is the bug?
Provider is unable to authenticate against OpenSearch endpoint.
How can one reproduce the bug?
I am using an AWS OpenSearch Service endpoint. Fine-grained access control is enabled using an internal database. I have confirmed that I can make requests to the endpoint directly using Postman using Basic Auth with the same credentials.
I have set the following environment as follows (I am running on Windows.) For some reason, setting the corresponding parameters directly on the provider definition in Terraform has no effect.
Here is my provider:
Here are my resource configurations:
Other details that may or may not be relevant:
.aws/credentials
file in my user's home directory, but I would expect this provider to ignore it based on the value ofsign_aws_requests
above.aws
provider to create other resources. But that shouldn't have any bearing here.This is the output of
terraform apply
:What is the expected behavior?
Terraform should successfully create my OpenSearch resources.
What is your host/environment?
The text was updated successfully, but these errors were encountered: