Skip to content

Commit

Permalink
Change the ec2 instance ami to AL2
Browse files Browse the repository at this point in the history
Signed-off-by: Rishabh Singh <[email protected]>
  • Loading branch information
rishabh6788 committed Oct 23, 2024
1 parent 4f804d6 commit 780d4fc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
12 changes: 6 additions & 6 deletions lib/infra/infra-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 2 additions & 4 deletions test/infra-stack-props.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:');
}
});

Expand Down Expand Up @@ -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:');
}
});

Expand Down
3 changes: 1 addition & 2 deletions test/opensearch-cluster-cdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:');
}
});

Expand Down

0 comments on commit 780d4fc

Please sign in to comment.