brendanhay / amazonka

A comprehensive Amazon Web Services SDK for Haskell.
https://amazonka.brendanhay.nz
Other
599 stars 227 forks source link

newEnv discover throws CredentialChainExhausted when run within docker on EC2 #1004

Open tysonzero opened 1 week ago

tysonzero commented 1 week ago

The workaround is --network host. However that seems like it shouldn't be necessary as wget -O - http://instance-data/latest/meta-data/iam/security-credentials/ec2-ecr-role correctly returns values even without --network host, and if you feed those values back in via env variables to the same docker image then amazonka will successfully authenticate even without --network host, so in principle it seems like it should be feasible to tie it all together within amazonka.