Skip to content

Commit

Permalink
feat(DMVP-4602): fixed variable definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
viktoryathegreat committed Jul 31, 2024
1 parent d9b45b2 commit d311976
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ worker_groups = {
| <a name="input_create_cert_manager"></a> [create\_cert\_manager](#input\_create\_cert\_manager) | If enabled it always gets deployed to the cert-manager namespace. | `bool` | `false` | no |
| <a name="input_ebs_csi_version"></a> [ebs\_csi\_version](#input\_ebs\_csi\_version) | EBS CSI driver addon version | `string` | `"v1.15.0-eksbuild.1"` | no |
| <a name="input_efs_id"></a> [efs\_id](#input\_efs\_id) | EFS filesystem id in AWS | `string` | `null` | no |
| <a name="input_efs_storage_classes"></a> [efs\_storage\_classes](#input\_efs\_storage\_classes) | Additional storage class configurations for EFS | <pre>list(object({<br> name : string<br> provisioning_mode : string<br> file_system_id : string<br> directory_perms : string<br> base_path : string<br> uid : optional(number)<br> }))</pre> | `[]` | no |
| <a name="input_efs_storage_classes"></a> [efs\_storage\_classes](#input\_efs\_storage\_classes) | Additional storage class configurations: by default, 2 storage classes are created - efs-sc and efs-sc-root which has 0 uid. One can add another storage classes besides these 2. | <pre>list(object({<br> name : string<br> provisioning_mode : optional(string, "efs-ap")<br> file_system_id : string<br> directory_perms : optional(string, "755")<br> base_path : optional(string, "/")<br> uid : optional(number)<br> }))</pre> | `[]` | no |
| <a name="input_enable_api_gw_controller"></a> [enable\_api\_gw\_controller](#input\_enable\_api\_gw\_controller) | Weather enable API-GW controller or not | `bool` | `false` | no |
| <a name="input_enable_ebs_driver"></a> [enable\_ebs\_driver](#input\_enable\_ebs\_driver) | Weather enable EBS-CSI driver or not | `bool` | `true` | no |
| <a name="input_enable_efs_driver"></a> [enable\_efs\_driver](#input\_enable\_efs\_driver) | Weather install EFS driver or not in EKS | `bool` | `false` | no |
Expand Down
2 changes: 1 addition & 1 deletion modules/efs-csi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ No modules.
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Parent cluster name | `string` | n/a | yes |
| <a name="input_cluster_oidc_arn"></a> [cluster\_oidc\_arn](#input\_cluster\_oidc\_arn) | oidc arn of cluster | `string` | n/a | yes |
| <a name="input_efs_id"></a> [efs\_id](#input\_efs\_id) | Id of EFS filesystem in AWS (Required) | `string` | n/a | yes |
| <a name="input_storage_classes"></a> [storage\_classes](#input\_storage\_classes) | Additional storage class configurations | <pre>list(object({<br> name : string<br> file_system_id : string<br> directory_perms : string<br> base_path : string<br> uid : optional(number)<br> }))</pre> | `[]` | no |
| <a name="input_storage_classes"></a> [storage\_classes](#input\_storage\_classes) | Additional storage class configurations: by default, 2 storage classes are created - efs-sc and efs-sc-root which has 0 uid. One can add another storage classes besides these 2. | <pre>list(object({<br> name : string<br> provisioning_mode : optional(string, "efs-ap")<br> file_system_id : string<br> directory_perms : optional(string, "755")<br> base_path : optional(string, "/")<br> uid : optional(number)<br> }))</pre> | `[]` | no |

## Outputs

Expand Down
8 changes: 5 additions & 3 deletions modules/efs-csi/storageClass.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ locals {
default_storage_classes = [
{
name : "efs-sc"
provisioning_mode : "efs-ap"
file_system_id : var.efs_id
directory_perms : "755"
base_path : "/eks"
uid : null
},
{
name : "efs-sc-root"
provisioning_mode : "efs-ap"
file_system_id : var.efs_id
directory_perms : "755"
base_path : "/eks"
base_path : "/eks-root"
uid : 0
}
]
Expand All @@ -31,10 +33,10 @@ resource "kubernetes_storage_class" "efs_storage_class" {

parameters = merge(
{
provisioningMode = "efs-ap"
provisioningMode = each.value.provisioning_mode
fileSystemId = each.value.file_system_id
directoryPerms = each.value.directory_perms
basePath = coalesce(each.value.base_path, "/eks")
basePath = each.value.base_path
},
each.value.uid != null ? { "uid" : each.value.uid } : {}
)
Expand Down
7 changes: 4 additions & 3 deletions modules/efs-csi/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ variable "cluster_name" {
}

variable "storage_classes" {
description = "Additional storage class configurations"
description = "Additional storage class configurations: by default, 2 storage classes are created - efs-sc and efs-sc-root which has 0 uid. One can add another storage classes besides these 2."
type = list(object({
name : string
provisioning_mode : optional(string, "efs-ap")
file_system_id : string
directory_perms : string
base_path : string
directory_perms : optional(string, "755")
base_path : optional(string, "/")
uid : optional(number)
}))
default = []
Expand Down
8 changes: 4 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,13 @@ variable "enable_efs_driver" {
}

variable "efs_storage_classes" {
description = "Additional storage class configurations for EFS"
description = "Additional storage class configurations: by default, 2 storage classes are created - efs-sc and efs-sc-root which has 0 uid. One can add another storage classes besides these 2."
type = list(object({
name : string
provisioning_mode : string
provisioning_mode : optional(string, "efs-ap")
file_system_id : string
directory_perms : string
base_path : string
directory_perms : optional(string, "755")
base_path : optional(string, "/")
uid : optional(number)
}))
default = []
Expand Down

0 comments on commit d311976

Please sign in to comment.