diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/OpenSearchNodeOptionsIntegDefaultTestDeployAssert9170FAD5.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/OpenSearchNodeOptionsIntegDefaultTestDeployAssert9170FAD5.assets.json new file mode 100644 index 0000000000000..274572cb2c16e --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/OpenSearchNodeOptionsIntegDefaultTestDeployAssert9170FAD5.assets.json @@ -0,0 +1,19 @@ +{ + "version": "39.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "OpenSearchNodeOptionsIntegDefaultTestDeployAssert9170FAD5.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/OpenSearchNodeOptionsIntegDefaultTestDeployAssert9170FAD5.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/OpenSearchNodeOptionsIntegDefaultTestDeployAssert9170FAD5.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/OpenSearchNodeOptionsIntegDefaultTestDeployAssert9170FAD5.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/cdk-integ-os-nodeoptions.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/cdk-integ-os-nodeoptions.assets.json new file mode 100644 index 0000000000000..95a5fd21ca55e --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/cdk-integ-os-nodeoptions.assets.json @@ -0,0 +1,19 @@ +{ + "version": "39.0.0", + "files": { + "841f94e8b8875cf7deec9fdbd93058b17c7fee86825e9c21142ed67a158fc11d": { + "source": { + "path": "cdk-integ-os-nodeoptions.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "841f94e8b8875cf7deec9fdbd93058b17c7fee86825e9c21142ed67a158fc11d.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/cdk-integ-os-nodeoptions.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/cdk-integ-os-nodeoptions.template.json new file mode 100644 index 0000000000000..7d00ee57c87d5 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/cdk-integ-os-nodeoptions.template.json @@ -0,0 +1,84 @@ +{ + "Resources": { + "Domain19FCBCB91": { + "Type": "AWS::OpenSearchService::Domain", + "Properties": { + "ClusterConfig": { + "DedicatedMasterCount": 3, + "DedicatedMasterEnabled": true, + "DedicatedMasterType": "r5.large.search", + "InstanceCount": 2, + "InstanceType": "r5.large.search", + "MultiAZWithStandbyEnabled": false, + "NodeOptions": [ + { + "NodeConfig": { + "Count": 2, + "Enabled": true, + "Type": "m5.large.search" + }, + "NodeType": "coordinator" + } + ], + "ZoneAwarenessConfig": { + "AvailabilityZoneCount": 2 + }, + "ZoneAwarenessEnabled": true + }, + "DomainEndpointOptions": { + "EnforceHTTPS": false, + "TLSSecurityPolicy": "Policy-Min-TLS-1-0-2019-07" + }, + "EBSOptions": { + "EBSEnabled": true, + "VolumeSize": 10, + "VolumeType": "gp3" + }, + "EncryptionAtRestOptions": { + "Enabled": false + }, + "EngineVersion": "OpenSearch_2.15", + "LogPublishingOptions": {}, + "NodeToNodeEncryptionOptions": { + "Enabled": false + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/cdk.out new file mode 100644 index 0000000000000..91e1a8b9901d5 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"39.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/integ.json new file mode 100644 index 0000000000000..c8d57ad79e78e --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/integ.json @@ -0,0 +1,13 @@ +{ + "version": "39.0.0", + "testCases": { + "OpenSearchNodeOptionsInteg/DefaultTest": { + "stacks": [ + "cdk-integ-os-nodeoptions" + ], + "diffAssets": true, + "assertionStack": "OpenSearchNodeOptionsInteg/DefaultTest/DeployAssert", + "assertionStackName": "OpenSearchNodeOptionsIntegDefaultTestDeployAssert9170FAD5" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/manifest.json new file mode 100644 index 0000000000000..63a44c589e65c --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/manifest.json @@ -0,0 +1,248 @@ +{ + "version": "39.0.0", + "artifacts": { + "cdk-integ-os-nodeoptions.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "cdk-integ-os-nodeoptions.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "cdk-integ-os-nodeoptions": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "cdk-integ-os-nodeoptions.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/841f94e8b8875cf7deec9fdbd93058b17c7fee86825e9c21142ed67a158fc11d.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "cdk-integ-os-nodeoptions.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "cdk-integ-os-nodeoptions.assets" + ], + "metadata": { + "/cdk-integ-os-nodeoptions/Domain1/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Domain19FCBCB91" + } + ], + "/cdk-integ-os-nodeoptions/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/cdk-integ-os-nodeoptions/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ], + "Domain1SlowSearchLogs8F3B0506": [ + { + "type": "aws:cdk:logicalId", + "data": "Domain1SlowSearchLogs8F3B0506", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "Domain1AppLogs6E8D1D67": [ + { + "type": "aws:cdk:logicalId", + "data": "Domain1AppLogs6E8D1D67", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "Domain1ESLogGroupPolicyc82103d315af08fd492d5959fa1ce2ba13cd9fb8bdA836E010": [ + { + "type": "aws:cdk:logicalId", + "data": "Domain1ESLogGroupPolicyc82103d315af08fd492d5959fa1ce2ba13cd9fb8bdA836E010", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "Domain1ESLogGroupPolicyc82103d315af08fd492d5959fa1ce2ba13cd9fb8bdCustomResourcePolicy9674E09B": [ + { + "type": "aws:cdk:logicalId", + "data": "Domain1ESLogGroupPolicyc82103d315af08fd492d5959fa1ce2ba13cd9fb8bdCustomResourcePolicy9674E09B", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "Domain1AccessPolicy1FDDB3CF": [ + { + "type": "aws:cdk:logicalId", + "data": "Domain1AccessPolicy1FDDB3CF", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "Domain1AccessPolicyCustomResourcePolicy3BA04487": [ + { + "type": "aws:cdk:logicalId", + "data": "Domain1AccessPolicyCustomResourcePolicy3BA04487", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2": [ + { + "type": "aws:cdk:logicalId", + "data": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "AWS679f53fac002430cb0da5b7982bd22872D164C4C": [ + { + "type": "aws:cdk:logicalId", + "data": "AWS679f53fac002430cb0da5b7982bd22872D164C4C", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "Domain2SlowSearchLogs0C75F64B": [ + { + "type": "aws:cdk:logicalId", + "data": "Domain2SlowSearchLogs0C75F64B", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "Domain2AppLogs810876E2": [ + { + "type": "aws:cdk:logicalId", + "data": "Domain2AppLogs810876E2", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "Domain2ESLogGroupPolicyc8cdb6a7a745c4806c45498fbb5a4cf43355209e17E0B07870": [ + { + "type": "aws:cdk:logicalId", + "data": "Domain2ESLogGroupPolicyc8cdb6a7a745c4806c45498fbb5a4cf43355209e17E0B07870", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "Domain2ESLogGroupPolicyc8cdb6a7a745c4806c45498fbb5a4cf43355209e17CustomResourcePolicy1A267551": [ + { + "type": "aws:cdk:logicalId", + "data": "Domain2ESLogGroupPolicyc8cdb6a7a745c4806c45498fbb5a4cf43355209e17CustomResourcePolicy1A267551", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "Domain2644FE48C": [ + { + "type": "aws:cdk:logicalId", + "data": "Domain2644FE48C", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "Domain2AccessPolicyB81CB6CE": [ + { + "type": "aws:cdk:logicalId", + "data": "Domain2AccessPolicyB81CB6CE", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "Domain2AccessPolicyCustomResourcePolicy7C8260FD": [ + { + "type": "aws:cdk:logicalId", + "data": "Domain2AccessPolicyCustomResourcePolicy7C8260FD", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ] + }, + "displayName": "cdk-integ-os-nodeoptions" + }, + "OpenSearchNodeOptionsIntegDefaultTestDeployAssert9170FAD5.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "OpenSearchNodeOptionsIntegDefaultTestDeployAssert9170FAD5.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "OpenSearchNodeOptionsIntegDefaultTestDeployAssert9170FAD5": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "OpenSearchNodeOptionsIntegDefaultTestDeployAssert9170FAD5.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "OpenSearchNodeOptionsIntegDefaultTestDeployAssert9170FAD5.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "OpenSearchNodeOptionsIntegDefaultTestDeployAssert9170FAD5.assets" + ], + "metadata": { + "/OpenSearchNodeOptionsInteg/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/OpenSearchNodeOptionsInteg/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "OpenSearchNodeOptionsInteg/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/tree.json new file mode 100644 index 0000000000000..fa4655037c311 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.js.snapshot/tree.json @@ -0,0 +1,163 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "cdk-integ-os-nodeoptions": { + "id": "cdk-integ-os-nodeoptions", + "path": "cdk-integ-os-nodeoptions", + "children": { + "Domain1": { + "id": "Domain1", + "path": "cdk-integ-os-nodeoptions/Domain1", + "children": { + "Resource": { + "id": "Resource", + "path": "cdk-integ-os-nodeoptions/Domain1/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::OpenSearchService::Domain", + "aws:cdk:cloudformation:props": { + "clusterConfig": { + "dedicatedMasterEnabled": true, + "dedicatedMasterCount": 3, + "dedicatedMasterType": "r5.large.search", + "instanceCount": 2, + "instanceType": "r5.large.search", + "multiAzWithStandbyEnabled": false, + "zoneAwarenessEnabled": true, + "zoneAwarenessConfig": { + "availabilityZoneCount": 2 + }, + "nodeOptions": [ + { + "nodeType": "coordinator", + "nodeConfig": { + "enabled": true, + "count": 2, + "type": "m5.large.search" + } + } + ] + }, + "domainEndpointOptions": { + "enforceHttps": false, + "tlsSecurityPolicy": "Policy-Min-TLS-1-0-2019-07" + }, + "ebsOptions": { + "ebsEnabled": true, + "volumeSize": 10, + "volumeType": "gp3" + }, + "encryptionAtRestOptions": { + "enabled": false + }, + "engineVersion": "OpenSearch_2.15", + "logPublishingOptions": {}, + "nodeToNodeEncryptionOptions": { + "enabled": false + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_opensearchservice.CfnDomain", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_opensearchservice.Domain", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cdk-integ-os-nodeoptions/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cdk-integ-os-nodeoptions/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "OpenSearchNodeOptionsInteg": { + "id": "OpenSearchNodeOptionsInteg", + "path": "OpenSearchNodeOptionsInteg", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "OpenSearchNodeOptionsInteg/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "OpenSearchNodeOptionsInteg/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "OpenSearchNodeOptionsInteg/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "OpenSearchNodeOptionsInteg/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "OpenSearchNodeOptionsInteg/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "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.nodeoptions.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.ts new file mode 100644 index 0000000000000..d05faeb10374d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-opensearchservice/test/integ.opensearch.nodeoptions.ts @@ -0,0 +1,50 @@ +import { EbsDeviceVolumeType } from 'aws-cdk-lib/aws-ec2'; +import { App, RemovalPolicy, Stack, StackProps } from 'aws-cdk-lib'; +import { Construct } from 'constructs'; +import * as opensearch from 'aws-cdk-lib/aws-opensearchservice'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; + +class TestStack extends Stack { + constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + + const domainProps: opensearch.DomainProps = { + removalPolicy: RemovalPolicy.DESTROY, + version: opensearch.EngineVersion.OPENSEARCH_2_15, + ebs: { + volumeSize: 10, + volumeType: EbsDeviceVolumeType.GP3, + }, + capacity: { + multiAzWithStandbyEnabled: false, + masterNodes: 3, + dataNodes: 2, + nodeOptions: [ + { + nodeType: opensearch.NodeType.COORDINATOR, + nodeConfig: { + enabled: true, + count: 2, + type: 'm5.large.search', + }, + }, + ], + }, + zoneAwareness: { + enabled: true, + availabilityZoneCount: 2, + }, + }; + + new opensearch.Domain(this, 'Domain1', domainProps); + } +} + +const app = new App(); +const stack = new TestStack(app, 'cdk-integ-os-nodeoptions'); + +new IntegTest(app, 'OpenSearchNodeOptionsInteg', { + testCases: [stack], + diffAssets: true, +}); +app.synth(); diff --git a/packages/aws-cdk-lib/aws-opensearchservice/README.md b/packages/aws-cdk-lib/aws-opensearchservice/README.md index dcff581a78857..ee0015f0288c7 100644 --- a/packages/aws-cdk-lib/aws-opensearchservice/README.md +++ b/packages/aws-cdk-lib/aws-opensearchservice/README.md @@ -533,3 +533,29 @@ const domain = new Domain(this, 'Domain', { ipAddressType: IpAddressType.DUAL_STACK, }); ``` + +## Using Coordinator node with NodeOptions + +You can specify coordinator as a valid value for node type. + +> Visit [Dedicated coordinator nodes in Amazon OpenSearch Service](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/Dedicated-coordinator-nodes.html) for more details. + +```ts +import * as opensearch from 'aws-cdk-lib/aws-opensearchservice'; + +const domain = new Domain(this, 'Domain', { + version: EngineVersion.OPENSEARCH_1_3, + capacity: { + nodeOptions: [ + { + nodeType: opensearch.NodeType.COORDINATOR, + nodeConfig: { + enabled: true, + count: 2, + type: 'm5.large.search', + }, + }, + ], + }, +}) +``` diff --git a/packages/aws-cdk-lib/aws-opensearchservice/lib/domain.ts b/packages/aws-cdk-lib/aws-opensearchservice/lib/domain.ts index 24c68a7f2e9f6..285f447741f8f 100644 --- a/packages/aws-cdk-lib/aws-opensearchservice/lib/domain.ts +++ b/packages/aws-cdk-lib/aws-opensearchservice/lib/domain.ts @@ -83,6 +83,13 @@ export interface CapacityConfig { * is true, no multi-az with standby otherwise */ readonly multiAzWithStandbyEnabled?: boolean; + + /** + * Additional node options for the domain + * + * @default - no additional node options + */ + readonly nodeOptions?: NodeOptions[]; } /** @@ -381,7 +388,7 @@ export interface AdvancedSecurityOptions { /** * Container for information about the SAML configuration for OpenSearch Dashboards. - * If set, `samlAuthenticationEnabled` will be enabled. + * If set, `samlAuthenticationEnabled` will be enabled. * * @default - no SAML authentication options */ @@ -440,6 +447,58 @@ export enum IpAddressType { DUAL_STACK = 'dualstack', } +/** + * Configuration for a specific node type in OpenSearch domain + */ +export interface NodeConfig { + /** + * Whether this node type is enabled + * + * @default - false + */ + readonly enabled?: boolean; + + /** + * The instance type for the nodes + * + * @default - m5.large.search + */ + readonly type?: string; + + /** + * The number of nodes of this type + * + * @default - 1 + */ + readonly count?: number; +} + +/** + * NodeType is a string enum of the node types in OpenSearch domain + * + */ +export enum NodeType { + /** + * Coordinator node type + */ + COORDINATOR = 'coordinator', +} + +/** + * Configuration for node options in OpenSearch domain + */ +export interface NodeOptions { + /** + * The type of node. Currently only 'coordinator' is supported. + */ + readonly nodeType: NodeType; + + /** + * Configuration for the node type + */ + readonly nodeConfig: NodeConfig; +} + /** * Properties for an Amazon OpenSearch Service domain. */ @@ -1396,6 +1455,7 @@ export class Domain extends DomainBase implements IDomain, ec2.IConnectable { const defaultInstanceType = 'r5.large.search'; const warmDefaultInstanceType = 'ultrawarm1.medium.search'; + const defaultCoordinatorInstanceType = 'm5.large.search'; const dedicatedMasterType = initializeInstanceType(defaultInstanceType, props.capacity?.masterNodeInstanceType); const dedicatedMasterCount = props.capacity?.masterNodes ?? 0; @@ -1863,6 +1923,20 @@ export class Domain extends DomainBase implements IDomain, ec2.IConnectable { this.validateSamlAuthenticationOptions(props.fineGrainedAccessControl?.samlAuthenticationOptions); } + if (props.capacity?.nodeOptions) { + // Validate coordinator node configuration + const coordinatorConfig = props.capacity.nodeOptions.find(opt => opt.nodeType === NodeType.COORDINATOR)?.nodeConfig; + if (coordinatorConfig?.enabled) { + const coordinatorType = initializeInstanceType(defaultCoordinatorInstanceType, coordinatorConfig.type); + if (!cdk.Token.isUnresolved(coordinatorType) && !coordinatorType.endsWith('.search')) { + throw new Error('Coordinator node instance type must end with ".search".'); + } + if (coordinatorConfig.count !== undefined && coordinatorConfig.count < 1) { + throw new Error('Coordinator node count must be at least 1.'); + } + } + } + // Create the domain this.domain = new CfnDomain(this, 'Resource', { domainName: this.physicalName, @@ -1894,6 +1968,7 @@ export class Domain extends DomainBase implements IDomain, ec2.IConnectable { zoneAwarenessConfig: zoneAwarenessEnabled ? { availabilityZoneCount } : undefined, + nodeOptions: props.capacity?.nodeOptions, }, ebsOptions: { ebsEnabled, 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 e806ef5b84f4f..2231d4ab33200 100644 --- a/packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts +++ b/packages/aws-cdk-lib/aws-opensearchservice/test/domain.test.ts @@ -10,7 +10,7 @@ import * as logs from '../../aws-logs'; import * as route53 from '../../aws-route53'; import { App, Stack, Duration, SecretValue, CfnParameter, Token } from '../../core'; import * as cxapi from '../../cx-api'; -import { Domain, DomainProps, EngineVersion, IpAddressType } from '../lib'; +import { Domain, DomainProps, EngineVersion, IpAddressType, NodeOptions } from '../lib'; let app: App; let stack: Stack; @@ -2676,3 +2676,94 @@ function testMetric( }); expect(metric.dimensions).toHaveProperty('DomainName'); } + +each(testedOpenSearchVersions).test('can configure coordinator nodes with nodeOptions', (engineVersion) => { + const coordinatorConfig: NodeOptions = { + nodeType: 'coordinator', + nodeConfig: { + enabled: true, + type: 'm5.large.search', + count: 2, + }, + }; + + const domain = new Domain(stack, 'Domain', { + version: engineVersion, + capacity: { + nodeOptions: [coordinatorConfig], + }, + }); + + Template.fromStack(stack).hasResourceProperties('AWS::OpenSearchService::Domain', { + ClusterConfig: { + NodeOptions: [{ + NodeType: 'coordinator', + NodeConfig: { + Enabled: true, + Type: 'm5.large.search', + Count: 2, + }, + }], + }, + }); +}); + +each(testedOpenSearchVersions).test('throws when coordinator node instance type does not end with .search', (engineVersion) => { + expect(() => { + new Domain(stack, 'Domain', { + version: engineVersion, + capacity: { + nodeOptions: [{ + nodeType: 'coordinator' as const, + nodeConfig: { + enabled: true, + type: 'm5.large', + }, + }], + }, + }); + }).toThrow('Coordinator node instance type must end with ".search".'); +}); + +each(testedOpenSearchVersions).test('throws when coordinator node count is less than 1', (engineVersion) => { + expect(() => { + new Domain(stack, 'Domain', { + version: engineVersion, + capacity: { + nodeOptions: [{ + nodeType: 'coordinator' as const, + nodeConfig: { + enabled: true, + count: 0, + type: 'm5.large.search', + }, + }], + }, + }); + }).toThrow('Coordinator node count must be at least 1.'); +}); + +each(testedOpenSearchVersions).test('can disable coordinator nodes', (engineVersion) => { + const domain = new Domain(stack, 'Domain', { + version: engineVersion, + capacity: { + nodeOptions: [{ + nodeType: 'coordinator' as const, + nodeConfig: { + enabled: false, + }, + }], + }, + }); + + Template.fromStack(stack).hasResourceProperties('AWS::OpenSearchService::Domain', { + ClusterConfig: { + NodeOptions: [{ + NodeType: 'coordinator', + NodeConfig: { + Enabled: false, + }, + }], + }, + }); +});