From 672dca5a56046757914e1dca20314012d9615727 Mon Sep 17 00:00:00 2001 From: Tim Brust Date: Fri, 31 May 2024 12:25:30 +0200 Subject: [PATCH 1/2] feat(opensearch): adds OpenSearch 2.13 engine version --- ...teg-opensearch-with-logging-disabled.template.json | 4 ++-- .../tree.json | 4 ++-- .../test/integ.opensearch.disable-logging.ts | 4 ++-- .../cdk-integ-opensearch.template.json | 4 ++-- .../test/integ.opensearch.min.js.snapshot/tree.json | 4 ++-- .../test/integ.opensearch.min.ts | 2 +- ...nsearch-without-logs-resource-policy.template.json | 4 ++-- .../tree.json | 4 ++-- .../integ.opensearch.without-logs-resource-policy.ts | 2 +- .../aws-cdk-lib/aws-opensearchservice/lib/version.ts | 11 +++++++---- .../aws-opensearchservice/test/domain.test.ts | 2 ++ 11 files changed, 25 insertions(+), 20 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.disable-logging.js.snapshot/cdk-integ-opensearch-with-logging-disabled.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.disable-logging.js.snapshot/cdk-integ-opensearch-with-logging-disabled.template.json index e40bf735f746d..c697232cdce5a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.disable-logging.js.snapshot/cdk-integ-opensearch-with-logging-disabled.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.disable-logging.js.snapshot/cdk-integ-opensearch-with-logging-disabled.template.json @@ -22,7 +22,7 @@ "EncryptionAtRestOptions": { "Enabled": false }, - "EngineVersion": "OpenSearch_2.11", + "EngineVersion": "OpenSearch_2.13", "LogPublishingOptions": { "SEARCH_SLOW_LOGS": { "Enabled": false @@ -79,4 +79,4 @@ ] } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.disable-logging.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.disable-logging.js.snapshot/tree.json index 4164a22f7ead6..04ebcefcba564 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.disable-logging.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.disable-logging.js.snapshot/tree.json @@ -37,7 +37,7 @@ "encryptionAtRestOptions": { "enabled": false }, - "engineVersion": "OpenSearch_2.11", + "engineVersion": "OpenSearch_2.13", "logPublishingOptions": { "SEARCH_SLOW_LOGS": { "enabled": false @@ -158,4 +158,4 @@ "version": "0.0.0" } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.disable-logging.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.disable-logging.ts index 7ebaaa8d1e056..98bc3f21ffea6 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.disable-logging.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.disable-logging.ts @@ -7,7 +7,7 @@ class TestStack extends Stack { super(scope, id, props); const domainProps: opensearch.DomainProps = { - version: opensearch.EngineVersion.OPENSEARCH_2_11, + version: opensearch.EngineVersion.OPENSEARCH_2_13, removalPolicy: RemovalPolicy.DESTROY, logging: { auditLogEnabled: false, @@ -26,4 +26,4 @@ class TestStack extends Stack { const app = new App(); new TestStack(app, 'cdk-integ-opensearch-with-logging-disabled'); -app.synth(); \ No newline at end of file +app.synth(); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/cdk-integ-opensearch.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/cdk-integ-opensearch.template.json index 89cc7dee32301..f54bc8f909197 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/cdk-integ-opensearch.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/cdk-integ-opensearch.template.json @@ -22,7 +22,7 @@ "EncryptionAtRestOptions": { "Enabled": false }, - "EngineVersion": "OpenSearch_2.11", + "EngineVersion": "OpenSearch_2.13", "LogPublishingOptions": {}, "NodeToNodeEncryptionOptions": { "Enabled": false @@ -66,4 +66,4 @@ ] } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/tree.json index 9487ee9aca209..deef8bfd8e7ed 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.js.snapshot/tree.json @@ -37,7 +37,7 @@ "encryptionAtRestOptions": { "enabled": false }, - "engineVersion": "OpenSearch_2.11", + "engineVersion": "OpenSearch_2.13", "logPublishingOptions": {}, "nodeToNodeEncryptionOptions": { "enabled": false @@ -145,4 +145,4 @@ "version": "0.0.0" } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.ts index 77749bb734c89..b0cd6aa86e523 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.min.ts @@ -9,7 +9,7 @@ class TestStack extends Stack { // deploy the latest opensearch domain with minimal configuration const domainProps: opensearch.DomainProps = { - version: opensearch.EngineVersion.OPENSEARCH_2_11, + version: opensearch.EngineVersion.OPENSEARCH_2_13, removalPolicy: RemovalPolicy.DESTROY, capacity: { multiAzWithStandbyEnabled: false, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.without-logs-resource-policy.js.snapshot/cdkinteg-opensearch-without-logs-resource-policy.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.without-logs-resource-policy.js.snapshot/cdkinteg-opensearch-without-logs-resource-policy.template.json index 7e4a49203b445..ab5ce3a9e8f08 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.without-logs-resource-policy.js.snapshot/cdkinteg-opensearch-without-logs-resource-policy.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.without-logs-resource-policy.js.snapshot/cdkinteg-opensearch-without-logs-resource-policy.template.json @@ -22,7 +22,7 @@ "EncryptionAtRestOptions": { "Enabled": false }, - "EngineVersion": "OpenSearch_2.11", + "EngineVersion": "OpenSearch_2.13", "LogPublishingOptions": { "ES_APPLICATION_LOGS": { "CloudWatchLogsLogGroupArn": { @@ -73,4 +73,4 @@ ] } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.without-logs-resource-policy.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.without-logs-resource-policy.js.snapshot/tree.json index 6ce64c2435012..1c843738d8bc6 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.without-logs-resource-policy.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.without-logs-resource-policy.js.snapshot/tree.json @@ -144,7 +144,7 @@ "encryptionAtRestOptions": { "enabled": false }, - "engineVersion": "OpenSearch_2.11", + "engineVersion": "OpenSearch_2.13", "logPublishingOptions": { "ES_APPLICATION_LOGS": { "enabled": true, @@ -259,4 +259,4 @@ "version": "0.0.0" } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.without-logs-resource-policy.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.without-logs-resource-policy.ts index 7b9e887a318ff..db4eeebd1b79c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.without-logs-resource-policy.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.without-logs-resource-policy.ts @@ -34,7 +34,7 @@ class TestStack extends Stack { super(scope, id, props); const domainProps: opensearch.DomainProps = { - version: opensearch.EngineVersion.OPENSEARCH_2_11, + version: opensearch.EngineVersion.OPENSEARCH_2_13, removalPolicy: RemovalPolicy.DESTROY, logging: { appLogEnabled: true, diff --git a/packages/aws-cdk-lib/aws-opensearchservice/lib/version.ts b/packages/aws-cdk-lib/aws-opensearchservice/lib/version.ts index d5934627ab938..6b2afcb38b8f6 100644 --- a/packages/aws-cdk-lib/aws-opensearchservice/lib/version.ts +++ b/packages/aws-cdk-lib/aws-opensearchservice/lib/version.ts @@ -90,15 +90,18 @@ export class EngineVersion { /** AWS OpenSearch 2.9 */ public static readonly OPENSEARCH_2_9 = EngineVersion.openSearch('2.9'); + /** AWS OpenSearch 2.10 */ + public static readonly OPENSEARCH_2_10 = EngineVersion.openSearch('2.10'); + /** - * AWS OpenSearch 2.10 + * AWS OpenSearch 2.11 * @deprecated use latest version of the OpenSearch engine **/ - public static readonly OPENSEARCH_2_10 = EngineVersion.openSearch('2.10'); - - /** AWS OpenSearch 2.11 */ public static readonly OPENSEARCH_2_11 = EngineVersion.openSearch('2.11'); + /** AWS OpenSearch 2.13 */ + public static readonly OPENSEARCH_2_13 = EngineVersion.openSearch('2.13'); + /** * Custom ElasticSearch version * @param version custom version number diff --git a/packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts b/packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts index 78bbc70afed30..abde6c1fb499c 100644 --- a/packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts +++ b/packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts @@ -42,6 +42,7 @@ const testedOpenSearchVersions = [ EngineVersion.OPENSEARCH_2_9, EngineVersion.OPENSEARCH_2_10, EngineVersion.OPENSEARCH_2_11, + EngineVersion.OPENSEARCH_2_13, ]; each(testedOpenSearchVersions).test('connections throws if domain is not placed inside a vpc', (engineVersion) => { @@ -207,6 +208,7 @@ each([ [EngineVersion.OPENSEARCH_2_9, 'OpenSearch_2.9'], [EngineVersion.OPENSEARCH_2_10, 'OpenSearch_2.10'], [EngineVersion.OPENSEARCH_2_11, 'OpenSearch_2.11'], + [EngineVersion.OPENSEARCH_2_13, 'OpenSearch_2.13'], ]).test('minimal example renders correctly', (engineVersion, expectedCfVersion) => { new Domain(stack, 'Domain', { version: engineVersion }); From ab423c1c00cd5c345f361e1e70178907e715df65 Mon Sep 17 00:00:00 2001 From: Tim Brust Date: Mon, 10 Jun 2024 14:59:06 +0200 Subject: [PATCH 2/2] fix: address review feedback --- packages/aws-cdk-lib/aws-opensearchservice/lib/version.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/aws-cdk-lib/aws-opensearchservice/lib/version.ts b/packages/aws-cdk-lib/aws-opensearchservice/lib/version.ts index 6b2afcb38b8f6..513aae1b950cf 100644 --- a/packages/aws-cdk-lib/aws-opensearchservice/lib/version.ts +++ b/packages/aws-cdk-lib/aws-opensearchservice/lib/version.ts @@ -90,13 +90,13 @@ export class EngineVersion { /** AWS OpenSearch 2.9 */ public static readonly OPENSEARCH_2_9 = EngineVersion.openSearch('2.9'); - /** AWS OpenSearch 2.10 */ - public static readonly OPENSEARCH_2_10 = EngineVersion.openSearch('2.10'); - /** - * AWS OpenSearch 2.11 + * AWS OpenSearch 2.10 * @deprecated use latest version of the OpenSearch engine **/ + public static readonly OPENSEARCH_2_10 = EngineVersion.openSearch('2.10'); + + /** AWS OpenSearch 2.11 */ public static readonly OPENSEARCH_2_11 = EngineVersion.openSearch('2.11'); /** AWS OpenSearch 2.13 */