Closed dbmikus closed 6 years ago
Can you share a (sanitized) portion of your debug logs? Boto3 will log where it's pulling credentials from, so the first thing I'd want to double check is that boto3 is in fact pulling from the instance metadata service. It's possible that credentials are being set somewhere that are higher priority in the credential chain, especially because instance metadata is the last thing we check (http://boto3.readthedocs.io/en/latest/guide/configuration.html#configuring-credentials).
Hi @jamesls. I can post that in the next couple days. We're reprovisioning our dev environment tomorrow and it's down now. Will have logs before end of Friday.
Sorry for the delay @jamesls. Got the boto3 and botocore logs set up, and discovered that, due to an edge case in our environment configuration code, we were setting AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
to the empty string instead of leaving them out of the environment variables completely.
So, it was a bug on my end. I'm closing this out. Should have simplified my testing scenario more before opening the issue. Sorry about that, and thanks for the help anyways.
I have an application that runs the KCL multilang daemon to run a pool of Python processes that consume from Kinesis. Inside the Python processes, I need to put some records out to Kinesis based on the records I consume. I want both the KCL and boto3 to authenticate with EC2 instance profile credentials. This does not appear to be working. If I use environment variables or set values in
~/.aws/credentials
, it works, but when I use theDefaultAWSCredentialsProviderChain
, the internal boto3 connection fails.Here are some file snippets to show what I have set up.
The relevant parts from the KCL properties file:
The truncated Python file referenced by
executableName
property:Note how, during initialization, I attempt to establish a boto3 client and describe a Kinesis stream. This logs out an error:
If I just go into python REPL:
I truncated the response for brevity and privacy, but it's a valid response.
This leads me to believe that there is an issue establishing a boto3 connection with EC2 instance profile credentials inside a process created by a KCL app. I believe this is a bug. Please let me know if I am wrong or if there is a way around this while still using the EC2 instance profile credentials.