This repository has been archived by the owner on Jul 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
/
storage.tf
114 lines (97 loc) · 3.77 KB
/
storage.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Admin EFS
resource "aws_security_group" "admin-efs-sg" {
name = "admin-efs-sg"
description = "Admin EFS SG"
vpc_id = "${aws_vpc.apps-shared-vpc.id}"
}
resource "aws_security_group_rule" "admin-efs-sg-allownfsfromadmin" {
type = "ingress"
from_port = 2049
to_port = 2049
protocol = "tcp"
source_security_group_id = "${aws_security_group.admin-ec2-sg.id}"
security_group_id = "${aws_security_group.admin-efs-sg.id}"
}
resource "aws_efs_file_system" "jenkins-efs" {
tags {
Name = "jenkins-efs"
}
}
resource "aws_efs_mount_target" "jenkins-efs-shared-1a" {
file_system_id = "${aws_efs_file_system.jenkins-efs.id}"
subnet_id = "${aws_subnet.apps-shared-1a.id}"
security_groups = ["${aws_security_group.admin-efs-sg.id}"]
}
resource "aws_efs_mount_target" "jenkins-efs-shared-1c" {
file_system_id = "${aws_efs_file_system.jenkins-efs.id}"
subnet_id = "${aws_subnet.apps-shared-1c.id}"
security_groups = ["${aws_security_group.admin-efs-sg.id}"]
}
resource "aws_efs_mount_target" "jenkins-efs-shared-1d" {
file_system_id = "${aws_efs_file_system.jenkins-efs.id}"
subnet_id = "${aws_subnet.apps-shared-1d.id}"
security_groups = ["${aws_security_group.admin-efs-sg.id}"]
}
# Grafana EFS
resource "aws_efs_file_system" "grafana-efs" {
tags {
Name = "grafana-efs"
}
}
resource "aws_efs_mount_target" "grafana-efs-1a" {
file_system_id = "${aws_efs_file_system.grafana-efs.id}"
subnet_id = "${aws_subnet.apps-shared-1a.id}"
security_groups = ["${aws_security_group.admin-efs-sg.id}"]
}
resource "aws_efs_mount_target" "grafana-efs-1c" {
file_system_id = "${aws_efs_file_system.grafana-efs.id}"
subnet_id = "${aws_subnet.apps-shared-1c.id}"
security_groups = ["${aws_security_group.admin-efs-sg.id}"]
}
resource "aws_efs_mount_target" "grafana-efs-1d" {
file_system_id = "${aws_efs_file_system.grafana-efs.id}"
subnet_id = "${aws_subnet.apps-shared-1d.id}"
security_groups = ["${aws_security_group.admin-efs-sg.id}"]
}
# Public Jenkins EFS
resource "aws_security_group" "jenkins-public-efs-sg" {
name = "jenkins-public-efs-sg"
description = "jenkins-public EFS SG"
vpc_id = "${aws_vpc.apps-shared-vpc.id}"
}
resource "aws_security_group_rule" "jenkins-public-efs-sg-allownfsfromjenkins" {
type = "ingress"
from_port = 2049
to_port = 2049
protocol = "tcp"
source_security_group_id = "${aws_security_group.jenkins-public-ec2-sg.id}"
security_group_id = "${aws_security_group.jenkins-public-efs-sg.id}"
}
resource "aws_security_group_rule" "jenkins-public-efs-sg-allownfsfromadmin" {
type = "ingress"
from_port = 2049
to_port = 2049
protocol = "tcp"
source_security_group_id = "${aws_security_group.admin-ec2-sg.id}"
security_group_id = "${aws_security_group.jenkins-public-efs-sg.id}"
}
resource "aws_efs_file_system" "jenkins-public-efs" {
tags {
Name = "jenkins-public-efs"
}
}
resource "aws_efs_mount_target" "jenkins-public-efs-shared-1a" {
file_system_id = "${aws_efs_file_system.jenkins-public-efs.id}"
subnet_id = "${aws_subnet.apps-shared-1a.id}"
security_groups = ["${aws_security_group.jenkins-public-efs-sg.id}"]
}
resource "aws_efs_mount_target" "jenkins-public-efs-shared-1c" {
file_system_id = "${aws_efs_file_system.jenkins-public-efs.id}"
subnet_id = "${aws_subnet.apps-shared-1c.id}"
security_groups = ["${aws_security_group.jenkins-public-efs-sg.id}"]
}
resource "aws_efs_mount_target" "jenkins-public-efs-shared-1d" {
file_system_id = "${aws_efs_file_system.jenkins-public-efs.id}"
subnet_id = "${aws_subnet.apps-shared-1d.id}"
security_groups = ["${aws_security_group.jenkins-public-efs-sg.id}"]
}