Only try AWS instance profile creds if needed
What does this MR do?
Only tries instance profile authentication for Elasticsearch on AWS when the static creds failed. Aws::InstanceProfileCredentials.new
performs an API call which may be rate limited, and will also contribute to the overall rate limit being hit.
Are there points in the code the reviewer needs to double check?
It's not the prettiest, but I think it's clear.
Why was this MR needed?
It's a small improvement. The bigger one is in https://gitlab.com/gitlab-org/gitlab-ee/issues/4334.
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Tests added for this feature/bug - Review
-
Has been reviewed by Backend
-
Edited by Nick Thomas