Skip to content
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

feat(opensearchservice): support for MultiAZWithStandBy (under feature flag) #26082

Merged
merged 16 commits into from
Jul 17, 2023

Conversation

lpizzinidev
Copy link
Contributor

@lpizzinidev lpizzinidev commented Jun 22, 2023

This fix adds support for the MultiAZWithStandbyEnabled flag to the CapacityConfig interface.

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

Closes #26026.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Jun 22, 2023

@aws-cdk-automation aws-cdk-automation requested a review from a team June 22, 2023 09:05
@github-actions github-actions bot added admired-contributor [Pilot] contributed between 13-24 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 labels Jun 22, 2023
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@lpizzinidev
Copy link
Contributor Author

Exemption Request.
Let me know if I should make changes to integration tests.

@aws-cdk-automation aws-cdk-automation added pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Jun 22, 2023
Copy link
Contributor

@corymhall corymhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do need an integration test for this to ensure that we can create a domain
with this enabled (I don't think it will create currently).

I think we will also need a README entry that covers the requirements and
migration. Ideally we probably want a feature flag that will allow us to set
this to true by default (unless there is a reason that this shouldn't be the
default).

@@ -1556,6 +1566,7 @@ export class Domain extends DomainBase implements IDomain, ec2.IConnectable {
: undefined,
instanceCount,
instanceType,
multiAzWithStandbyEnabled,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
multiAzWithStandbyEnabled,
multiAzWithStandbyEnabled: props.capacity?.multiAzWithStandbyEnabled,

I don't think there is any reason to explicitly set this to false.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a feature flag that defaults multiAzWithStandbyEnabled to true.
This is causing some integration tests to fail.
Let me know if the implementation is correct so I can proceed to fix the failing tests.

@corymhall corymhall removed pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. labels Jun 27, 2023
@lpizzinidev lpizzinidev changed the title fix(opensearchservice): missing support for MultiAZWithStandBy feature feat(opensearchservice): missing support for MultiAZWithStandBy (under feature flag) Jun 29, 2023
@aws-cdk-automation aws-cdk-automation dismissed their stale review June 29, 2023 16:34

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@mergify mergify bot dismissed corymhall’s stale review June 29, 2023 16:38

Pull request has been modified.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@AmanRajAWS
Copy link

@lpizzinidev hey what are the current issues that you are blocked upon please let me know if you need any help with getting unblocked

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jul 10, 2023
@mrgrain mrgrain changed the title feat(opensearchservice): missing support for MultiAZWithStandBy (under feature flag) feat(opensearchservice): add support for MultiAZWithStandBy (under feature flag) Jul 17, 2023
mrgrain
mrgrain previously approved these changes Jul 17, 2023
@mrgrain mrgrain changed the title feat(opensearchservice): add support for MultiAZWithStandBy (under feature flag) feat(opensearchservice): support for MultiAZWithStandBy (under feature flag) Jul 17, 2023
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jul 17, 2023
@mergify
Copy link
Contributor

mergify bot commented Jul 17, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mrgrain
Copy link
Contributor

mrgrain commented Jul 17, 2023

@lpizzinidev Failing example otherwise this is good to go, should be an easy fix!

@mergify mergify bot dismissed mrgrain’s stale review July 17, 2023 15:57

Pull request has been modified.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: d9d2142
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jul 17, 2023
@mergify
Copy link
Contributor

mergify bot commented Jul 17, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 6c75581 into aws:main Jul 17, 2023
8 checks passed
bmoffatt pushed a commit to bmoffatt/aws-cdk that referenced this pull request Jul 29, 2023
…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*
mergify bot pushed a commit that referenced this pull request Mar 28, 2024
…with standby feature (#29607)

### Issue # (if applicable)
Related with #26026

### Reason for this change

#26082 enabled Multi-AZ with Standby by default, but deployment fails if we use t3 instance type, because it does not support the feature. To fail fast, this PR adds validation on synth time.

> Multi-AZ with Standby only works with the m5, c5, r5, r6g, c6g, m6g, r6gd and i3 instance types.
> https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-multiaz.html

> You can use T3 instance types only if your domain is provisioned without standby.
> https://docs.aws.amazon.com/opensearch-service/latest/developerguide/supported-instance-types.html#latest-gen

### Description of changes

If the instance type of data node or master node is t3, throws an error.

I also considered to automatically set `multiAzWithStandbyEnabled: false` if we detect any t3 instance type, but it would introduce unwanted behavior e.g. in the below case:

```ts
// Initial state
// multiAzWithStandbyEnabled: true as there's no t3 instance type
 new Domain(stack, 'Domain', {
    version: engineVersion,
    capacity: {
      dataNodeInstanceType: 'r5.large.search',
    },
})

// Update domain to add master nodes with t3 instance type
new Domain(stack, 'Domain', {
    version: engineVersion,
    capacity: {
      dataNodeInstanceType: 'r5.large.search',
      masterNodeInstanceType: 't3.medium.search',
      masterNodes: 3,
    },
})

// multiAzWithStandbyEnabled suddenly become false!
```

so we just throw an error.

### Description of how you validated changes

Added some unit tests.

I also confirmed that it results in deployment error if we try to deploy with t3 instance type & `multiAzWithStandbyEnabled : true` for both data node and master node.

### Checklist
- [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admired-contributor [Pilot] contributed between 13-24 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Amazon OpenSearch Service: High Level Constructs For OpenSearch MultiAZWithStandBy Feature
5 participants