(aws-elasticsearch): `Domain.fromDomainEndpoint` returning incorrect ARN
See original GitHub issueWhen using the Domain.fromDomainEndpoint
function to retrieve an ES Instance and reference in the rest of the Stack, it returns an incorrect ARN. When I output the ARN, it gives the following results:
ACTUAL ARN -> arn:aws:es:[region]:[accountId]:domain/infrast-elasti-...
OUTPUTTED -> arn:aws:es:[region]:[accountId]:domain/search-infrast-elasti-...
Reproduction Steps
- Have an existing ElasticSearch Service Instance running
- Import it from the CDK
const esDomain = Domain.fromDomainEndpoint(
this,
`${id}ESDomain`,
'https://search-infrast-elasti-....[region].es.amazonaws.com/'
);
new CfnOutput(this, `ElasticSearchArn`, {
value: esDomain.domainArn,
exportName: `ElasticSearchArn`,
});
- Compare the actual ARN and the ARN returned
What did you expect to happen?
The provided ARN should be the correct ARN
What actually happened?
The provided ARN was incorrect
Environment
- CDK CLI Version : 1.91.0
- Framework Version: 1.91.0
- Node.js Version: 12.20.1
- OS : Ubuntu 20
- Language (Version): TypeScript (3.9.7)
Other
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Troubleshooting Amazon OpenSearch Service
The OpenSearch Dashboards endpoint doesn't support signed requests. If the access control policy for your domain only grants access to certain IAM users...
Read more >AWS::Elasticsearch::Domain - AWS CloudFormation
This returned value is the same as the one returned by AWS::Elasticsearch::Domain.DomainArn . DomainArn. The Amazon Resource Name (ARN) of the domain, such...
Read more >Resolve manual snapshot error in Amazon OpenSearch Service
To successfully migrate data from a manual snapshot in OpenSearch Service, perform the following steps: 1. Choose an Amazon Simple Storage ...
Read more >Amazon Cognito authentication issues with OpenSearch ...
Make sure to add the Amazon Cognito authenticated role in the domain access ... login page but can't log in, then Amazon Cognito...
Read more >describe-elasticsearch-domain - AWS Documentation
Returns domain configuration information about the specified Elasticsearch domain, including the domain ID, domain endpoint, and domain ARN.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@justindra Thanks for reporting this.
Looks like we neglected to consider the
search-
prefix.Found the same issue in
@aws-cdk/aws-opensearchservice
using thefromDomainEndpoint
method (cdk v1.50.0).May I suggest to add a method
fromDomainName
and deprecate the other one? since looks like ARN is composed by appending domain name at the end.