lyft / metadataproxy

A proxy for AWS's metadata service that gives out scoped IAM credentials from STS
Other
456 stars 69 forks source link

Setting environment variable on running container is not working #56

Closed sujithvs-dev closed 7 years ago

sujithvs-dev commented 7 years ago

Whenever I am setting up environment variable for a running container Metadataproxy throwing error. I am able to get environment variable using echo $IAM_ROLE and metadataproxy is not returning IAM_ROLE value when testing with curl http://169.254.169.254/latest/meta-data/iam/security-credentials/

Used below commands to set environment variable in running container. export IAM_ROLE="ccc_ContainerRole@12345678"

Metadataproxy error: [root@eb744b6a4257 ~]# curl http://169.254.169.254/latest/meta-data/iam/security-credentials/ curl: (7) Failed connect to 169.254.169.254:80; Connection refused

ryan-lane commented 7 years ago

does this call work at all?

curl http://169.254.169.254/latest/meta-data/

I'm guessing not based on the error you're getting. Based on this I'd say your iptables rule isn't forwarding your traffic to metadataproxy. Is this container running through docker networking? Host networking, based on the default firewall rule, wouldn't forward the traffic to the metadataproxy.

ryan-lane commented 7 years ago

Closing this due to inactivity.