amazon ec2 - ruby AWS SDK using wrong credentials -


i'm having slight issue aws sdk.

i'm using aws sdk on ec2 box pull data need our services.

i'm passing credentials via secret , id key when tries pull data want it's using iam role that's assigned box rather credentials.

thing is, works fine in 1 of our environments behaves differently in one, what's going on?

the latest ruby sdk checks credentials in following order:

static_credentials -> env_credentials -> shared_credentials -> instance_profile_credentials

so if using static credentials should ok, if exporting key , secret env vars ensure there none set using different name.

the sdk looks env vars in order:

aws_access_key_id -> amazon_access_key_id -> aws_access_key aws_secret_access_key -> amazon_secret_access_key -> aws_secret_key aws_session_token -> amazon_session_token 

make sure exporting both aws_access_key_id , aws_secret_access_key doing along lines of:

export aws_access_key_id=asiaxxxxxxxxxxxxxxxx export aws_secret_access_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 

there has been multiple changes ordering , names of keys on years if environments running different versions of sdk unsurprising if having problems. if can't update latest sdk perhaps try taking @ sdk source see order version using evaluates in.


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -