-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(opensearch): add I4I and R7GD to list of OpenSearch nodes not requiring EBS volumes #32592
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1576,8 +1576,8 @@ export class Domain extends DomainBase implements IDomain, ec2.IConnectable { | |
|
||
// Validate against instance type restrictions, per | ||
// https://docs.aws.amazon.com/opensearch-service/latest/developerguide/supported-instance-types.html | ||
if (isSomeInstanceType('i3', 'r6gd', 'i4g', 'im4gn') && ebsEnabled) { | ||
throw new Error('I3, R6GD, I4G, and IM4GN instance types do not support EBS storage volumes.'); | ||
if (isSomeInstanceType('i3', 'r6gd', 'i4g', 'i4i', 'im4gn', 'r7gd') && ebsEnabled) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice to refactor these instance type lists and store them in a named constant, to improve readability and maintenance. You could also use their human-friendlier private static readonly UNSUPPORTED_EBS = [
ec2.InstanceClass.IO3,
ec2.InstanceClass.MEMORY6_GRAVITON2_NVME_DRIVE,
// ...
];
// ...
if(isSomeInstanceType(...UNSUPPORTED_EBS) && ebsEnabled) throw You could also generate the error message using this list, without having to update them both manually: function formatInstanceTypesList(instanceTypes: string[]): string {
return instanceTypes.map((type) => type.toUpperCase()).join(', ').replace(/, ([^,]*)$/, ' and $1');
}
throw new Error(`${formatInstanceTypesList(UNSUPPORTED_EBS)} instance types do not support EBS storage volumes.`); There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you. I took your suggestions into account and tried refactoring the relevant parts for this fix. |
||
throw new Error('I3, R6GD, I4G, I4I, IM4GN and R7GD instance types do not support EBS storage volumes.'); | ||
} | ||
|
||
if (isSomeInstanceType('m3', 'r3', 't2') && encryptionAtRestEnabled) { | ||
|
@@ -1592,10 +1592,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, I3, R6GD, I4G and IM4GN support instance storage, per | ||
// Only R3, I3, R6GD, I4G, I4I, IM4GN and R7GD support instance storage, per | ||
// https://aws.amazon.com/opensearch-service/pricing/ | ||
if (!ebsEnabled && !isEveryDatanodeInstanceType('r3', 'i3', 'r6gd', 'i4g', 'im4gn')) { | ||
throw new Error('EBS volumes are required when using instance types other than R3, I3, R6GD, I4G, or IM4GN.'); | ||
if (!ebsEnabled && !isEveryDatanodeInstanceType('r3', 'i3', 'r6gd', 'i4g', 'i4i', 'im4gn', 'r7gd')) { | ||
throw new Error('EBS volumes are required when using instance types other than R3, I3, R6GD, I4G, I4I, M4GN or R7GD.'); | ||
} | ||
|
||
// Only for a valid ebs volume configuration, per | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
domainProps
variable seems unnecessary, especially because it has to be typed to get IDE hints instead of inheriting the constructor's signatureThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.