# Variables ==================================================================== variable "name" { description = "Name for the EFS file system. Applied as a Name tag on all resources." type = string } variable "tags" { description = "Tags applied to all resources in this module." type = map(string) default = {} } variable "vpc_id" { description = "VPC ID in which the EFS security group will be created." type = string } variable "subnet_ids" { description = "Subnet IDs in which to create EFS mount targets. One per AZ recommended." type = list(string) } variable "allowed_security_group_ids" { description = "Security group IDs permitted to mount the filesystem (NFS port 2049)." type = list(string) default = [] } # Throughput ------------------------------------------------------------------- variable "performance_mode" { description = "EFS performance mode: generalPurpose or maxIO." type = string default = "generalPurpose" validation { condition = contains(["generalPurpose", "maxIO"], var.performance_mode) error_message = "performance_mode must be 'generalPurpose' or 'maxIO'." } } variable "throughput_mode" { description = "EFS throughput mode: bursting, provisioned, or elastic." type = string default = "elastic" validation { condition = contains(["bursting", "provisioned", "elastic"], var.throughput_mode) error_message = "throughput_mode must be 'bursting', 'provisioned', or 'elastic'." } } variable "provisioned_throughput_mibps" { description = "Provisioned throughput in MiB/s. Required when throughput_mode is 'provisioned'." type = number default = null } # Encryption ------------------------------------------------------------------- variable "kms_key_id" { description = "KMS key ARN for at-rest encryption. Omit to use the AWS-managed key (aws/elasticfilesystem)." type = string default = null } # Lifecycle -------------------------------------------------------------------- variable "lifecycle_policies" { description = "Lifecycle policies for transitioning files to EFS-IA and back to primary storage." type = list(object({ transition_to_ia = optional(string) transition_to_primary_storage_class = optional(string) })) default = [ { transition_to_ia = "AFTER_30_DAYS" }, { transition_to_primary_storage_class = "AFTER_1_ACCESS" }, ] } # Access points ---------------------------------------------------------------- variable "access_points" { description = "Map of EFS access points to create." type = map(object({ posix_user_uid = optional(number, 1000) posix_user_gid = optional(number, 1000) root_path = string owner_uid = optional(number, 1000) owner_gid = optional(number, 1000) permissions = optional(string, "755") })) default = {} } # Policy ----------------------------------------------------------------------- variable "policy" { description = "JSON EFS file system resource policy document. Null disables the policy resource." type = string default = null } # Replication ------------------------------------------------------------------ variable "replication_destination_region" { description = "AWS region for EFS replication. Null disables replication." type = string default = null }