Skip to content

Commit

Permalink
[Backport 1.x] Scope discovery-ec2 IMDS lookups to this cluster forma…
Browse files Browse the repository at this point in the history
…tion. (#70)

Signed-off-by: dblock <dblock@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 926bfcb commit 62d9df5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/infra/infra-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,10 @@ export class InfraStack extends Stack {
const baseConfig: any = load(readFileSync(`${configFileDir}/multi-node-base-config.yml`, 'utf-8'));

baseConfig['cluster.name'] = `${scope.stackName}-${scope.account}-${scope.region}`;

// use discovery-ec2 to find manager nodes by querying IMDS
baseConfig['discovery.ec2.tag.Name'] = `${scope.stackName}/seedNodeAsg,${scope.stackName}/managerNodeAsg`;

const commonConfig = dump(baseConfig).toString();
cfnInitConfig.push(InitCommand.shellCommand(`set -ex;cd opensearch; echo "${commonConfig}" > config/opensearch.yml`,
{
Expand Down
1 change: 0 additions & 1 deletion lib/opensearch-config/multi-node-base-config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
cluster.name: "opensearch"
cluster.initial_master_nodes: ["seed"]
discovery.seed_providers: ec2
discovery.ec2.tag.role: manager
network.host: 0.0.0.0

0 comments on commit 62d9df5

Please sign in to comment.