Skip to content
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

Improvement/add regions option support #59

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

aoutfast
Copy link

@aoutfast aoutfast commented Oct 6, 2021

Description

This PR adresses the issue with aws4 package usage, when it tries to get the AWS Region from the hostname.

Use Case

When the AWS Elasticsearch domain is under a custom domain the signature won't be valid. If the node is hosted in another region than us-east-1

eg.

  • Expected domain Resulting Signature Valid ✅
    https://xxxx.<region>.es.amazonaws.com

  • Aliased Domain Resulting Signature Invalid ❌
    https://search.mydomain.com

Snippet responsible for the region in aws4

this.region = request.region || hostParts[1] || 'us-east-1'

Resolution

Adding signOpt as an optional param to generateAWSConnectionClass

declare type SignOpt = {
  service: 'es';
  region?: string;
}

function generateAWSConnectionClass(credentials: Credentials, signOpts?: SignOpt)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants