We make quite heavy use of Elastic Search and we use AWS IAM roles to connect to services in AWS, but how do you connect to an elastic cluster hosted in AWS using these IAM roles?
Prerequisites
AWS Account - https://signin.aws.amazon.com/signup?request_type=register
Elastic search cluster - https://aws.amazon.com/what-is/opensearch/
saml2aws - https://github.com/Versent/saml2aws
Postman - https://www.postman.com/
Method
Firstly log into your AWS account on the terminal using aws2saml
Then find the AWS access key, secret access key and session token, these are stored in the AWS credentials file.
Then in the AWS console find the endpoint that you want to connect to
Open postman and in the section for Authorisation add the credential details as Type AWS Signature.
Finally enter your endpoint and query the API.
It's quite simple when you can remember all the steps and where to find the information you need.
No comments:
Post a Comment