avx-pmarie-aws-infra/modules/eks-addon-csi-ebs/main.tf
2022-07-01 14:12:11 +02:00

18 lines
549 B
HCL

resource "aws_iam_role" "self" {
assume_role_policy = data.aws_iam_policy_document.self_assume_role_policy.json
name = "EksCsiEbsRole-${var.eks_cluster_id}"
}
resource "aws_iam_role_policy_attachment" "self" {
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy"
role = aws_iam_role.self.name
}
resource "aws_eks_addon" "self" {
cluster_name = var.eks_cluster_id
addon_name = "aws-ebs-csi-driver"
addon_version = var.addon_version
service_account_role_arn = aws_iam_role.self.arn
}