AWS CLI List-domain-names/describe-domain Returns Empty Even If There Are Domains Present In The Account

We have ElasticSearch domain created in one of the AWS account.

We are trying to use AWS cli command to "describe" this domain.

aws es describe-elasticsearch-domain --domain-name <domain-name>

But receiving error:

An error occurred (ResourceNotFoundException) when calling the DescribeElasticsearchDomain operation: Domain not found:

We than used list-domain command:

aws es list-domain-names

But received empty response:

{ "DomainNames": [] }

We double checked account info. and credentials in .aws folder and we are pointing to correct aws account also able to view other resources in that account except ElasticSearch.

Any help is appreciated.



It's not the permission issue, It can be profile issue may be command run in other account but I am sure your Elastic search cluster is in a different region and you set the different region in aws configure

All you need to pass region to the aws command

aws es list-domain-names --region DOMAIN_REGION


aws es list-domain-names --region us-west-1

The exception clearly said the resources not found in the region by default which specified in aws configure using aws-cli.

aws es describe-elasticsearch-domain --domain-name youdomain domain_region