bcuff / elasticsearch-net-aws

Add-on to Elasticsearch.Net & NEST for using AWS's elasticsearch service.
Apache License 2.0
72 stars 27 forks source link

Trouble using this inside VS with AWS SDK #19

Closed jkpindahbc closed 7 years ago

jkpindahbc commented 7 years ago

Doesn't seem to want to use my default credentials from AWS. Fails when looking up credentials with error that connection to server could not be made? Why is trying to look up the credentials if they are local to my machine?

bcuff commented 7 years ago

what credentials are you currently using? It currently supports

jkpindahbc commented 7 years ago

Locally I want to use environment variables, but when this runs in AWS I want it to use instance profile. It will be running in a Lambda function. Seems to fail on accessing the server http://169.254.169.254.

bcuff commented 7 years ago

ah. interesting. i'll look into this and get back to you.

jkpindahbc commented 7 years ago

Works as designed, Lambda function roles use environment variables to resolve security.

bcuff commented 7 years ago

ah great.

mkenney99 commented 7 years ago

I see the InstanceProfileService.cs file has that hard-coded IP address in it: private const string Server = "http://169.254.169.254";

I've not been able to successfully use Instance Profiles to lookup credentials - could this be why?

bcuff commented 7 years ago

Instance profile credentials are only available on EC2 instances with a role assigned to it. Instance metadata on ec2 instances is obtained via that IP. See http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#instancedata-data-retrieval