@@ -1437,7 +1437,7 @@ describe('custom error responses', () => {
14371437 } ) ) . toThrow ( / N o d e - t o - n o d e e n c r y p t i o n r e q u i r e s E l a s t i c s e a r c h v e r s i o n 6 .0 o r l a t e r / ) ;
14381438 } ) ;
14391439
1440- test ( 'error when i3 instance types are specified with EBS enabled' , ( ) => {
1440+ test ( 'error when i3 or r6g instance types are specified with EBS enabled' , ( ) => {
14411441 expect ( ( ) => new Domain ( stack , 'Domain1' , {
14421442 version : ElasticsearchVersion . V7_4 ,
14431443 capacity : {
@@ -1448,6 +1448,16 @@ describe('custom error responses', () => {
14481448 volumeType : EbsDeviceVolumeType . GENERAL_PURPOSE_SSD ,
14491449 } ,
14501450 } ) ) . toThrow ( / I 3 a n d R 6 G D i n s t a n c e t y p e s d o n o t s u p p o r t E B S s t o r a g e v o l u m e s / ) ;
1451+ expect ( ( ) => new Domain ( stack , 'Domain2' , {
1452+ version : ElasticsearchVersion . V7_4 ,
1453+ capacity : {
1454+ dataNodeInstanceType : 'r6gd.large.elasticsearch' ,
1455+ } ,
1456+ ebs : {
1457+ volumeSize : 100 ,
1458+ volumeType : EbsDeviceVolumeType . GENERAL_PURPOSE_SSD ,
1459+ } ,
1460+ } ) ) . toThrow ( / I 3 a n d R 6 G D i n s t a n c e t y p e s d o n o t s u p p o r t E B S s t o r a g e v o l u m e s / ) ;
14511461 } ) ;
14521462
14531463 test ( 'error when m3, r3, or t2 instance types are specified with encryption at rest enabled' , ( ) => {
@@ -1500,6 +1510,41 @@ describe('custom error responses', () => {
15001510 masterNodeInstanceType : 'm5.large.elasticsearch' ,
15011511 } ,
15021512 } ) ) . toThrow ( / E B S v o l u m e s a r e r e q u i r e d w h e n u s i n g i n s t a n c e t y p e s o t h e r t h a n r 3 , i 3 o r r 6 g d / ) ;
1513+ expect ( ( ) => new Domain ( stack , 'Domain2' , {
1514+ version : ElasticsearchVersion . V7_4 ,
1515+ ebs : {
1516+ enabled : false ,
1517+ } ,
1518+ capacity : {
1519+ dataNodeInstanceType : 'm5.large.elasticsearch' ,
1520+ } ,
1521+ } ) ) . toThrow ( / E B S v o l u m e s a r e r e q u i r e d w h e n u s i n g i n s t a n c e t y p e s o t h e r t h a n r 3 , i 3 o r r 6 g d / ) ;
1522+ } ) ;
1523+
1524+ test ( 'can use compatible master instance types that does not have local storage when data node type is i3 or r6gd' , ( ) => {
1525+ new Domain ( stack , 'Domain1' , {
1526+ version : ElasticsearchVersion . V7_4 ,
1527+ ebs : {
1528+ enabled : false ,
1529+ } ,
1530+ capacity : {
1531+ masterNodeInstanceType : 'c5.2xlarge.elasticsearch' ,
1532+ dataNodeInstanceType : 'i3.2xlarge.elasticsearch' ,
1533+ } ,
1534+ } ) ;
1535+ new Domain ( stack , 'Domain2' , {
1536+ version : ElasticsearchVersion . V7_4 ,
1537+ ebs : {
1538+ enabled : false ,
1539+ } ,
1540+ capacity : {
1541+ masterNodes : 3 ,
1542+ masterNodeInstanceType : 'c6g.large.elasticsearch' ,
1543+ dataNodeInstanceType : 'r6gd.large.elasticsearch' ,
1544+ } ,
1545+ } ) ;
1546+ // both configurations pass synth-time validation
1547+ expect ( stack ) . toCountResources ( 'AWS::Elasticsearch::Domain' , 2 ) ;
15031548 } ) ;
15041549
15051550 test ( 'error when availabilityZoneCount is not 2 or 3' , ( ) => {
0 commit comments