Skip to content

Commit 0303d6f

Browse files
authored
feat(opensearch): add support for latest amazon opensearch service 2.3 (#22943)
fixes #22942 Description: AWS Launched the support for Amazon OpenSearch Service 2.3 as per the announcement here: https://aws.amazon.com/about-aws/whats-new/2022/11/amazon-opensearch-service-supports-opensearch-version-2-3/ AWS CDK does not support the latest version yet, and can not create an OpenSearch cluster with CDK using 2.3. ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 626e2cc commit 0303d6f

14 files changed

+375
-175
lines changed

packages/@aws-cdk/aws-appsync/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ import * as opensearch from '@aws-cdk/aws-opensearchservice';
258258

259259
const user = new iam.User(this, 'User');
260260
const domain = new opensearch.Domain(this, 'Domain', {
261-
version: opensearch.EngineVersion.OPENSEARCH_1_3,
261+
version: opensearch.EngineVersion.OPENSEARCH_2_3,
262262
removalPolicy: RemovalPolicy.DESTROY,
263263
fineGrainedAccessControl: { masterUserArn: user.userArn },
264264
encryptionAtRest: { enabled: true },

packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/appsync-opensearch.assets.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"version": "22.0.0",
2+
"version": "29.0.0",
33
"files": {
4-
"cbf69265acb5253067d9fc78cec3e7b151737dc0ba84d10aedd04a2c12f84bc4": {
4+
"f8a2a9f9e0d429354b6c00646ad4364f5e46ab6ceecf270d2ff59b9befcba8b5": {
55
"source": {
66
"path": "appsync-opensearch.template.json",
77
"packaging": "file"
88
},
99
"destinations": {
1010
"current_account-current_region": {
1111
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12-
"objectKey": "cbf69265acb5253067d9fc78cec3e7b151737dc0ba84d10aedd04a2c12f84bc4.json",
12+
"objectKey": "f8a2a9f9e0d429354b6c00646ad4364f5e46ab6ceecf270d2ff59b9befcba8b5.json",
1313
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
1414
}
1515
}

packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/appsync-opensearch.template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"EncryptionAtRestOptions": {
3737
"Enabled": true
3838
},
39-
"EngineVersion": "OpenSearch_1.3",
39+
"EngineVersion": "OpenSearch_2.3",
4040
"LogPublishingOptions": {},
4141
"NodeToNodeEncryptionOptions": {
4242
"Enabled": true
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"22.0.0"}
1+
{"version":"29.0.0"}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
{
2-
"version": "22.0.0",
2+
"version": "29.0.0",
33
"testCases": {
4-
"integ.graphql-opensearch": {
4+
"opensearch-2.3-stack/DefaultTest": {
55
"stacks": [
66
"appsync-opensearch"
77
],
8-
"diffAssets": false,
9-
"stackUpdateWorkflow": true
8+
"assertionStack": "opensearch-2.3-stack/DefaultTest/DeployAssert",
9+
"assertionStackName": "opensearch23stackDefaultTestDeployAssert16E12129"
1010
}
11-
},
12-
"synthContext": {},
13-
"enableLookups": false
11+
}
1412
}

packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/manifest.json

+46-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "22.0.0",
2+
"version": "29.0.0",
33
"artifacts": {
44
"appsync-opensearch.assets": {
55
"type": "cdk:asset-manifest",
@@ -17,7 +17,7 @@
1717
"validateOnSynth": false,
1818
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
1919
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
20-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/cbf69265acb5253067d9fc78cec3e7b151737dc0ba84d10aedd04a2c12f84bc4.json",
20+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/f8a2a9f9e0d429354b6c00646ad4364f5e46ab6ceecf270d2ff59b9befcba8b5.json",
2121
"requiresBootstrapStackVersion": 6,
2222
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
2323
"additionalDependencies": [
@@ -98,18 +98,56 @@
9898
"type": "aws:cdk:logicalId",
9999
"data": "CheckBootstrapVersion"
100100
}
101+
]
102+
},
103+
"displayName": "appsync-opensearch"
104+
},
105+
"opensearch23stackDefaultTestDeployAssert16E12129.assets": {
106+
"type": "cdk:asset-manifest",
107+
"properties": {
108+
"file": "opensearch23stackDefaultTestDeployAssert16E12129.assets.json",
109+
"requiresBootstrapStackVersion": 6,
110+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
111+
}
112+
},
113+
"opensearch23stackDefaultTestDeployAssert16E12129": {
114+
"type": "aws:cloudformation:stack",
115+
"environment": "aws://unknown-account/unknown-region",
116+
"properties": {
117+
"templateFile": "opensearch23stackDefaultTestDeployAssert16E12129.template.json",
118+
"validateOnSynth": false,
119+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
120+
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
121+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
122+
"requiresBootstrapStackVersion": 6,
123+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
124+
"additionalDependencies": [
125+
"opensearch23stackDefaultTestDeployAssert16E12129.assets"
101126
],
102-
"apidsQuerygetTestsResolver5C6FBB59": [
127+
"lookupRole": {
128+
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
129+
"requiresBootstrapStackVersion": 8,
130+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
131+
}
132+
},
133+
"dependencies": [
134+
"opensearch23stackDefaultTestDeployAssert16E12129.assets"
135+
],
136+
"metadata": {
137+
"/opensearch-2.3-stack/DefaultTest/DeployAssert/BootstrapVersion": [
138+
{
139+
"type": "aws:cdk:logicalId",
140+
"data": "BootstrapVersion"
141+
}
142+
],
143+
"/opensearch-2.3-stack/DefaultTest/DeployAssert/CheckBootstrapVersion": [
103144
{
104145
"type": "aws:cdk:logicalId",
105-
"data": "apidsQuerygetTestsResolver5C6FBB59",
106-
"trace": [
107-
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
108-
]
146+
"data": "CheckBootstrapVersion"
109147
}
110148
]
111149
},
112-
"displayName": "appsync-opensearch"
150+
"displayName": "opensearch-2.3-stack/DefaultTest/DeployAssert"
113151
},
114152
"Tree": {
115153
"type": "cdk:tree",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "29.0.0",
3+
"files": {
4+
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
5+
"source": {
6+
"path": "opensearch23stackDefaultTestDeployAssert16E12129.template.json",
7+
"packaging": "file"
8+
},
9+
"destinations": {
10+
"current_account-current_region": {
11+
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12+
"objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
13+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
14+
}
15+
}
16+
}
17+
},
18+
"dockerImages": {}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"Parameters": {
3+
"BootstrapVersion": {
4+
"Type": "AWS::SSM::Parameter::Value<String>",
5+
"Default": "/cdk-bootstrap/hnb659fds/version",
6+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
7+
}
8+
},
9+
"Rules": {
10+
"CheckBootstrapVersion": {
11+
"Assertions": [
12+
{
13+
"Assert": {
14+
"Fn::Not": [
15+
{
16+
"Fn::Contains": [
17+
[
18+
"1",
19+
"2",
20+
"3",
21+
"4",
22+
"5"
23+
],
24+
{
25+
"Ref": "BootstrapVersion"
26+
}
27+
]
28+
}
29+
]
30+
},
31+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
32+
}
33+
]
34+
}
35+
}
36+
}

packages/@aws-cdk/aws-appsync/test/integ.graphql-opensearch.js.snapshot/tree.json

+56-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"encryptionAtRestOptions": {
7171
"enabled": true
7272
},
73-
"engineVersion": "OpenSearch_1.3",
73+
"engineVersion": "OpenSearch_2.3",
7474
"logPublishingOptions": {},
7575
"nodeToNodeEncryptionOptions": {
7676
"enabled": true
@@ -383,12 +383,66 @@
383383
"version": "0.0.0"
384384
}
385385
},
386+
"opensearch-2.3-stack": {
387+
"id": "opensearch-2.3-stack",
388+
"path": "opensearch-2.3-stack",
389+
"children": {
390+
"DefaultTest": {
391+
"id": "DefaultTest",
392+
"path": "opensearch-2.3-stack/DefaultTest",
393+
"children": {
394+
"Default": {
395+
"id": "Default",
396+
"path": "opensearch-2.3-stack/DefaultTest/Default",
397+
"constructInfo": {
398+
"fqn": "constructs.Construct",
399+
"version": "10.1.209"
400+
}
401+
},
402+
"DeployAssert": {
403+
"id": "DeployAssert",
404+
"path": "opensearch-2.3-stack/DefaultTest/DeployAssert",
405+
"children": {
406+
"BootstrapVersion": {
407+
"id": "BootstrapVersion",
408+
"path": "opensearch-2.3-stack/DefaultTest/DeployAssert/BootstrapVersion",
409+
"constructInfo": {
410+
"fqn": "@aws-cdk/core.CfnParameter",
411+
"version": "0.0.0"
412+
}
413+
},
414+
"CheckBootstrapVersion": {
415+
"id": "CheckBootstrapVersion",
416+
"path": "opensearch-2.3-stack/DefaultTest/DeployAssert/CheckBootstrapVersion",
417+
"constructInfo": {
418+
"fqn": "@aws-cdk/core.CfnRule",
419+
"version": "0.0.0"
420+
}
421+
}
422+
},
423+
"constructInfo": {
424+
"fqn": "@aws-cdk/core.Stack",
425+
"version": "0.0.0"
426+
}
427+
}
428+
},
429+
"constructInfo": {
430+
"fqn": "@aws-cdk/integ-tests.IntegTestCase",
431+
"version": "0.0.0"
432+
}
433+
}
434+
},
435+
"constructInfo": {
436+
"fqn": "@aws-cdk/integ-tests.IntegTest",
437+
"version": "0.0.0"
438+
}
439+
},
386440
"Tree": {
387441
"id": "Tree",
388442
"path": "Tree",
389443
"constructInfo": {
390444
"fqn": "constructs.Construct",
391-
"version": "10.1.182"
445+
"version": "10.1.209"
392446
}
393447
}
394448
},

0 commit comments

Comments
 (0)