diff --git a/packages/aws-cdk-lib/aws-opensearchservice/lib/domain.ts b/packages/aws-cdk-lib/aws-opensearchservice/lib/domain.ts index 644ff8e3f50fc..c5092fe765818 100644 --- a/packages/aws-cdk-lib/aws-opensearchservice/lib/domain.ts +++ b/packages/aws-cdk-lib/aws-opensearchservice/lib/domain.ts @@ -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); diff --git a/packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts b/packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts index 4c7796fe3e5ea..78bbc70afed30 100644 --- a/packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts +++ b/packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts @@ -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' },