Skip to content

Commit

Permalink
feat(opensearchservice): support for MultiAZWithStandBy (under featur…
Browse files Browse the repository at this point in the history
…e flag) (aws#26082)

This fix adds support for the [`MultiAZWithStandbyEnabled`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opensearchservice-domain-clusterconfig.html#:~:text=%3A%20No%20interruption-,MultiAZWithStandbyEnabled,Update%20requires%3A%20No%20interruption,-WarmCount) flag to the [`CapacityConfig`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_opensearchservice.CapacityConfig.html) interface.

If enabled, the `ENABLE_OPENSEARCH_MULTIAZ_WITH_STANDBY` feature flag set the default value of `MultiAZWithStandbyEnabled` to `true`

Closes aws#26026.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
lpizzinidev authored and bmoffatt committed Jul 28, 2023
1 parent 9fa6e50 commit dcd0e95
Show file tree
Hide file tree
Showing 32 changed files with 604 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"DedicatedMasterEnabled": false,
"InstanceCount": 1,
"InstanceType": "r5.large.search",
"ZoneAwarenessEnabled": false
"ZoneAwarenessEnabled": false,
"MultiAZWithStandbyEnabled": false
},
"DomainEndpointOptions": {
"EnforceHTTPS": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class OpensSearch23Stack extends cdk.Stack {
},
nodeToNodeEncryption: true,
enforceHttps: true,
capacity: {
multiAzWithStandbyEnabled: false,
},
});

const api = new appsync.GraphqlApi(this, 'api', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"DedicatedMasterEnabled": false,
"InstanceCount": 1,
"InstanceType": "r5.large.search",
"ZoneAwarenessEnabled": false
"ZoneAwarenessEnabled": false,
"MultiAZWithStandbyEnabled": false
},
"DomainEndpointOptions": {
"EnforceHTTPS": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class TestStack extends Stack {
},
nodeToNodeEncryption: true,
enforceHttps: true,
capacity: {
multiAzWithStandbyEnabled: false,
},
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@
"DedicatedMasterEnabled": false,
"InstanceCount": 1,
"InstanceType": "r5.large.search",
"ZoneAwarenessEnabled": false
"ZoneAwarenessEnabled": false,
"MultiAZWithStandbyEnabled": false
},
"CognitoOptions": {
"Enabled": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class TestStack extends Stack {
identityPoolId: identityPool.ref,
userPoolId: userPool.userPoolId,
},
capacity: {
multiAzWithStandbyEnabled: false,
},
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"DedicatedMasterEnabled": false,
"InstanceCount": 1,
"InstanceType": "r5.large.search",
"ZoneAwarenessEnabled": false
"ZoneAwarenessEnabled": false,
"MultiAZWithStandbyEnabled": false
},
"DomainEndpointOptions": {
"EnforceHTTPS": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class TestStack extends Stack {
resources: ['*'],
}),
],
capacity: {
multiAzWithStandbyEnabled: false,
},
};

new opensearch.Domain(this, 'Domain', domainProps);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@
"DedicatedMasterEnabled": false,
"InstanceCount": 1,
"InstanceType": "r5.large.search",
"ZoneAwarenessEnabled": false
"ZoneAwarenessEnabled": false,
"MultiAZWithStandbyEnabled": false
},
"DomainEndpointOptions": {
"EnforceHTTPS": false,
Expand Down Expand Up @@ -419,7 +420,8 @@
"DedicatedMasterEnabled": false,
"InstanceCount": 1,
"InstanceType": "r5.large.search",
"ZoneAwarenessEnabled": false
"ZoneAwarenessEnabled": false,
"MultiAZWithStandbyEnabled": false
},
"DomainEndpointOptions": {
"EnforceHTTPS": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"DedicatedMasterEnabled": false,
"InstanceCount": 1,
"InstanceType": "r5.large.search",
"ZoneAwarenessEnabled": false
"ZoneAwarenessEnabled": false,
"MultiAZWithStandbyEnabled": false
},
"DomainEndpointOptions": {
"EnforceHTTPS": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class TestStack extends Stack {
const domainProps: opensearch.DomainProps = {
version: opensearch.EngineVersion.OPENSEARCH_2_7,
removalPolicy: RemovalPolicy.DESTROY,
capacity: {
multiAzWithStandbyEnabled: false,
},
};

new opensearch.Domain(this, 'Domain', domainProps);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "32.0.0",
"files": {
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
"source": {
"path": "IntegOpenSearchMultiAzWithStandbyDefaultTestDeployAssertFD2E7982.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": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"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."
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "32.0.0",
"files": {
"722892555255764f20f275e929016594c8562b137bbdfb5df2a004c9565301df": {
"source": {
"path": "cdk-integ-opensearch-multiaz-with-standby.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "722892555255764f20f275e929016594c8562b137bbdfb5df2a004c9565301df.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
}
},
"dockerImages": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"Resources": {
"Domain66AC69E0": {
"Type": "AWS::OpenSearchService::Domain",
"Properties": {
"ClusterConfig": {
"DedicatedMasterCount": 3,
"DedicatedMasterEnabled": true,
"DedicatedMasterType": "r5.large.search",
"InstanceCount": 3,
"InstanceType": "r5.large.search",
"MultiAZWithStandbyEnabled": true,
"ZoneAwarenessConfig": {
"AvailabilityZoneCount": 3
},
"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_1.3",
"LogPublishingOptions": {},
"NodeToNodeEncryptionOptions": {
"Enabled": false
}
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"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."
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"32.0.0"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "32.0.0",
"testCases": {
"IntegOpenSearchMultiAzWithStandby/DefaultTest": {
"stacks": [
"cdk-integ-opensearch-multiaz-with-standby"
],
"assertionStack": "IntegOpenSearchMultiAzWithStandby/DefaultTest/DeployAssert",
"assertionStackName": "IntegOpenSearchMultiAzWithStandbyDefaultTestDeployAssertFD2E7982"
}
}
}
Loading

0 comments on commit dcd0e95

Please sign in to comment.