-
Notifications
You must be signed in to change notification settings - Fork 1
/
OMEROstack_RW.yml
167 lines (164 loc) · 6.59 KB
/
OMEROstack_RW.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
AWSTemplateFormatVersion: 2010-09-09
Parameters:
OMEROVPCID:
Description: ID of the VPC
Type: AWS::EC2::VPC::Id
DatabasePrivateSubnet1Id:
Description: SubnetId, for Availability Zone 1 in the region in your VPC
Type: AWS::EC2::Subnet::Id
DatabasePrivateSubnet2Id:
Description: SubnetId, for Availability Zone 2 in the region in your VPC
Type: AWS::EC2::Subnet::Id
ECSPublicSubnet1Id:
Description: SubnetId, for Availability Zone 1 in the region in your VPC. The only one OMERO Server instance is deployed in this subnet.
Type: AWS::EC2::Subnet::Id
ECSPublicSubnet2Id:
Description: SubnetId, for Availability Zone 2 in the region in your VPC. None of OMERO Server instance is deployed in this subnet.
Type: AWS::EC2::Subnet::Id
CIDROMEROSecurityGroup:
Type: String
Default: '0.0.0.0/0'
OMEROStorageEFSNameTag:
Description: The name of the EFS volume
Type: String
MinLength: '1'
Default: OMEROEFSvolume
EFSBackup:
Type: String
Description: whether enable EFS backup or not. EFS backup has extra associated cost.
Default: ENABLED
AllowedValues: [ENABLED, DISABLED]
EFSStorageArchiveAfter:
Type: String
Description: A value that describes the period of time that a file is not accessed, after which it transitions to the IA storage class.
Default: AFTER_90_DAYS
AllowedValues: [AFTER_14_DAYS, AFTER_30_DAYS, AFTER_60_DAYS, AFTER_7_DAYS, AFTER_90_DAYS]
RDSDBMultiAZ:
Type: String
Default: False
Description: True or False for RDS Multiple Availability Zone
RDSDBInstanceSize:
Type: String
Default: "db.t3.medium"
RDSDBStorage:
Type: String
Default: "gp2"
RDSDStorageSize:
Type: Number
Default: 20
RDSDBUserName:
Type: String
Default: omero
Description: OMERO Database User
NoEcho: true
RDSDBBackupRetainInDays:
Type: Number
Default: 30
Description: The number of days for which automated backups are retained. Setting this parameter to a positive number (from 1 to 35) enables backups. Setting this parameter to 0 disables automated backups.
ExistingLoadBalancerARN:
Description: Name of the LoadBalancer to connect to (optional)
Type: String
EC2KeyName:
Type: AWS::EC2::KeyPair::KeyName
Description: Name of an existing EC2 KeyPair to enable SSH access to the ECS EC2 instance hosting OMERO Server.
LoadBalancerAccessLogBucketName:
Type: String
Default: ecs-loadbalancer-accesslog
CountofWebInstances:
Type: Number
Default: 2
Description: Number of OMERO Web containers
OMEROWebContainerCPUSize:
Description: The number of cpu units the Amazon ECS container agent will reserve for the container.
Type: Number
Default: 2048
AllowedValues: [256, 512, 1024, 2048, 4096]
OMEROWebContainerMemorySize:
Description: The amount (in MiB) of memory to present to the container. . Memory should be at least two times of vCPU unit according to documentation.
Type: Number
Default: 4096
AllowedValues: [512, 1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 9216, 10240, 11264, 12288, 13312, 14336, 15360, 16384, 30720]
EC2InstanceType:
Description: EC2 instance type
Type: String
Default: m4.xlarge
AllowedValues: [t2.large, m3.large,
m3.xlarge, m3.2xlarge, m4.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m4.10xlarge,
c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, c3.large, c3.xlarge,
c3.2xlarge, c3.4xlarge, c3.8xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge,
r3.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge]
ConstraintDescription: Please choose a valid instance type.
OMEROServerContainerCPUSize:
Description: The number of cpu units the Amazon ECS container agent will reserve for the container.
Type: Number
Default: 4096
AllowedValues: [256, 512, 1024, 2048, 4096]
OMEROServerContainerMemorySize:
Description: The amount (in MiB) of memory to present to the container. . Memory should be at least two times of vCPU unit according to documentation.
Type: Number
Default: 10240
AllowedValues: [512, 1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 9216, 10240, 11264, 12288, 13312, 14336, 15360, 16384, 30720]
Resources:
StorageStack:
Type: 'AWS::CloudFormation::Stack'
Properties:
TemplateURL: https://omero-on-aws.s3-us-west-1.amazonaws.com/OMEROstorage.yaml
Parameters:
EFSNameTag: !Ref OMEROStorageEFSNameTag
VPCID: !Ref OMEROVPCID
PrivateSubnet1Id: !Ref DatabasePrivateSubnet1Id
PrivateSubnet2Id: !Ref DatabasePrivateSubnet2Id
CIDRblock4OMEROSecurityGroup: !Ref CIDROMEROSecurityGroup
EnableEFSBackup: !Ref EFSBackup
EFSStorageInfrequentAcessAfter: !Ref EFSStorageArchiveAfter
IsDBMultiAZ: !Ref RDSDBMultiAZ
RDSDBInstanceClass: !Ref RDSDBInstanceSize
RDSDBStorageType: !Ref RDSDBStorage
RDSDBAllocatedStorage: !Ref RDSDStorageSize
DBUser: !Ref RDSDBUserName
RDSDBBackupRetentionDays: !Ref RDSDBBackupRetainInDays
ECScontainerStack:
Type: 'AWS::CloudFormation::Stack'
Properties:
TemplateURL: https://omero-on-aws.s3-us-west-1.amazonaws.com/OMEROonEC2EFSRDS_RW.yml
Parameters:
ParameterLoadBalancerARN: !Ref ExistingLoadBalancerARN
VPCID: !Ref OMEROVPCID
PublicSubnet1Id: !Ref ECSPublicSubnet1Id
PublicSubnet2Id: !Ref ECSPublicSubnet2Id
KeyName: !Ref EC2KeyName
LBAccessLogBucketName: !Ref LoadBalancerAccessLogBucketName
NumberofWebInstances: !Ref CountofWebInstances
OMEROWebContainerCPU: !Ref OMEROWebContainerCPUSize
OMEROWebContainerMemory: !Ref OMEROWebContainerMemorySize
InstanceType: !Ref EC2InstanceType
OMEROServerContainerCPU: !Ref OMEROServerContainerCPUSize
OMEROServerContainerMemory: !Ref OMEROServerContainerMemorySize
DBUser: !Ref RDSDBUserName
EFSSecurityGroup:
Fn::GetAtt:
- StorageStack
- Outputs.EFSSecurityGroup
OmeroSecurityGroup:
Fn::GetAtt:
- StorageStack
- Outputs.OmeroSecurityGroup
EFSFileSystem:
Fn::GetAtt:
- StorageStack
- Outputs.EFSFileSystemID
RDSEndpointAddress:
Fn::GetAtt:
- StorageStack
- Outputs.RDSEndpointAddress
RDSDatabaseSecret:
Fn::GetAtt:
- StorageStack
- Outputs.RDSDatabaseSecret
Outputs:
OMEROLoadBalancerHTTPEnpoint:
Description: The HTTP endpoint of the OMEROLoadBalancer
Value:
Fn::GetAtt:
- ECScontainerStack
- Outputs.OMEROLoadBalancerHTTPEnpoint