Terraform module that creates an Elastic File System on AWS along with the mount targets. It also creates a security group that allows access to 2049 to any instance that has the security group attached to it.
module "efs-0" {
source = "AustinCloudGuru/efs/aws"
# You should pin the module to a specific version
# version = "x.x.x"
vpc_id = "vpc-0156c7c6959ba5858"
name = "dev-efs"
subnet_ids = ["subnet-05b1a3ffd786709d5", "subnet-0a35212c972a2af05", "subnet-0d0e78f696428aa28"]
security_group_ingress = {
default = {
description = "NFS Inbound"
from_port = 2049
protocol = "tcp"
to_port = 2049
self = true
cidr_blocks = []
},
ssh = {
description = "ssh"
from_port = 22
protocol = "tcp"
to_port = 22
self = true
cidr_blocks = []
}
}
lifecycle_policy = [{
"transition_to_ia" = "AFTER_30_DAYS"
}]
tags = {
Terraform = "true"
Environment = "development"
}
}
Name |
Version |
aws |
>= 2.68, < 4.0 |
No modules.
Name |
Description |
Type |
Default |
Required |
encrypted |
If true, the file system will be encrypted |
bool |
false |
no |
kms_key_id |
If set, use a specific KMS key |
string |
null |
no |
lifecycle_policy |
Lifecycle Policy for the EFS Filesystem |
list(object({ transition_to_ia = string })) |
[] |
no |
name |
A unique name (a maximum of 64 characters are allowed) used as reference when creating the Elastic File System to ensure idempotent file system creation. |
string |
n/a |
yes |
performance_mode |
The file system performance mode. |
string |
null |
no |
provisioned_throughput_in_mibps |
The throughput, measured in MiB/s, that you want to provision for the file system. Only applicable with throughput_mode set to provisioned. |
string |
null |
no |
security_group_egress |
Can be specified multiple times for each egress rule. |
map(object({ description = string from_port = number protocol = string to_port = number self = bool cidr_blocks = list(string) })) |
{ "default": { "cidr_blocks": [ "0.0.0.0/0" ], "description": "Allow All Outbound", "from_port": 0, "protocol": "-1", "self": false, "to_port": 0 } } |
no |
security_group_ingress |
Can be specified multiple times for each ingress rule. |
map(object({ description = string from_port = number protocol = string to_port = number self = bool cidr_blocks = list(string) })) |
{ "default": { "cidr_blocks": null, "description": "NFS Inbound", "from_port": 2049, "protocol": "tcp", "self": true, "to_port": 2049 } } |
no |
subnet_ids |
Subnet IDs for Mount Targets |
list(string) |
n/a |
yes |
tags |
A map of tags to add to all resources |
map(string) |
{} |
no |
throughput_mode |
Throughput mode for the file system. |
string |
null |
no |
vpc_id |
The name of the VPC that EFS will be deployed to |
string |
n/a |
yes |