Skip to content

Instantly share code, notes, and snippets.

@katesclau
Created January 17, 2017 15:33
Show Gist options
  • Save katesclau/85e65290122bced1b3b070865e89d04b to your computer and use it in GitHub Desktop.
Save katesclau/85e65290122bced1b3b070865e89d04b to your computer and use it in GitHub Desktop.
resource "aws_efs_file_system" "filesystem" {
creation_token = "${var.efs_name}"
}
resource "aws_efs_mount_target" "fs_target" {
file_system_id = "${aws_efs_file_system.filesystem.id}"
subnet_id = "${var.subnet_id}"
security_groups = ["${var.vpc_sg_ids}"]
}
output "efs_id" { value = "${aws_efs_file_system.filesystem.id}" }
output "net_id" { value = "${aws_efs_file_system.filesystem.network_interface_id}" }
# Network & Region
variable "subnet_id" {}
variable "vpc_sg_ids" {}
# Name
variable "efs_name" {}
# EFS
module "filesystem" {
source = "./efs"
efs_name = "${var.efs_name}"
vpc_sg_ids = "${var.vpc_sg_ids}"
subnet_id = "${var.subnet_id}"
}
# Location and Network =====================================
variable "subnet_id" { default = "<subnet-id>" }
variable "vpc_sg_ids" { default = "<security-group-ids>" }
# EFS ======================================================
# Name
variable "efs_name" { default = "cluster-tut-efs" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment