Add EFS storage and mount targets to Mesos cluster

This commit is contained in:
Yousef Alam 2016-09-12 12:07:32 +01:00
Родитель ff9564ec2e
Коммит e35f0b9fd4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 10B7403F339660D9
1 изменённых файлов: 38 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,38 @@
resource "aws_security_group" "marathon-efs-sg" {
name = "marathon-${var.environment}-efs-sg"
description = "Marathon EFS ${var.environment} SG"
vpc_id = "${var.vpc_id}"
}
resource "aws_security_group_rule" "marathon-efs-sg-allownfsfromslave" {
type = "ingress"
from_port = 2049
to_port = 2049
protocol = "tcp"
source_security_group_id = "${aws_security_group.mesos-slave-ec2-sg.id}"
security_group_id = "${aws_security_group.marathon-efs-sg.id}"
}
resource "aws_efs_file_system" "marathon-efs" {
tags {
Name = "marathon-efs-${var.environment}"
}
}
resource "aws_efs_mount_target" "marathon-efs-shared-1a" {
file_system_id = "${aws_efs_file_system.marathon-efs.id}"
subnet_id = "${var.subnet1}"
security_groups = ["${aws_security_group.marathon-efs-sg.id}"]
}
resource "aws_efs_mount_target" "marathon-efs-shared-1c" {
file_system_id = "${aws_efs_file_system.marathon-efs.id}"
subnet_id = "${var.subnet2}"
security_groups = ["${aws_security_group.marathon-efs-sg.id}"]
}
resource "aws_efs_mount_target" "marathon-efs-shared-1d" {
file_system_id = "${aws_efs_file_system.marathon-efs.id}"
subnet_id = "${var.subnet3}"
security_groups = ["${aws_security_group.marathon-efs-sg.id}"]
}