File tree 4 files changed +35
-12
lines changed
deployment/aws-terraform/1-services
4 files changed +35
-12
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 @@ -29,6 +29,8 @@ resource "kubernetes_annotations" "ebs_csi_iam_annotation" {
29
29
}
30
30
31
31
module "fsx_csi_irsa" {
32
+ count = local. use_fsx
33
+
32
34
source = " terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts-eks"
33
35
34
36
role_name_prefix = " fsx-csi-${ local . cluster_name } "
@@ -46,14 +48,16 @@ module "fsx_csi_irsa" {
46
48
tags = local. tags
47
49
}
48
50
49
- resource "kubernetes_annotations" "fsx_csi_controller_annotation" {
50
- api_version = " v1"
51
- kind = " ServiceAccount"
52
- metadata {
53
- name = " fsx-csi-controller-sa"
54
- namespace = " kube-system"
55
- }
56
- annotations = {
57
- " eks.amazonaws.com/role-arn" : module.fsx_csi_irsa.iam_role_arn
58
- }
59
- }
51
+ # resource "kubernetes_annotations" "fsx_csi_controller_annotation" {
52
+ # count = local.use_fsx
53
+
54
+ # api_version = "v1"
55
+ # kind = "ServiceAccount"
56
+ # metadata {
57
+ # name = "fsx-csi-controller-sa"
58
+ # namespace = "kube-system"
59
+ # }
60
+ # annotations = {
61
+ # "eks.amazonaws.com/role-arn": module.fsx_csi_irsa[0].iam_role_arn
62
+ # }
63
+ # }
Original file line number Diff line number Diff line change 2
2
cluster_name = " ${ var . project_prefix } -${ var . environment } "
3
3
db_count = var. create_rds_instance ? 1 : 0
4
4
cognito_pool_count = var. create_cognito_pool ? 1 : 0
5
+ use_fsx = var. use_fsx_csi ? 1 : 0
5
6
6
7
tags = {
7
8
Name = var.project_prefix
Original file line number Diff line number Diff line change @@ -44,6 +44,12 @@ variable "google_identity_client_secret" {
44
44
description = " Client ID for Google identity provider"
45
45
}
46
46
47
+ variable "use_fsx_csi" {
48
+ type = bool
49
+ description = " Install CSI driver for FSx for Lustre volumes"
50
+ default = false
51
+ }
52
+
47
53
variable "r53_rds_private_hosted_zone" {
48
54
type = string
49
55
default = null
You can’t perform that action at this time.
0 commit comments