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): When a Domain has enforceHttps true, set the connections defaultPort #20602

Merged
merged 5 commits into from
Jun 13, 2022

Conversation

SamStephens
Copy link
Contributor

@SamStephens SamStephens commented Jun 3, 2022

For an Opensearch domain, if enforceHttps is enabled, set the defaultPort for the connections object of the domain, as we know it communicates over 443 in this scenario.

I also took the liberty of correcting a test title while I was in the code, I hope it's okay coupling that fix with this change.

closes #16251


All Submissions:

Adding new Unconventional Dependencies:

  • This PR adds new unconventional dependencies following the process described here

New Features

It doesn't seem that an integration test is a good fit here, as this simply changes/simplifies how you'll create a connection to a Domain. I'm happy to be corrected however and will add one if asked.

  • Have you added the new feature to an integration test?
    • Did you use yarn integ to deploy the infrastructure and generate the snapshot (i.e. yarn integ without --dry-run)?

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

For an Opensearch domain, if enforceHttps is enabled, set the
defaultPort for the connections object of the domain, as we know
it communicates over 443 in this scenario.
The title of one of the tests should say "connections throws if
domain is *not* placed inside a vpc".
@gitpod-io
Copy link

gitpod-io bot commented Jun 3, 2022

@aws-cdk-automation aws-cdk-automation requested a review from a team June 3, 2022 05:56
@github-actions github-actions bot added p2 effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. labels Jun 3, 2022
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.

@SamStephens does it make sense to also set the default port if enforceHttps is not set? I can't find much information on ports with opensearch except for this which mentions only 80 & 443.

thoughts?

@SamStephens
Copy link
Contributor Author

SamStephens commented Jun 3, 2022

corymhall said:

@SamStephens does it make sense to also set the default port if enforceHttps is not set? I can't find much information on ports with opensearch except for this which mentions only 80 & 443.

thoughts?

Sorry, I should have explained my rational here. My take is that if enforceHttps is false, the cluster listens on ports 80 and 443, so it doesn't make sense to have a singular default port.

Also, PR linting is failing because I've not made a change to a README file. I'm not sure what to do about this, as this is such a minor feature I'm not sure it belongs in the Opensearch Service README, which doesn't even describe the enforceHttps option, let alone this minor consequence of it.

@corymhall corymhall added the pr-linter/exempt-readme The PR linter will not require README changes label Jun 13, 2022
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.

Sorry, I should have explained my rational here. My take is that if enforceHttps is false, the cluster listens on ports 80 and 443, so it doesn't make sense to have a singular default port.

gotcha, that makes sense.

@corymhall corymhall added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Jun 13, 2022
@mergify
Copy link
Contributor

mergify bot commented Jun 13, 2022

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).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@mergify mergify bot merged commit a6fe2cb into aws:main Jun 13, 2022
@mergify
Copy link
Contributor

mergify bot commented Jun 13, 2022

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).

@SamStephens
Copy link
Contributor Author

Thanks @corymhall !

daschaa pushed a commit to daschaa/aws-cdk that referenced this pull request Jul 9, 2022
… connections defaultPort (aws#20602)

For an Opensearch domain, if enforceHttps is enabled, set the defaultPort for the connections object of the domain, as we know it communicates over 443 in this scenario.

I also took the liberty of correcting a test title while I was in the code, I hope it's okay coupling that fix with this change.

closes aws#16251

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

It doesn't seem that an integration test is a good fit here, as this simply changes/simplifies how you'll create a connection to a Domain. I'm happy to be corrected however and will add one if asked.

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*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
effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exempt-readme The PR linter will not require README changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws_cdk.aws_elasticsearch): Set connections defaultPort when enforceHttps is true
3 participants