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

feat: Encoding - Add a Base36Encode function #32130

Closed

Commits on Nov 1, 2022

  1. feat: Encoding - Add a Base36Encode function

    The goal of this PR is to provide a Base36Encode function to encode a string to a base36 sequence.
    
    This is particularly useful for places like the trust policy generation in AWS IAM Roles when using EMR on EKS.
    The current implementation requires an external call to `aws emr-containers update-role-trust-policy` outside of Terraform which creates a perpetual diff when managing IAM Roles via Terraform.
    
    See: https://docs.aws.amazon.com/emr/latest/EMR-on-EKS-DevelopmentGuide/iam-execution-role.html
    
    ```
    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Principal": {
            "Federated": "arn:aws:iam::AWS_ACCOUNT_ID:oidc-provider/OIDC_PROVIDER"
          },
          "Action": "sts:AssumeRoleWithWebIdentity",
          "Condition": {
            "StringLike": {
              "OIDC_PROVIDER:sub": "system:serviceaccount:NAMESPACE:emr-containers-sa-*-*-AWS_ACCOUNT_ID-BASE36_ENCODED_ROLE_NAME"
            }
          }
        }
      ]
    }
    ```
    jphuynh committed Nov 1, 2022
    Configuration menu
    Copy the full SHA
    58769eb View commit details
    Browse the repository at this point in the history