From 244684291bade9e30741385577d88608b413c703 Mon Sep 17 00:00:00 2001 From: Marc Handalian Date: Tue, 9 Jul 2024 18:11:00 -0700 Subject: [PATCH] Fix cluster bootstrap when using a separate client node asg (#127) Signed-off-by: Marc Handalian --- lib/infra/infra-stack.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/infra/infra-stack.ts b/lib/infra/infra-stack.ts index 3f7b4aa67bd..1e89de63f85 100644 --- a/lib/infra/infra-stack.ts +++ b/lib/infra/infra-stack.ts @@ -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, @@ -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); } @@ -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'); @@ -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); }