diff --git a/main.tf b/main.tf index 7e99a35..6311df7 100644 --- a/main.tf +++ b/main.tf @@ -78,7 +78,7 @@ resource "aws_security_group" "default" { } resource "aws_efs_backup_policy" "policy" { - count = var.efs_enabled ? 1 : 0 + count = var.efs_enabled && var.efs_backup_policy_enabled == "ENABLED" ? 1 : 0 file_system_id = join("", aws_efs_file_system.default.*.id) @@ -87,7 +87,7 @@ resource "aws_efs_backup_policy" "policy" { } } resource "aws_efs_access_point" "default" { - count = var.efs_enabled ? 1 : 0 + count = var.efs_enabled && var.access_point_enabled ? 1 : 0 file_system_id = join("", aws_efs_file_system.default.*.id) tags = module.label.tags diff --git a/variables.tf b/variables.tf index d3fb847..6215890 100644 --- a/variables.tf +++ b/variables.tf @@ -146,4 +146,9 @@ variable "allow_cidr" { type = list(any) default = [] description = "Provide allowed cidr to efs" +} + +variable "access_point_enabled" { + type = bool + default = true } \ No newline at end of file