Skip to content

Commit f93f0db

Browse files
author
Bhavik Kumar
committed
Make dependencies explicit to stop errors
1 parent f2d176f commit f93f0db

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

deployment/templates/service.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ Resources:
206206
- arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceRole
207207

208208
ExternalService:
209+
DependsOn:
210+
- ExternalTargetGroup
211+
- TaskDefinition
212+
- ServiceRole
209213
Condition: IsExternalFacing
210214
Type: AWS::ECS::Service
211215
Properties:
@@ -228,6 +232,10 @@ Resources:
228232
TargetGroupArn: !Ref ExternalTargetGroup
229233

230234
InternalService:
235+
DependsOn:
236+
- InternalTargetGroup
237+
- TaskDefinition
238+
- ServiceRole
231239
Condition: IsInternalFacing
232240
Type: AWS::ECS::Service
233241
Properties:
@@ -249,7 +257,6 @@ Resources:
249257
ContainerPort: 8080
250258
TargetGroupArn: !Ref InternalTargetGroup
251259

252-
253260
TaskDefinition:
254261
Type: AWS::ECS::TaskDefinition
255262
Properties:
@@ -283,6 +290,8 @@ Resources:
283290
Value: !Ref SpringProfile
284291

285292
HTTPCodeExternalTarget5XXTooHighAlarm:
293+
DependsOn:
294+
- ExternalTargetGroup
286295
Condition: CreateExternalAlarms
287296
Type: 'AWS::CloudWatch::Alarm'
288297
Properties:
@@ -304,6 +313,9 @@ Resources:
304313
- Name: TargetGroup
305314
Value: !GetAtt 'ExternalTargetGroup.TargetGroupFullName'
306315
NoHealthyExternalServiceAlarm:
316+
DependsOn:
317+
- ExternalTargetGroup
318+
- ExternalService
307319
Condition: CreateExternalAlarms
308320
Type: 'AWS::CloudWatch::Alarm'
309321
Properties:
@@ -326,6 +338,8 @@ Resources:
326338
Value: !GetAtt 'ExternalTargetGroup.TargetGroupFullName'
327339

328340
HTTPCodeInternalTarget5XXTooHighAlarm:
341+
DependsOn:
342+
- InternalTargetGroup
329343
Condition: CreateInternalAlarms
330344
Type: 'AWS::CloudWatch::Alarm'
331345
Properties:
@@ -347,6 +361,9 @@ Resources:
347361
- Name: TargetGroup
348362
Value: !GetAtt 'InternalTargetGroup.TargetGroupFullName'
349363
NoHealthyInternalServiceAlarm:
364+
DependsOn:
365+
- InternalTargetGroup
366+
- InternalService
350367
Condition: CreateInternalAlarms
351368
Type: 'AWS::CloudWatch::Alarm'
352369
Properties:

0 commit comments

Comments
 (0)