I have a Spring Boot image deployed using AWS Fargate and the Elasticsearch cluster using AWS Elasticsearch Service. Both are under same VPC and subnet. Below is the access policy of Elasticsearch:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "es:*",
"Resource": "arn:aws:es:ap-south-1:8655488xxxxx:domain/website-qa/*"
}
]
}
Security groups:
Fargate: sg-test033f776d5fbed5c0000
Elasticsearch: sg-test0e5a570cbfc389e8555
Subnet:
Fargate: subnet-test025f49153cf245a2d11,subnet-test01f19783c005010f122,subnet-test076dfbba51d92d49033
Elasticsearch: ap-south-1a: subnet-test025f49153cf245a2d11
Under the security group of elasticsearch, I have allowed the security group of Fargate for port 443 and 9200.
And below is from application.yml file:
spring:
elasticsearch:
rest:
connection-timeout: 5000 #milliseconds
read-timeout: 5000 #milliseconds
uris: https://vpc-website-qa-xxxxxxxxxxxx.ap-south-1.es.amazonaws.com:9200
So spring boot tries to make a connection to Elasticsearch but get java.net.UnknownHostException https://vpc-website-qa-xxxxxxxxxxxx.ap-south-1.es.amazonaws.com:9200
Tried with port 443 also but didn't work. Why host is not resolved at Fargate cluster? What am I missing here?