Skip to content

Commit

Permalink
fix(elasticsearch): 'r6gd' not marked as supported type for instance …
Browse files Browse the repository at this point in the history
…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*
  • Loading branch information
ofirnk authored Jun 1, 2021
1 parent f8b191e commit d07a49f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions packages/@aws-cdk/aws-elasticsearch/lib/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-elasticsearch/test/domain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down Expand Up @@ -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: {
Expand All @@ -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', () => {
Expand Down

0 comments on commit d07a49f

Please sign in to comment.