-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathelastic-file-system.json
131 lines (119 loc) · 3.61 KB
/
elastic-file-system.json
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
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Create EFS, mount points, security groups.",
"Metadata": {
"Sample": {
"Description": "This is a sample metadata entry."
}
},
"Parameters": {
"vpcID": {
"Type": "AWS::EC2::VPC::Id",
"Description": "VPC Id"
},
"privateSubnetAZ1": {
"Type": "AWS::EC2::Subnet::Id",
"Description": "ID of private subnet in first AZ."
},
"privateSubnetAZ2": {
"Type": "AWS::EC2::Subnet::Id",
"Description": "ID of private subnet in second AZ."
},
"identifyingTagValue": {
"Type": "String",
"Default": "beanstalk-docker-example-EFS",
"Description": "Value of tag to use to identify these resources."
}
},
"Mappings": {},
"Conditions": {},
"Resources": {
"mountTargetSecurityGroup": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"VpcId": {
"Ref": "vpcID"
},
"GroupDescription": "Security group for mount target",
"SecurityGroupIngress": [{
"IpProtocol": "tcp",
"FromPort": "22",
"ToPort": "22",
"CidrIp": "10.0.0.0/8"
}, {
"IpProtocol": "tcp",
"FromPort": "80",
"ToPort": "80",
"CidrIp": "0.0.0.0/0"
}]
}
},
"securityGroupIngress": {
"Type": "AWS::EC2::SecurityGroupIngress",
"Properties": {
"GroupId": {
"Ref": "mountTargetSecurityGroup"
},
"IpProtocol": "tcp",
"ToPort": "2049",
"FromPort": "2049",
"SourceSecurityGroupId": {
"Ref": "mountTargetSecurityGroup"
}
}
},
"fileSystem": {
"Type": "AWS::EFS::FileSystem",
"Properties": {
"FileSystemTags": [{
"Key": "Name",
"Value": {
"Ref": "identifyingTagValue"
}
}]
}
},
"mountTargetAZ1": {
"Type": "AWS::EFS::MountTarget",
"Properties": {
"FileSystemId": {
"Ref": "fileSystem"
},
"SubnetId": {
"Ref": "privateSubnetAZ1"
},
"SecurityGroups": [{
"Ref": "mountTargetSecurityGroup"
}]
}
},
"mountTargetAZ2": {
"Type": "AWS::EFS::MountTarget",
"Properties": {
"FileSystemId": {
"Ref": "fileSystem"
},
"SubnetId": {
"Ref": "privateSubnetAZ2"
},
"SecurityGroups": [{
"Ref": "mountTargetSecurityGroup"
}]
}
}
},
"Outputs": {
"OutputFileSystemId": {
"Description": "Id of newly created Elastic File System",
"Value": {
"Ref": "fileSystem"
}
},
"OutputSecurityGroup": {
"Description": "Add instances that need access to the EFS to this security group",
"Value": {
"Ref": "mountTargetSecurityGroup"
}
}
}
}