I've created an elasticsearch service in AWS using AWS CDK. Originally I thought of accessing it using IAM, but the way to do it in node is horrible, so I turned to auth through api-key.
If I follow the elasticsearch docs, I get the following error:
AuthenticationException(401, '{"Message":"Your request: \'/_security/api_key\' is not allowed."}')
I assume this is due to my default user not having the right permissions to access the _security
API, but then how can I create said api-key?
From comments:
Security API is part of x-pack which is not support yet by AWS Elasticserach service. if we need to use it with in AWS, using it as SAAS from AWS MarketPlace is an option. However, there are other options to secure AWS Elasticsearch:
aws4.sign
method options in addition to nodejs http request options. Similar to example here with service as es
. Couple of libraries which wraps this signing for elastic are aws-es-connection and http-aws-es