Skip to content

Commit

Permalink
Scope discovery-ec2 IMDS lookups to this cluster formation. (#36)
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <dblock@amazon.com>
  • Loading branch information
dblock authored Jun 8, 2023
1 parent fce3055 commit 7e7d6cf
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_cluster_manager_nodes: ["seed"]
discovery.seed_providers: ec2
discovery.ec2.tag.role: manager
network.host: 0.0.0.0

0 comments on commit 7e7d6cf

Please sign in to comment.