You can get AWS credentials from your EC2 instance using this script. However, you can't just run this, you need to source it, like:
> . get-creds.sh
And you need to have jq installed.
You can use this to authenticate for the AWS CLI. For instance, add a profile like this to your ~/.aws/config file:
[default]
region = us-east-1
role_arn = arn:aws:iam::${YOUR_AWS_ACCOUNT_ID}:role/${ROLE_NAME}
credential_source = Environment
The alernative credential_source
for EC2 is Ec2InstanceMetadata
.
It will set the appropriate environment variables for connecting your gremlin-console to your IAM authenticated Neptune DB, as described here: https://docs.aws.amazon.com/neptune/latest/userguide/iam-auth-connecting-gremlin-console.html