Skip to content
This repository was archived by the owner on Sep 27, 2024. It is now read-only.

Commit eefa212

Browse files
authored
Batiai-1173 Updated code and tested in EPPE (#5)
EFS IRSA permissions fix
1 parent 4d04249 commit eefa212

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.terraform.lock.hcl
2+
.terraform/

iam.tf

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ locals {
33
k8s_service_account_name = "aws-efs-csi-driver"
44
}
55

6+
data "aws_caller_identity" "current" {}
7+
68
data "aws_iam_policy_document" "batcave_efscsidriver" {
79
statement {
810
actions = [
@@ -18,17 +20,10 @@ data "aws_iam_policy_document" "batcave_efscsidriver" {
1820
"elasticfilesystem:CreateAccessPoint",
1921
"elasticfilesystem:DeleteAccessPoint"
2022
]
21-
resources = ["*"]
22-
condition {
23-
test = "ForAnyValue:StringEquals"
24-
variable = "aws:ResourceTag/efs.csi.aws.com/cluster"
25-
values = ["true"]
26-
}
27-
condition {
28-
test = "ForAnyValue:StringEquals"
29-
variable = "aws:RequestTag/cluster-name"
30-
values = ["${var.cluster_name}"]
31-
}
23+
resources = [
24+
"arn:aws:elasticfilesystem:*:${data.aws_caller_identity.current.account_id}:file-system/${aws_efs_file_system.efs.id}",
25+
"arn:aws:elasticfilesystem:*:${data.aws_caller_identity.current.account_id}:access-point/*"
26+
]
3227
}
3328

3429
}

variables.tf

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,26 @@ variable "helm_namespace" {
2424
variable "imagerepo" {
2525
default = "602401143452.dkr.ecr.us-west-2.amazonaws.com/eks/aws-efs-csi-driver"
2626
}
27+
2728
variable "efsid" {
2829
default = ""
29-
3030
}
3131

3232
variable "helm_name" {
3333
default = "aws-efs-csi-driver"
3434
}
3535

3636
variable "cluster_oidc_issuer_url" {}
37+
38+
variable "kms_key_id" {
39+
default = ""
40+
}
41+
42+
variable "vpc_id" {
43+
default = ""
44+
}
45+
46+
variable "private_subnet_ids" {
47+
type = list(any)
48+
default = []
49+
}

0 commit comments

Comments
 (0)