Elasticsearch AWS support not using role credentials when applicable
Summary
In lib/gitlab/elastic/client.rb it assumes access keys are always present. There needs to be a condition that if access keys are nil then use Aws::InstanceProfileCredentials in place of Aws:Credentials
Steps to reproduce
Set role on ec2 instance running gitlab that has permissions to access the ES domain
What is the current bug behavior?
Role credentials are not used
What is the expected correct behavior?
If access and secret keys are empty in admin page for elasticsearch and aws support for aws is selected it should attempt to retrieve credentials from instance profile.
Possible fixes
In lib/gitlab/elastic/client.rb it assumes access keys are always present. There needs to be a condition that if access keys are nil then use Aws::InstanceProfileCredentials in place of Aws:Credentials
Relates to: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1251 (Profile support is broken in original MR as well as final) :(