fix(elasticsearch): Domain.fromDomainAttributes gives "Invalid URL" when endpoint is a token#15219
Conversation
|
Please add a summary description of the changes contained in this PR |
BenChaimberg
left a comment
There was a problem hiding this comment.
the modes of these files were changed to allow execution; please revert
191c4b5 to
2b2182f
Compare
…hen endpoint is a token
2b2182f to
d6aad54
Compare
Pull request has been modified.
|
@BenChaimberg Updated the PR. Had to change modes due to some permission issue with yarn. Reverted it now, and also modified tests to check equality. |
|
Please commit on top, as Github doesn't have great support for diffing between force-pushed commits |
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
…hen endpoint is a token (aws#15219) `Domain.fromDomainAttributes` throws the error "Invalid URL" when a token endpoint is provided. In this PR, the domain name is retrieved from the scope using the arn present in `DomainAttributes`, and if no name is found, we try to get it from the endpoint (as it has been done so far). Also added a test to verify that the error disappears with this change, even when it is given token attributes. closes aws#15188 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…hen endpoint is a token (aws#15219) `Domain.fromDomainAttributes` throws the error "Invalid URL" when a token endpoint is provided. In this PR, the domain name is retrieved from the scope using the arn present in `DomainAttributes`, and if no name is found, we try to get it from the endpoint (as it has been done so far). Also added a test to verify that the error disappears with this change, even when it is given token attributes. closes aws#15188 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…hen endpoint is a token (aws#15219) `Domain.fromDomainAttributes` throws the error "Invalid URL" when a token endpoint is provided. In this PR, the domain name is retrieved from the scope using the arn present in `DomainAttributes`, and if no name is found, we try to get it from the endpoint (as it has been done so far). Also added a test to verify that the error disappears with this change, even when it is given token attributes. closes aws#15188 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Documentation for changes made in PR #15219 - issue #15188 Normally one would not put the domain endpoint as a static value in a CF stack. A more realistic use case is to manage an opensearch domain from CF stack A and use it via CF stack B, C, D ... Stack A would export the domainEndpoint and also domainArn - the other stacks can then import those values and import the domain. This PR will add an example for the realistic scenario so people do not end up with errors like "Invalid URL" when a token endpoint is provided. ---- ### 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 * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] 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*
Documentation for changes made in PR aws#15219 - issue aws#15188 Normally one would not put the domain endpoint as a static value in a CF stack. A more realistic use case is to manage an opensearch domain from CF stack A and use it via CF stack B, C, D ... Stack A would export the domainEndpoint and also domainArn - the other stacks can then import those values and import the domain. This PR will add an example for the realistic scenario so people do not end up with errors like "Invalid URL" when a token endpoint is provided. ---- ### 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 * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] 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*
Domain.fromDomainAttributesthrows the error "Invalid URL" when a token endpoint is provided. In this PR, the domain name is retrieved from the scope using the arn present inDomainAttributes, and if no name is found, we try to get it from the endpoint (as it has been done so far). Also added a test to verify that the error disappears with this change, even when it is given token attributes.closes #15188
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license