From d07a49ff00ae07ea013ce6cc83d768e7729225a8 Mon Sep 17 00:00:00 2001 From: Ofir Naor Date: Tue, 1 Jun 2021 18:23:05 +0300 Subject: [PATCH] fix(elasticsearch): 'r6gd' not marked as supported type for instance storage (#14894) According to https://aws.amazon.com/elasticsearch-service/pricing/ it's now supported . Fixes #14773 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-elasticsearch/lib/domain.ts | 10 +++++----- .../@aws-cdk/aws-elasticsearch/test/domain.test.ts | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/@aws-cdk/aws-elasticsearch/lib/domain.ts b/packages/@aws-cdk/aws-elasticsearch/lib/domain.ts index 3f83da9ad3328..d8a8db02d8a8a 100644 --- a/packages/@aws-cdk/aws-elasticsearch/lib/domain.ts +++ b/packages/@aws-cdk/aws-elasticsearch/lib/domain.ts @@ -1454,8 +1454,8 @@ export class Domain extends DomainBase implements IDomain, ec2.IConnectable { // Validate against instance type restrictions, per // https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/aes-supported-instance-types.html - if (isInstanceType('i3') && ebsEnabled) { - throw new Error('I3 instance types do not support EBS storage volumes.'); + if (isSomeInstanceType('i3', 'r6gd') && ebsEnabled) { + throw new Error('I3 and R6GD instance types do not support EBS storage volumes.'); } if (isSomeInstanceType('m3', 'r3', 't2') && encryptionAtRestEnabled) { @@ -1470,10 +1470,10 @@ export class Domain extends DomainBase implements IDomain, ec2.IConnectable { throw new Error('T2 and T3 instance types do not support UltraWarm storage.'); } - // Only R3 and I3 support instance storage, per + // Only R3, I3 and r6gd support instance storage, per // https://aws.amazon.com/elasticsearch-service/pricing/ - if (!ebsEnabled && !isEveryInstanceType('r3', 'i3')) { - throw new Error('EBS volumes are required when using instance types other than r3 or i3.'); + if (!ebsEnabled && !isEveryInstanceType('r3', 'i3', 'r6gd')) { + throw new Error('EBS volumes are required when using instance types other than r3, i3 or r6gd.'); } // Fine-grained access control requires node-to-node encryption, encryption at rest, diff --git a/packages/@aws-cdk/aws-elasticsearch/test/domain.test.ts b/packages/@aws-cdk/aws-elasticsearch/test/domain.test.ts index 63cc2a7cdd853..0135d979860b1 100644 --- a/packages/@aws-cdk/aws-elasticsearch/test/domain.test.ts +++ b/packages/@aws-cdk/aws-elasticsearch/test/domain.test.ts @@ -1368,7 +1368,7 @@ describe('custom error responses', () => { volumeSize: 100, volumeType: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD, }, - })).toThrow(/I3 instance types do not support EBS storage volumes/); + })).toThrow(/I3 and R6GD instance types do not support EBS storage volumes/); }); test('error when m3, r3, or t2 instance types are specified with encryption at rest enabled', () => { @@ -1411,7 +1411,7 @@ describe('custom error responses', () => { })).toThrow(/t2.micro.elasticsearch instance type supports only Elasticsearch 1.5 and 2.3/); }); - test('error when any instance type other than R3 and I3 are specified without EBS enabled', () => { + test('error when any instance type other than R3, I3 and R6GD are specified without EBS enabled', () => { expect(() => new Domain(stack, 'Domain1', { version: ElasticsearchVersion.V7_4, ebs: { @@ -1420,7 +1420,7 @@ describe('custom error responses', () => { capacity: { masterNodeInstanceType: 'm5.large.elasticsearch', }, - })).toThrow(/EBS volumes are required when using instance types other than r3 or i3/); + })).toThrow(/EBS volumes are required when using instance types other than r3, i3 or r6gd/); }); test('error when availabilityZoneCount is not 2 or 3', () => {