Skip to content

Improvement/add regions option support#59

Open
aoutfast wants to merge 3 commits intomergermarket:masterfrom
aoutfast:improvement/add-regions-option-support
Open

Improvement/add regions option support#59
aoutfast wants to merge 3 commits intomergermarket:masterfrom
aoutfast:improvement/add-regions-option-support

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