-
Notifications
You must be signed in to change notification settings - Fork 581
/
efs.yml
173 lines (173 loc) · 3.94 KB
/
efs.yml
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
---
AWSTemplateFormatVersion: '2010-09-09'
Description: Create Elastic File System v20161029-1200
Parameters:
# Ownership
Owner:
Type: String
Default: FirstName LastName
Project:
Type: String
Default: EFS Mount
DeleteAfter:
Type: String
Default: 00/00/201x
# Network
VPC:
Type: AWS::EC2::VPC::Id
Subnet1:
Type: AWS::EC2::Subnet::Id
Subnet2:
Type: AWS::EC2::Subnet::Id
Subnet3:
Type: AWS::EC2::Subnet::Id
# EFS
PerformanceMode:
Type: String
Default: generalPurpose
AllowedValues:
- generalPurpose
- maxIO
Resources:
FileSystem:
Type: AWS::EFS::FileSystem
Properties:
FileSystemTags:
- Key: Name
Value: !Ref AWS::StackName
- Key: Owner
Value: !Ref Owner
- Key: Project
Value: !Ref Project
- Key: DeleteAfter
Value: !Ref DeleteAfter
PerformanceMode: !Ref PerformanceMode
MountTarget1:
Type: AWS::EFS::MountTarget
DependsOn:
- FileSystem
- EfsSecurityGroup
Properties:
FileSystemId: !Ref FileSystem
SubnetId: !Ref Subnet1
SecurityGroups:
- !Ref EfsSecurityGroup
MountTarget2:
Type: AWS::EFS::MountTarget
DependsOn:
- FileSystem
- EfsSecurityGroup
Properties:
FileSystemId: !Ref FileSystem
SubnetId: !Ref Subnet2
SecurityGroups:
- !Ref EfsSecurityGroup
MountTarget3:
Type: AWS::EFS::MountTarget
DependsOn:
- FileSystem
- EfsSecurityGroup
Properties:
FileSystemId: !Ref FileSystem
SubnetId: !Ref Subnet3
SecurityGroups:
- !Ref EfsSecurityGroup
EfsSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Instance to EFS Mount Access
VpcId: !Ref VPC
Tags:
- Key: Name
Value: !Ref AWS::StackName
- Key: Owner
Value: !Ref Owner
- Key: Project
Value: !Ref Project
- Key: DeleteAfter
Value: !Ref DeleteAfter
SecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
DependsOn: EfsSecurityGroup
Properties:
GroupId: !Ref EfsSecurityGroup
IpProtocol: "-1"
SourceSecurityGroupId: !Ref EfsSecurityGroup
Outputs:
Owner:
Description: Team or Individual that Owns this Formation.
Value: !Ref Owner
Project:
Description: The project name
Value: !Ref Project
VPC:
Description: Created VPC
Value: !Ref VPC
Subnet1:
Description: Subnet 1
Value: !Ref Subnet1
Subnet2:
Description: Subnet 2
Value: !Ref Subnet2
Subnet3:
Description: Subnet 3
Value: !Ref Subnet3
FileSystem:
Description: FileSystem
Value: !Ref FileSystem
PerformanceMode:
Description: PerformanceMode
Value: !Ref PerformanceMode
MountTarget1:
Description: MountTarget 1
Value: !Ref MountTarget1
MountTarget2:
Description: MountTarget 2
Value: !Ref MountTarget1
MountTarget3:
Description: MountTarget 3
Value: !Ref MountTarget1
# MountTargetDns1:
# Description: MountTarget 1
# Value: !GetAtt MountTarget1.DNSName
# MountTargetDns2:
# Description: MountTarget 2
# Value: !GetAtt MountTarget1.DNSName
# MountTargetDns3:
# Description: MountTarget 3
# Value: !GetAtt MountTarget1.DNSName
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: Ownership
Parameters:
- Owner
- Project
- DeleteAfter
- Label:
default: Network Configuration
Parameters:
- VPC
- Subnet1
- Subnet2
- Subnet3
- Label:
default: EFS Configuration
Parameters:
- PerformanceMode
ParameterLabels:
Owner:
default: Team or Individual Owner
DeleteAfter:
default: Delete After Date
VPC:
default: VPC ID
Subnet1:
default: Subnet 1
Subnet2:
default: Subnet 2
Subnet3:
default: Subnet 3
PerformanceMode:
default: EFS Performance Mode