File tree 4 files changed +36
-11
lines changed
deployment/aws-terraform/1-services
4 files changed +36
-11
lines changed Original file line number Diff line number Diff line change 1
1
resource "helm_release" "fsx_csi_driver" {
2
+ count = local. use_fsx
2
3
namespace = " kube-system"
3
4
4
5
name = " aws-fsx-csi-driver"
5
6
repository = " https://kubernetes-sigs.github.io/aws-fsx-csi-driver/"
6
7
chart = " aws-fsx-csi-driver"
8
+
9
+ set {
10
+ name = " controller.serviceAccount.annotations.eks\\ .amazonaws\\ .com/role-arn"
11
+ value = module.fsx_csi_irsa[0 ].iam_role_arn
12
+ }
13
+
14
+ set {
15
+ name = " node.serviceAccount.annotations.eks\\ .amazonaws\\ .com/role-arn"
16
+ value = module.fsx_csi_irsa[0 ].iam_role_arn
17
+ }
7
18
}
8
19
9
20
resource "kubernetes_storage_class_v1" "fsx_sc" {
21
+ count = local. use_fsx
10
22
metadata {
11
23
name = " fsx-sc"
12
24
}
@@ -16,5 +28,5 @@ resource "kubernetes_storage_class_v1" "fsx_sc" {
16
28
securityGroupIds = module.eks.cluster_security_group
17
29
deploymentType = " PERSISTENT_2"
18
30
}
19
- depends_on = [ helm_release . fsx_csi_driver ]
31
+ depends_on = [ helm_release . fsx_csi_driver [ 0 ] ]
20
32
}
Original file line number Diff line number Diff line change @@ -50,6 +50,8 @@ module "efs_csi_irsa" {
50
50
}
51
51
52
52
module "fsx_csi_irsa" {
53
+ count = local. use_fsx
54
+
53
55
source = " terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts-eks"
54
56
55
57
role_name_prefix = " fsx-csi-${ local . cluster_name } "
@@ -112,15 +114,19 @@ resource "kubernetes_annotations" "efs_csi_node_annotation" {
112
114
}
113
115
annotations = {
114
116
" eks.amazonaws.com/role-arn" : module.efs_csi_irsa_node[0 ].iam_role_arn
115
-
116
- resource " kubernetes_annotations" " fsx_csi_controller_annotation" {
117
- api_version = " v1"
118
- kind = " ServiceAccount"
119
- metadata {
120
- name = " fsx-csi-controller-sa"
121
- namespace = " kube-system"
122
- }
123
- annotations = {
124
- " eks.amazonaws.com/role-arn" : module.fsx_csi_irsa.iam_role_arn
125
117
}
126
118
}
119
+
120
+ # resource "kubernetes_annotations" "fsx_csi_controller_annotation" {
121
+ # count = local.use_fsx
122
+
123
+ # api_version = "v1"
124
+ # kind = "ServiceAccount"
125
+ # metadata {
126
+ # name = "fsx-csi-controller-sa"
127
+ # namespace = "kube-system"
128
+ # }
129
+ # annotations = {
130
+ # "eks.amazonaws.com/role-arn": module.fsx_csi_irsa[0].iam_role_arn
131
+ # }
132
+ # }
Original file line number Diff line number Diff line change 3
3
db_count = var. create_rds_instance ? 1 : 0
4
4
cognito_pool_count = var. create_cognito_pool ? 1 : 0
5
5
use_efs = var. use_efs_csi ? 1 : 0
6
+ use_fsx = var. use_fsx_csi ? 1 : 0
6
7
7
8
tags = {
8
9
Name = var.project_prefix
Original file line number Diff line number Diff line change @@ -50,6 +50,12 @@ variable "use_efs_csi" {
50
50
default = false
51
51
}
52
52
53
+ variable "use_fsx_csi" {
54
+ type = bool
55
+ description = " Install CSI driver for FSx for Lustre volumes"
56
+ default = false
57
+ }
58
+
53
59
variable "r53_rds_private_hosted_zone" {
54
60
type = string
55
61
default = null
You can’t perform that action at this time.
0 commit comments