Skip to content

Commit

Permalink
Merge branch 'main' into route53-cross-account-sts-region
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Mar 28, 2024
2 parents 252c297 + 8a7c5c8 commit a20148d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/aws-cdk-lib/aws-opensearchservice/lib/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1828,6 +1828,10 @@ export class Domain extends DomainBase implements IDomain, ec2.IConnectable {
}
}

if (isSomeInstanceType('t3') && multiAzWithStandbyEnabled) {
throw new Error('T3 instance type does not support Multi-AZ with standby feature.');
}

const offPeakWindowEnabled = props.offPeakWindowEnabled ?? props.offPeakWindowStart !== undefined;
if (offPeakWindowEnabled) {
this.validateWindowStartTime(props.offPeakWindowStart);
Expand Down
21 changes: 21 additions & 0 deletions packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,27 @@ each([testedOpenSearchVersions]).test('can specify multiAZWithStandbyEnabled in
});
});

each([testedOpenSearchVersions]).test('multiAZWithStandbyEnabled: true throws with t3 instance type (data node)', (engineVersion) => {
expect(() => new Domain(stack, 'Domain', {
version: engineVersion,
capacity: {
dataNodeInstanceType: 't3.medium.search',
multiAzWithStandbyEnabled: true,
},
})).toThrow(/T3 instance type does not support Multi-AZ with standby feature\./);
});

each([testedOpenSearchVersions]).test('multiAZWithStandbyEnabled: true throws with t3 instance type (master node)', (engineVersion) => {
expect(() => new Domain(stack, 'Domain', {
version: engineVersion,
capacity: {
masterNodeInstanceType: 't3.medium.search',
masterNodes: 1,
multiAzWithStandbyEnabled: true,
},
})).toThrow(/T3 instance type does not support Multi-AZ with standby feature\./);
});

each([testedOpenSearchVersions]).test('ENABLE_OPENSEARCH_MULTIAZ_WITH_STANDBY set multiAZWithStandbyEnabled value', (engineVersion) => {
const stackWithFlag = new Stack(app, 'StackWithFlag', {
env: { account: '1234', region: 'testregion' },
Expand Down

0 comments on commit a20148d

Please sign in to comment.