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

(opensearch): missing validation on domainName property #17016

Closed
nom3ad opened this issue Oct 16, 2021 · 1 comment · Fixed by #17017
Closed

(opensearch): missing validation on domainName property #17016

nom3ad opened this issue Oct 16, 2021 · 1 comment · Fixed by #17017
Assignees
Labels
@aws-cdk/aws-opensearch Related to the @aws-cdk/aws-opensearchservice package bug This issue is a bug. effort/small Small work item – less than a day of effort p2

Comments

@nom3ad
Copy link
Contributor

nom3ad commented Oct 16, 2021

What is the problem?

Currently, opensearch.Domain allows any string value to be used as domainName, this could fail CloudFormation deployment

Reproduction Steps

 new opensearch.Domain(stack, 'Domain', {
     version: opensearch.EngineVersion.OPENSEARCH_1_0,
     domainName: "InvalidName"
 });

What did you expect to happen?

CDK should not allow invalid domain name

What actually happened?

CloudFormation deployment failed:

validation error detected: Value 'InvalidName' at 'domainName' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-z][a-z0-9\-]+

CDK CLI Version

1.124.0 (build 65761fe)

Framework Version

No response

Node.js Version

v14.17.4

OS

Ubuntu

Language

Typescript

Language Version

No response

Other information

No response

@nom3ad nom3ad added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 16, 2021
@github-actions github-actions bot added the @aws-cdk/aws-opensearch Related to the @aws-cdk/aws-opensearchservice package label Oct 16, 2021
@kaizencc kaizencc added effort/small Small work item – less than a day of effort p2 and removed needs-triage This issue or PR still needs to be triaged. labels Oct 18, 2021
@mergify mergify bot closed this as completed in #17017 Oct 19, 2021
mergify bot pushed a commit that referenced this issue Oct 19, 2021
Add validation to domainName property as per  https://docs.aws.amazon.com/opensearch-service/latest/developerguide/configuration-api.html#configuration-api-datatypes-domainname

Fixes #17016 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this issue Feb 21, 2022
Add validation to domainName property as per  https://docs.aws.amazon.com/opensearch-service/latest/developerguide/configuration-api.html#configuration-api-datatypes-domainname

Fixes aws#17016 

----

*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
@aws-cdk/aws-opensearch Related to the @aws-cdk/aws-opensearchservice package bug This issue is a bug. effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants