Running EC2 instance that has an IAM role attached that allows to copy/read files to/from an S3 bucket.
When logged into the EC2 instance (via ssh) I can perform all those tasks using aws s3 ... command. There are no credentials because it's using a role. Env does not have anything related to aws at all.
However, if I run a program (written in GO) that simply does:
exec.Command("bash", "-c", "aws s3 ls ....")
I get Partial credentials found in env, missing: AWS_SECRET_ACCESS_KEY
A bit confused here, shouldn't it just work since I'm running this process as the same user that I'm logged in as and that actually works as I've mentioned in the beginning? Why is it even looking for credentials?