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
DWSR authored May 30, 2020
1 parent c748899 commit 7ffe5fa
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 7ffe5fa

Please sign in to comment.