Skip to content

Commit

Permalink
fix: Work around path bug in aws-iam-authenticator
Browse files Browse the repository at this point in the history
`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
  • Loading branch information
Brandon McNama committed May 27, 2020
1 parent d4f3924 commit 1b87d99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion aws_auth.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ locals {
module.node_groups.aws_auth_roles,
) :
{
rolearn = role["worker_role_arn"]
# 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 1b87d99

Please sign in to comment.