From 780d4fc8905717645b44a2c1e70a79ab90c6269a Mon Sep 17 00:00:00 2001 From: Rishabh Singh Date: Wed, 23 Oct 2024 12:19:08 -0700 Subject: [PATCH] Change the ec2 instance ami to AL2 Signed-off-by: Rishabh Singh --- lib/infra/infra-stack.ts | 12 ++++++------ test/infra-stack-props.test.ts | 6 ++---- test/opensearch-cluster-cdk.test.ts | 3 +-- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/infra/infra-stack.ts b/lib/infra/infra-stack.ts index 6dad4a5347f..23628de0cc3 100644 --- a/lib/infra/infra-stack.ts +++ b/lib/infra/infra-stack.ts @@ -499,7 +499,7 @@ export class InfraStack extends Stack { singleNodeInstance = new Instance(this, 'single-node-instance', { vpc: props.vpc, instanceType: singleNodeInstanceType, - machineImage: MachineImage.latestAmazonLinux2023( + machineImage: MachineImage.latestAmazonLinux2( { cpuType: instanceCpuType, }, @@ -561,7 +561,7 @@ export class InfraStack extends Stack { const managerNodeAsg = new AutoScalingGroup(this, 'managerNodeAsg', { launchTemplate: new LaunchTemplate(this, 'managerNodeLt', { instanceType: defaultInstanceType, - machineImage: MachineImage.latestAmazonLinux2023({ + machineImage: MachineImage.latestAmazonLinux2({ cpuType: instanceCpuType, }), role: this.instanceRole, @@ -600,7 +600,7 @@ export class InfraStack extends Stack { const seedNodeAsg = new AutoScalingGroup(this, 'seedNodeAsg', { launchTemplate: new LaunchTemplate(this, 'seedNodeLt', { instanceType: (seedConfig === 'seed-manager') ? defaultInstanceType : this.dataInstanceType, - machineImage: MachineImage.latestAmazonLinux2023({ + machineImage: MachineImage.latestAmazonLinux2({ cpuType: instanceCpuType, }), role: this.instanceRole, @@ -641,7 +641,7 @@ export class InfraStack extends Stack { const dataNodeAsg = new AutoScalingGroup(this, 'dataNodeAsg', { launchTemplate: new LaunchTemplate(this, 'dataNodeLt', { instanceType: this.dataInstanceType, - machineImage: MachineImage.latestAmazonLinux2023({ + machineImage: MachineImage.latestAmazonLinux2({ cpuType: instanceCpuType, }), role: this.instanceRole, @@ -678,7 +678,7 @@ export class InfraStack extends Stack { clientNodeAsg = new AutoScalingGroup(this, 'clientNodeAsg', { launchTemplate: new LaunchTemplate(this, 'clientNodelt', { instanceType: defaultInstanceType, - machineImage: MachineImage.latestAmazonLinux2023({ + machineImage: MachineImage.latestAmazonLinux2({ cpuType: instanceCpuType, }), role: this.instanceRole, @@ -716,7 +716,7 @@ export class InfraStack extends Stack { const mlNodeAsg = new AutoScalingGroup(this, 'mlNodeAsg', { launchTemplate: new LaunchTemplate(this, 'mlNodeLt', { instanceType: this.mlInstanceType, - machineImage: MachineImage.latestAmazonLinux2023({ + machineImage: MachineImage.latestAmazonLinux2({ cpuType: instanceCpuType, }), role: this.instanceRole, diff --git a/test/infra-stack-props.test.ts b/test/infra-stack-props.test.ts index 83173873bd3..f45b20a8df9 100644 --- a/test/infra-stack-props.test.ts +++ b/test/infra-stack-props.test.ts @@ -44,8 +44,7 @@ test('Throw error on incorrect JSON for opensearch', () => { } catch (error) { expect(error).toBeInstanceOf(Error); // @ts-ignore - expect(error.message).toEqual('Encountered following error while parsing additionalConfig json parameter: ' - + 'SyntaxError: Unexpected token e in JSON at position 33'); + expect(error.message).toContain('Encountered following error while parsing additionalConfig json parameter:'); } }); @@ -84,8 +83,7 @@ test('Throw error on incorrect JSON for opensearch-dashboards', () => { } catch (error) { expect(error).toBeInstanceOf(Error); // @ts-ignore - expect(error.message).toEqual('Encountered following error while parsing additionalOsdConfig json parameter: ' - + 'SyntaxError: Unexpected token s in JSON at position 31'); + expect(error.message).toContain('Encountered following error while parsing additionalOsdConfig json parameter:'); } }); diff --git a/test/opensearch-cluster-cdk.test.ts b/test/opensearch-cluster-cdk.test.ts index f58f4656f21..22096632ad1 100644 --- a/test/opensearch-cluster-cdk.test.ts +++ b/test/opensearch-cluster-cdk.test.ts @@ -777,8 +777,7 @@ test('Throw error on incorrect JSON', () => { } catch (error) { expect(error).toBeInstanceOf(Error); // @ts-ignore - expect(error.message).toEqual('Encountered following error while parsing customConfigFiles json parameter: ' - + 'SyntaxError: Unexpected token o in JSON at position 25'); + expect(error.message).toContain('Encountered following error while parsing customConfigFiles json parameter:'); } });