Skip to content

Commit

Permalink
fix: Work around path bug in aws-iam-authenticator (#894)
Browse files Browse the repository at this point in the history
* fix: Work around path bug in aws-iam-authenticator

`aws-iam-authenticator` has an open issue where it will not recognize
IAM roles that include paths. This change causes the path supplied to
`var.iam_path` to be stripped when generating the `aws-auth` ConfigMap
in order to work around this.

kubernetes-sigs/aws-iam-authenticator#153
aws/containers-roadmap#926
  • Loading branch information
baibailiha committed Nov 29, 2021
1 parent 54c4260 commit 40d8ad0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aws_auth.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ locals {
module.node_groups.aws_auth_roles,
) :
{
rolearn = role["worker_role_arn"]
# Work around https://github.com/kubernetes-sigs/aws-iam-authenticator/issues/153
# Strip the leading slash off so that Terraform doesn't think it's a regex
rolearn = replace(role["worker_role_arn"], replace(var.iam_path, "/^//", ""), "")
username = "system:node:{{EC2PrivateDNSName}}"
groups = tolist(concat(
[
Expand Down

0 comments on commit 40d8ad0

Please sign in to comment.