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

(opensearchservice): example in the doc doesn't work, error received-You must configure zone awareness settings if you turn on zone awareness. #31583

Open
1 task
jwoehrle opened this issue Sep 27, 2024 · 3 comments
Labels
@aws-cdk/aws-opensearch Related to the @aws-cdk/aws-opensearchservice package bug This issue is a bug. documentation This is a problem with documentation. effort/small Small work item – less than a day of effort p3

Comments

@jwoehrle
Copy link
Contributor

Describe the bug

I'm trying to follow the documentation quick-start to create a dev-domain.

For a dev-domain my expectations are that there is only a single AZ used.

This is my stack:

export class OpensearchDashboardAuthStack extends cdk.Stack {
  constructor(scope: Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);
    const devDomain = new os.Domain(this, 'Domain', {
      version: os.EngineVersion.OPENSEARCH_2_15
    });
  }
}

Deployment fails with:

❌ OpensearchDashboardAuthStack failed: Error: The stack named OpensearchDashboardAuthStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "Invalid request provided: You must configure zone awareness settings if you turn on zone awareness. (Service: OpenSearch, Status Code: 400, Request ID: 370df696-de86-4e9a-aaf3-7e319dcff87e)" (RequestToken: d312ed64-2872-6a1a-3172-d10a3a95348d, HandlerErrorCode: InvalidRequest)

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

creation succeeds with a domain in a single AZ.

Current Behavior

creation fails with

❌ OpensearchDashboardAuthStack failed: Error: The stack named OpensearchDashboardAuthStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "Invalid request provided: You must configure zone awareness settings if you turn on zone awareness. (Service: OpenSearch, Status Code: 400, Request ID: 370df696-de86-4e9a-aaf3-7e319dcff87e)" (RequestToken: d312ed64-2872-6a1a-3172-d10a3a95348d, HandlerErrorCode: InvalidRequest)

Reproduction Steps

run cdk deploy with this stack:

export class OpensearchDashboardAuthStack extends cdk.Stack {
  constructor(scope: Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);
    const devDomain = new os.Domain(this, 'Domain', {
      version: os.EngineVersion.OPENSEARCH_2_15
    });
  }
}

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.160.0 (build 7a8ae02)

Framework Version

No response

Node.js Version

v20.9.0

OS

macOS 14.7

Language

TypeScript

Language Version

~5.6.2

Other information

No response

@jwoehrle jwoehrle added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 27, 2024
@github-actions github-actions bot added the @aws-cdk/aws-opensearch Related to the @aws-cdk/aws-opensearchservice package label Sep 27, 2024
@khushail khushail added needs-reproduction This issue needs reproduction. and removed needs-triage This issue or PR still needs to be triaged. labels Sep 27, 2024
@khushail khushail self-assigned this Sep 27, 2024
@khushail khushail added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Sep 27, 2024
@khushail
Copy link
Contributor

Hi @jwoehrle , thanks for reaching out.

This issue is reproducible . however what I observed while running the code -

    const devDomain = new Domain(this, 'Domain', {
      version: EngineVersion.OPENSEARCH_2_15,
    });
    
    new cdk.CfnOutput(this, 'DomainEndpoint', { value: devDomain.domainEndpoint });
  }

the synthesized template has this zoneAwareness set to false which makes sense as its not mandatory-

"Resources": {
  "Domain66AC69E0": {
   "Type": "AWS::OpenSearchService::Domain",
   "Properties": {
    "ClusterConfig": {
     "DedicatedMasterEnabled": false,
     "InstanceCount": 1,
     "InstanceType": "r5.large.search",
     "MultiAZWithStandbyEnabled": true,
     "ZoneAwarenessEnabled": false
    },
    "DomainEndpointOptions": {
     "EnforceHTTPS": false,
     "TLSSecurityPolicy": "Policy-Min-TLS-1-0-2019-07"
    },
    "EBSOptions": {
     "EBSEnabled": true,
     "VolumeSize": 10,
     "VolumeType": "gp2"
    },
    "EncryptionAtRestOptions": {
     "Enabled": false
    },
    "EngineVersion": "OpenSearch_2.15",
    "LogPublishingOptions": {},
    "NodeToNodeEncryptionOptions": {
     "Enabled": false
    }
   },
   "UpdateReplacePolicy": "Retain",
   "DeletionPolicy": "Retain",
   "Metadata": {
    "aws:cdk:path": "OpenSearchIssueStack/Domain/Resource"
   }
  },

I found previous similar issue -#29346 where a workaround has been suggested -#29346 (comment)

Could you please check and confirm if this reported issue is similar and proposed workaround is working for you?

Thanks

@khushail khushail added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p3 and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-reproduction This issue needs reproduction. labels Sep 27, 2024
@jwoehrle
Copy link
Contributor Author

Hi @khushail ,

thanks for reaching out. Yes, #29346 is similar, however it seems like in #29346 multiple subnets might be specified which will not work with zone awareness.
Also the particular issue here is, that I'm trying to follow an example directly from the documentation which shouldn't fail.

I can confirm, that manually configuring the dataNodes as 1 and the masterNodes with 0 is a valid workaround.

Here's my complete version:

const devDomain = new os.Domain(this, 'Domain', {
      version: os.EngineVersion.OPENSEARCH_2_15,
      enableVersionUpgrade: true,
      enableAutoSoftwareUpdate: true,
      nodeToNodeEncryption: true,
      enforceHttps: true,
      encryptionAtRest: { enabled: true },
      ebs: {
        volumeSize: 30,
        volumeType: ec2.EbsDeviceVolumeType.GP3,
        throughput: 125,
        iops: 3000,
      },
      capacity: {
        dataNodeInstanceType: 'm6g.large.search',
        multiAzWithStandbyEnabled: false,
        masterNodes: 0,
        dataNodes: 1,
      },
      zoneAwareness: {
        enabled: false,
      },
     ...
      },
    });

@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Oct 1, 2024
@khushail
Copy link
Contributor

khushail commented Oct 2, 2024

thanks for the confirmation @jwoehrle . Since this issue is similar to #29346, I would be marking current one as documentation enhancement and would keep the original past issue as main for bug resolution.

Hope that makes sense! if you would like to add any information to #29346, please feel free to do so. Let me know if you any further questions.

@khushail khushail added documentation This is a problem with documentation. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Oct 2, 2024
@khushail khushail changed the title (opensearchservice): trying to create dev cluster as documented yields You must configure zone awareness settings if you turn on zone awareness. (opensearchservice): example in the doc doesn't work, error received-You must configure zone awareness settings if you turn on zone awareness. Oct 2, 2024
@khushail khushail removed their assignment Oct 2, 2024
@khushail khushail added the effort/small Small work item – less than a day of effort label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-opensearch Related to the @aws-cdk/aws-opensearchservice package bug This issue is a bug. documentation This is a problem with documentation. effort/small Small work item – less than a day of effort p3
Projects
None yet
Development

No branches or pull requests

2 participants