Skip to content

Commit 9594842

Browse files
authored
fix(opensearchservice): add i8g nodes validation without EBS (#35668)
### Issue # (if applicable) Closes #35666. ### Reason for this change Cannot create i8g data nodes without EBS due to validation logic. ### Description of changes Enable create i8g data nodes by adding i8g type to `unSupportEbsInstanceType` . ### Describe any new or updated permissions being added N/A ### Description of how you validated changes unit test ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 23261df commit 9594842

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

packages/aws-cdk-lib/aws-opensearchservice/lib/domain.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,6 +1649,7 @@ export class Domain extends DomainBase implements IDomain, ec2.IConnectable {
16491649
ec2.InstanceClass.R6GD,
16501650
ec2.InstanceClass.I4G,
16511651
ec2.InstanceClass.I4I,
1652+
ec2.InstanceClass.I8G,
16521653
ec2.InstanceClass.IM4GN,
16531654
ec2.InstanceClass.R7GD,
16541655
];

packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,6 +2006,7 @@ each(testedOpenSearchVersions).describe('custom error responses', (engineVersion
20062006
'im4gn.2xlarge.search',
20072007
'i4g.large.search',
20082008
'i4i.xlarge.search',
2009+
'i8g.4xlarge.search',
20092010
'r7gd.xlarge.search',
20102011
])('error when %s instance type is specified with EBS enabled', (dataNodeInstanceType) => {
20112012
expect(() => new Domain(stack, 'Domain2', {
@@ -2017,7 +2018,25 @@ each(testedOpenSearchVersions).describe('custom error responses', (engineVersion
20172018
volumeSize: 100,
20182019
volumeType: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD,
20192020
},
2020-
})).toThrow(/I3, R6GD, I4G, I4I, IM4GN and R7GD instance types do not support EBS storage volumes./);
2021+
})).toThrow(/I3, R6GD, I4G, I4I, I8G, IM4GN and R7GD instance types do not support EBS storage volumes./);
2022+
});
2023+
2024+
test.each([
2025+
'i3.2xlarge.search',
2026+
'r6gd.large.search',
2027+
'im4gn.2xlarge.search',
2028+
'i4g.large.search',
2029+
'i4i.xlarge.search',
2030+
'i8g.4xlarge.search',
2031+
'r7gd.xlarge.search',
2032+
])('should not throw when %s instance type is specified without EBS enabled', (dataNodeInstanceType) => {
2033+
expect(() => new Domain(stack, 'Domain2', {
2034+
version: engineVersion,
2035+
capacity: {
2036+
dataNodeInstanceType,
2037+
},
2038+
ebs: { enabled: false },
2039+
})).not.toThrow();
20212040
});
20222041

20232042
test.each([
@@ -2058,7 +2077,7 @@ each(testedOpenSearchVersions).describe('custom error responses', (engineVersion
20582077
capacity: {
20592078
masterNodeInstanceType,
20602079
},
2061-
})).toThrow(/EBS volumes are required when using instance types other than R3, I3, R6GD, I4G, I4I, IM4GN or R7GD./);
2080+
})).toThrow(/EBS volumes are required when using instance types other than R3, I3, R6GD, I4G, I4I, I8G, IM4GN or R7GD./);
20622081
});
20632082

20642083
test('can use compatible master instance types that does not have local storage when data node type is i3 or r6gd', () => {

0 commit comments

Comments
 (0)