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?