1
1
Resources :
2
- WebserverExternalSecurityGroup :
2
+ workerSecurityGroup :
3
3
Type : AWS::EC2::SecurityGroup
4
4
Properties :
5
- GroupDescription : Security group for Airflow webserver. Allow all inbound traffic.
6
- GroupName : !Join ["-", [!ImportValue parameter-ServiceName, !ImportValue parameter-Environment, "webserver-external -security-group"]]
5
+ GroupDescription : Security group for Airflow workers
6
+ GroupName : !Join ["-", [!ImportValue parameter-ServiceName, !ImportValue parameter-Environment, "worker -security-group"]]
7
7
SecurityGroupEgress :
8
8
- CidrIp : 0.0.0.0/0
9
9
FromPort : 0
10
10
IpProtocol : -1
11
11
ToPort : 0
12
12
SecurityGroupIngress :
13
- - CidrIp : 0.0.0.0/0
14
- FromPort : 80
15
- IpProtocol : tcp
16
- ToPort : 80
17
- VpcId : !ImportValue network-VpcId
18
- Tags :
19
- - Key : Name
20
- Value : !Join ["-", [!ImportValue parameter-ServiceName, !ImportValue parameter-Environment, "webserver-external-security-group"]]
21
-
22
- WebserverInternalSecurityGroup :
23
- Type : AWS::EC2::SecurityGroup
24
- Properties :
25
- GroupDescription : Security group for Airflow webserver.
26
- GroupName : !Join ["-", [!ImportValue parameter-ServiceName, !ImportValue parameter-Environment, "webserver-internal-security-group"]]
27
- SecurityGroupEgress :
28
- - CidrIp : 0.0.0.0/0
29
- FromPort : 0
30
- IpProtocol : -1
31
- ToPort : 0
32
- SecurityGroupIngress :
33
- - SourceSecurityGroupId : !GetAtt WebserverExternalSecurityGroup.GroupId
34
- FromPort : 8080
13
+ - CidrIp : !Join ["/", [!ImportValue parameter-CidrBlock, "16"]]
14
+ FromPort : 8793
35
15
IpProtocol : tcp
36
- ToPort : 8080
16
+ ToPort : 8793
37
17
VpcId : !ImportValue network-VpcId
38
18
Tags :
39
19
- Key : Name
40
- Value : !Join ["-", [!ImportValue parameter-ServiceName, !ImportValue parameter-Environment, "webserver-internal -security-group"]]
20
+ Value : !Join ["-", [!ImportValue parameter-ServiceName, !ImportValue parameter-Environment, "worker -security-group"]]
41
21
42
- WebserverTaskDefinition :
22
+ workerTaskDefinition :
43
23
Type : AWS::ECS::TaskDefinition
44
24
Properties :
45
- Cpu : 1024
25
+ Cpu : 512
46
26
Memory : 2048
47
27
ExecutionRoleArn : !ImportValue iam-ECSTaskRoleArn
48
- Family : !Join ["-", [!ImportValue parameter-ServiceName, !ImportValue parameter-Environment, "webserver -task-definition"]]
28
+ Family : !Join ["-", [!ImportValue parameter-ServiceName, !ImportValue parameter-Environment, "worker -task-definition"]]
49
29
NetworkMode : awsvpc
50
30
RequiresCompatibilities :
51
31
- FARGATE
52
32
ContainerDefinitions :
53
- - Name : !Join ["-", [!ImportValue parameter-ServiceName, !ImportValue parameter-Environment, "webserver "]]
33
+ - Name : !Join ["-", [!ImportValue parameter-ServiceName, !ImportValue parameter-Environment, "worker "]]
54
34
Image : !Sub
55
35
- " ${AWS::AccountId}.dkr.ecr.${aws_region}.amazonaws.com/${ecr_repository}:${image_version}"
56
36
- aws_region : !ImportValue parameter-AwsRegion
57
37
ecr_repository : !ImportValue ecs-AirflowDockerRepositoryName
58
38
image_version : !ImportValue parameter-ImageVersion
59
39
Essential : true
60
40
PortMappings :
61
- - ContainerPort : 8080
62
- HostPort : 8080
41
+ - ContainerPort : 8793
42
+ HostPort : 8793
63
43
Command :
64
- - webserver
44
+ - worker
65
45
Environment :
66
46
- Name : REDIS_HOST
67
47
Value : !ImportValue redis-CeleryBackendHost
@@ -94,7 +74,7 @@ Resources:
94
74
service : !ImportValue parameter-ServiceName
95
75
environment : !ImportValue parameter-Environment
96
76
awslogs-region : !ImportValue parameter-AwsRegion
97
- awslogs-stream-prefix : webserver
77
+ awslogs-stream-prefix : worker
98
78
Tags :
99
79
- Key : Name
100
- Value : !Join ["-", [!ImportValue parameter-ServiceName, !ImportValue parameter-Environment, "webserver -task-definition"]]
80
+ Value : !Join ["-", [!ImportValue parameter-ServiceName, !ImportValue parameter-Environment, "worker -task-definition"]]
0 commit comments