Skip to content

Commit

Permalink
Fix cluster bootstrap when using a separate client node asg (#127)
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
  • Loading branch information
mch2 committed Jul 10, 2024
1 parent 65896f8 commit 2446842
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions lib/infra/infra-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ export class InfraStack extends Stack {

let dashboardsListener: NetworkListener | ApplicationListener;
if (this.dashboardsUrl !== 'undefined') {
const useSSLDashboardsListener = !this.securityDisabled && !this.minDistribution
const useSSLDashboardsListener = !this.securityDisabled && !this.minDistribution
&& this.opensearchDashboardsPortMapping === 443 && certificateArn !== 'undefined';
dashboardsListener = InfraStack.createListener(
this.elb,
Expand Down Expand Up @@ -509,18 +509,18 @@ export class InfraStack extends Stack {
// Disable target security for now, can be provided as an option in the future
InfraStack.addTargetsToListener(
opensearchListener,
this.elbType,
'single-node-target',
9200,
this.elbType,
'single-node-target',
9200,
new InstanceTarget(singleNodeInstance),
false);

if (this.dashboardsUrl !== 'undefined') {
InfraStack.addTargetsToListener(
dashboardsListener!,
this.elbType,
'single-node-osd-target',
5601,
this.elbType,
'single-node-osd-target',
5601,
new InstanceTarget(singleNodeInstance),
false);
}
Expand Down Expand Up @@ -652,7 +652,7 @@ export class InfraStack extends Stack {
requireImdsv2: true,
signals: Signals.waitForAll(),
});
Tags.of(clientNodeAsg).add('cluster', scope.stackName);
Tags.of(clientNodeAsg).add('cluster', this.stackName);
}

Tags.of(clientNodeAsg).add('role', 'client');
Expand Down Expand Up @@ -690,18 +690,18 @@ export class InfraStack extends Stack {
// Disable target security for now, can be provided as an option in the future
InfraStack.addTargetsToListener(
opensearchListener,
this.elbType,
'opensearchTarget',
9200,
this.elbType,
'opensearchTarget',
9200,
clientNodeAsg,
false);

if (this.dashboardsUrl !== 'undefined') {
InfraStack.addTargetsToListener(
dashboardsListener!,
this.elbType,
'dashboardsTarget',
5601,
this.elbType,
'dashboardsTarget',
5601,
clientNodeAsg,
false);
}
Expand Down

0 comments on commit 2446842

Please sign in to comment.