-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
route53: aws-sdk-go-v2 broke IAM instance role #2033
Comments
Hello, I think this is an internal change in the SDK.
The error comes from here. I'm not a specialist in AWS, and the SDK migration guide is really weak. I don't know if it's an expected behavior for the new SDK, a bug of the SDK, or something else. |
I read on the AWS documentation that IMDs v1 and v2 should both work. So I'm kind of puzzled about why we are receiving the error. Will you do some extra testing on this? Or what actions do you see next? I assume there are multiple users that encounter this. |
As you can see it seems you are alone with this problem (no thumbs up, no other report)
I don't know because based on the code I have no idea of the real root of the problem. |
This comment was marked as duplicate.
This comment was marked as duplicate.
If anyone else comes along this path, I had a related issue masking this fix, and just figured it out. Specifically:
I was seeing that supplying the AWS_REGION env var in my traefik instance's docker-compose file had no effect. It wasn't until I changed the ec2 instance's IMDS metadata to allow 2 hops instead of 1 that I saw the dockerized Traefik instance be able to hit the EC2 instance's IMDS service. I tried it with the hop limit bumped from 1 to 2, but without the AWS_REGION env var set, and got a different error than I was seeing before:
So both these changes are necessary: providing the AWS_REGION (in my case, us-west-2) environment variable to traefik, and also bumping the instance's metadata configuration to set "Metadata response hop limit" to 2 instead of 1. See these references:
In my case, my ec2 instance was managed by Terraform, so I needed to add a metadata options section to my "aws_instance" define: metadata_options {
# So docker can access ec2 metadata
# see https://github.com/aws/aws-sdk-go/issues/2972
http_put_response_hop_limit = 2
} |
Welcome
What did you expect to see?
A certificate is generated by using the AWS EC2 instance profile role.
What did you see instead?
An error message about the AWS EC2 IMDS.
How do you use lego?
Docker image
Reproduction steps
Renew an existing certificate by letting the docker image by making use of the instance profile of the AWS EC2 machine.
It works when using role assumption by passing a profile other than 'default' to the docker image. But using the attached instances profile role the error is generated.
Another fix is using lego v4.13.2 which is still using the old AWS sdk.
Version of lego
v4.14.2
Logs
Go environment (if applicable)
The text was updated successfully, but these errors were encountered: