-
Notifications
You must be signed in to change notification settings - Fork 4.5k
(aws-elasticsearch): imported Domain's domainEndpoint is the full URL, not the Endpoint #18017
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-elasticsearchRelated to Amazon Elasticsearch ServiceRelated to Amazon Elasticsearch ServicebugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortgood first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdp1
Description
What is the problem?
For ES Domains imported using fromDomainEndpoint, the domainEndpoint attribute is meant to return something like: search-mystack-elasti-1ab2cdefghij-ab1c2deckoyb3hofw7wpqa3cm.us-west-1.es.amazonaws.com. Instead, it returned that, but prepended by https://.
I think this happens because fromDomainEndpoint requires a valid URL, not a raw endpoint.
Reproduction Steps
from monocdk import aws_elasticsearch as es, Construct
class ElasticSearch(Construct):
def __init__(self, scope: Construct):
super().__init__(scope, id, **kwargs)
domain = "https://search-mystack-elasti-1ab2cdefghij-ab1c2deckoyb3hofw7wpqa3cm.us-west-1.es.amazonaws.com"
# The below would return: `jsii.errors.JSIIError: Invalid URL`
# domain = "search-mystack-elasti-1ab2cdefghij-ab1c2deckoyb3hofw7wpqa3cm.us-west-1.es.amazonaws.com"
es_domain = es.Domain.from_domain_endpoint(self, "imported-es-domain", domain)
print(es_domain.domain_endpoint)
# > https://search-mystack-elasti-1ab2cdefghij-ab1c2deckoyb3hofw7wpqa3cm.us-west-1.es.amazonaws.comWhat did you expect to happen?
The domainEndpoint attribute to return the endpoint not as a URL.
What actually happened?
See: "what is the problem"
CDK CLI Version
1.135.0
Framework Version
No response
Node.js Version
v16.3.0
OS
Mac
Language
Python
Language Version
No response
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-elasticsearchRelated to Amazon Elasticsearch ServiceRelated to Amazon Elasticsearch ServicebugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortgood first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdp1