Skip to content

Commit b4c314d

Browse files
authored
Change the ec2 instance ami to AL2 (#139)
Signed-off-by: Rishabh Singh <[email protected]>
1 parent 4f804d6 commit b4c314d

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

Diff for: lib/infra/infra-stack.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ export class InfraStack extends Stack {
499499
singleNodeInstance = new Instance(this, 'single-node-instance', {
500500
vpc: props.vpc,
501501
instanceType: singleNodeInstanceType,
502-
machineImage: MachineImage.latestAmazonLinux2023(
502+
machineImage: MachineImage.latestAmazonLinux2(
503503
{
504504
cpuType: instanceCpuType,
505505
},
@@ -561,7 +561,7 @@ export class InfraStack extends Stack {
561561
const managerNodeAsg = new AutoScalingGroup(this, 'managerNodeAsg', {
562562
launchTemplate: new LaunchTemplate(this, 'managerNodeLt', {
563563
instanceType: defaultInstanceType,
564-
machineImage: MachineImage.latestAmazonLinux2023({
564+
machineImage: MachineImage.latestAmazonLinux2({
565565
cpuType: instanceCpuType,
566566
}),
567567
role: this.instanceRole,
@@ -600,7 +600,7 @@ export class InfraStack extends Stack {
600600
const seedNodeAsg = new AutoScalingGroup(this, 'seedNodeAsg', {
601601
launchTemplate: new LaunchTemplate(this, 'seedNodeLt', {
602602
instanceType: (seedConfig === 'seed-manager') ? defaultInstanceType : this.dataInstanceType,
603-
machineImage: MachineImage.latestAmazonLinux2023({
603+
machineImage: MachineImage.latestAmazonLinux2({
604604
cpuType: instanceCpuType,
605605
}),
606606
role: this.instanceRole,
@@ -641,7 +641,7 @@ export class InfraStack extends Stack {
641641
const dataNodeAsg = new AutoScalingGroup(this, 'dataNodeAsg', {
642642
launchTemplate: new LaunchTemplate(this, 'dataNodeLt', {
643643
instanceType: this.dataInstanceType,
644-
machineImage: MachineImage.latestAmazonLinux2023({
644+
machineImage: MachineImage.latestAmazonLinux2({
645645
cpuType: instanceCpuType,
646646
}),
647647
role: this.instanceRole,
@@ -678,7 +678,7 @@ export class InfraStack extends Stack {
678678
clientNodeAsg = new AutoScalingGroup(this, 'clientNodeAsg', {
679679
launchTemplate: new LaunchTemplate(this, 'clientNodelt', {
680680
instanceType: defaultInstanceType,
681-
machineImage: MachineImage.latestAmazonLinux2023({
681+
machineImage: MachineImage.latestAmazonLinux2({
682682
cpuType: instanceCpuType,
683683
}),
684684
role: this.instanceRole,
@@ -716,7 +716,7 @@ export class InfraStack extends Stack {
716716
const mlNodeAsg = new AutoScalingGroup(this, 'mlNodeAsg', {
717717
launchTemplate: new LaunchTemplate(this, 'mlNodeLt', {
718718
instanceType: this.mlInstanceType,
719-
machineImage: MachineImage.latestAmazonLinux2023({
719+
machineImage: MachineImage.latestAmazonLinux2({
720720
cpuType: instanceCpuType,
721721
}),
722722
role: this.instanceRole,

Diff for: test/infra-stack-props.test.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ test('Throw error on incorrect JSON for opensearch', () => {
4444
} catch (error) {
4545
expect(error).toBeInstanceOf(Error);
4646
// @ts-ignore
47-
expect(error.message).toEqual('Encountered following error while parsing additionalConfig json parameter: '
48-
+ 'SyntaxError: Unexpected token e in JSON at position 33');
47+
expect(error.message).toContain('Encountered following error while parsing additionalConfig json parameter:');
4948
}
5049
});
5150

@@ -84,8 +83,7 @@ test('Throw error on incorrect JSON for opensearch-dashboards', () => {
8483
} catch (error) {
8584
expect(error).toBeInstanceOf(Error);
8685
// @ts-ignore
87-
expect(error.message).toEqual('Encountered following error while parsing additionalOsdConfig json parameter: '
88-
+ 'SyntaxError: Unexpected token s in JSON at position 31');
86+
expect(error.message).toContain('Encountered following error while parsing additionalOsdConfig json parameter:');
8987
}
9088
});
9189

Diff for: test/opensearch-cluster-cdk.test.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -777,8 +777,7 @@ test('Throw error on incorrect JSON', () => {
777777
} catch (error) {
778778
expect(error).toBeInstanceOf(Error);
779779
// @ts-ignore
780-
expect(error.message).toEqual('Encountered following error while parsing customConfigFiles json parameter: '
781-
+ 'SyntaxError: Unexpected token o in JSON at position 25');
780+
expect(error.message).toContain('Encountered following error while parsing customConfigFiles json parameter:');
782781
}
783782
});
784783

0 commit comments

Comments
 (0)