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

New sub-module for IAM assumable role with OIDC #37

Conversation

miguelaferreira
Copy link
Contributor

Description

This PR adds a new submodule that creates a single role that can be assumed by OIDC subjects. The motivation for the change is to setup IAM Roles for EKS Service Accounts.

@miguelaferreira miguelaferreira changed the title Iam assumable role with oidc New sub-module for IAM assumable role with OIDC Oct 11, 2019
@miguelaferreira miguelaferreira force-pushed the iam-assumable-role-with-oidc branch 3 times, most recently from 70a34ee to e4d260c Compare October 14, 2019 07:35
@ipnextgen
Copy link

I dont know if it could be usefull, but here's how I implemented it meanwhile the submodule is ready. I'm using the terraform-aws-eks module for "example_aws_eks_dev_001"

data "aws_iam_policy_document" "example_alb_ingress_role_for_eks_pod_001_document" {
  statement {
    actions = ["sts:AssumeRoleWithWebIdentity"]
    condition {
      test = "StringEquals"
      values = ["system:serviceaccount:${replace(kubernetes_service_account.example_service_account_dev_alb.id,"/",":")}"]
      variable = "${substr(module.example_aws_eks_dev_001.cluster_oidc_issuer_url, 8, length(module.example_aws_eks_dev_001.cluster_oidc_issuer_url))}:sub"
    }

    principals {
      type        = "Federated"
      identifiers = ["arn:aws:iam::${var.example_dev_aws_account_number}:oidc-provider/${substr(module.example_aws_eks_dev_001.cluster_oidc_issuer_url, 8, length(module.example_aws_eks_dev_001.cluster_oidc_issuer_url))}"]
    }
  }
}

What pisses me now is the fingerprint bug in the provider... used the workaround for now..

@ipnextgen
Copy link

Hi, will this be merged?

@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 11, 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.

3 participants