Skip to content
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

fix: add missing IAM permission for NLB with EIPs #1226

Conversation

danvbloomberg
Copy link
Contributor

@danvbloomberg danvbloomberg commented Feb 5, 2021

PR o'clock

Description

For services that make use of NLB instead of ELB (annotated with service.beta.kubernetes.io/aws-load-balancer-type=nlb), if EIPs are specified (annotated with service.beta.kubernetes.io/aws-load-balancer-eip-allocations=<eips>), then an additional permission is required, 'ec2:DescribeAddresses', in order for the NLB to be created beyond what was already added in this PR (#902).

This is what the error looks like in the logs:

failed to ensure load balancer: error creating load balancer: "AccessDenied: User: arn:aws:sts::xxxxxxx:assumed-role/xxxxxxxx/xxxxxxxx is not authorized to perform: ec2:DescribeAddresses\n\tstatus code: 403, request id: xxxxxxxx"

This is what the relevant service annotations look like that reproduces this issue:

...
        service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
        service.beta.kubernetes.io/aws-load-balancer-eip-allocations: "${join(",", aws_eip.nlb.*.id)}"
...

Checklist

for services that make use of NLB instead of ELB (annotated with service.beta.kubernetes.io/aws-load-balancer-type=nlb), if EIPs are specified (annotated with service.beta.kubernetes.io/aws-load-balancer-eip-allocations=<eips>), then an additional permission is required 'ec2:DescribeAddresses' in order for the NLB to be created.
@limed
Copy link

limed commented Feb 20, 2021

+1 to this PR as well as I have ran into this exact problem

Copy link
Contributor

@daroga0002 daroga0002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 LGTM

@barryib barryib merged commit fb59393 into terraform-aws-modules:master Apr 19, 2021
barryib pushed a commit to barryib/terraform-aws-eks that referenced this pull request May 20, 2021
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants