-
Notifications
You must be signed in to change notification settings - Fork 123
Add api key option #130
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
Add api key option #130
Conversation
|
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
|
💚 CLA has been signed |
|
Great work @bengesoff this is literally what my organization had need of. @tobio could you please look into this? |
|
jenkins test this |
tobio
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, it's incredibly useful!
@bengesoff can you add a changelog entry for this PR as well.
Because I only think of the changelog .5s after hitting the approve button.
|
@tobio thanks for taking a look! I have updated the changelog - does it look ok? |
|
jenkins test this |
|
@tobio looks like the tests were ok - is there anything else I need to do? 🙂 |
Nope, this is great thanks! |
The https://pkg.go.dev/github.com/elastic/go-elasticsearch/v8 client supports both username/password auth, as well as API Key. However the Terraform provider currently only supports username/password. I've made a quick change to allow the API Key to be specified instead. It is mainly just a schema change, and then the API client config needs to use the value from the provider schema.
I've tested this with one of my local projects, and it successfully created the user and role resources using only the API Key. Also the acceptance tests pass:
Fixes #71