Skip to content

Instantly share code, notes, and snippets.

@carlosescura
Created May 8, 2020 08:57
Show Gist options
  • Save carlosescura/22394d46fd456f9b1ea468ae3909a1f9 to your computer and use it in GitHub Desktop.
Save carlosescura/22394d46fd456f9b1ea468ae3909a1f9 to your computer and use it in GitHub Desktop.
module "iam_assumable_role_airflow" {
source = "terraform-aws-modules/iam/aws//modules/iam-assumable-role-with-oidc"
version = "~> v2.6.0"
create_role = true
role_name = "${var.cluster_name}-airflow"
provider_url = replace(module.eks_cluster.cluster_oidc_issuer_url, "https://", "")
role_policy_arns = [aws_iam_policy.airflow_misc.arn]
oidc_fully_qualified_subjects = ["system:serviceaccount:${var.airflow_namespace}:${var.airflow_sa_name}"]
}
resource "aws_iam_policy" "airflow_misc" {
path = "/airflow/"
name = "MiscelaneousAccess"
description = "EKS airflow policy for cluster ${var.cluster_name}"
policy = data.aws_iam_policy_document.airflow_misc.json
}
data "aws_iam_policy_document" "airflow_misc" {
// Kinesis
statement {
actions = [
"kinesis:Get*",
"kinesis:List*",
"kinesis:Describe*"
]
resources = [
"*"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment