Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
  • Loading branch information
gaiksaya committed Jan 5, 2024
1 parent 97325e9 commit d677f9c
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/opensearch-cluster-cdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -736,3 +736,35 @@ test('Should not throw error when security is enabled and adminPassword is defi
env: { account: 'test-account', region: 'us-east-1' },
});
});

test('Should not throw error when security is enabled and version is less than 2.12', () => {
const app = new App({
context: {
securityDisabled: false,
minDistribution: false,
distributionUrl: 'www.example.com',
cpuArch: 'x64',
singleNodeCluster: false,
dashboardsUrl: 'www.example.com',
distVersion: '2.4.0',
serverAccessType: 'ipv4',
restrictServerAccessTo: 'all',
managerNodeCount: 0,
dataNodeCount: 3,
dataNodeStorage: 200,
customRoleArn: 'arn:aws:iam::12345678:role/customRoleName',
},
});

// WHEN
const networkStack = new NetworkStack(app, 'opensearch-network-stack', {
env: { account: 'test-account', region: 'us-east-1' },
});

// @ts-ignore
const infraStack = new InfraStack(app, 'opensearch-infra-stack', {
vpc: networkStack.vpc,
securityGroup: networkStack.osSecurityGroup,
env: { account: 'test-account', region: 'us-east-1' },
});
});

0 comments on commit d677f9c

Please sign in to comment.