Skip to content

Commit

Permalink
Adding back in conditional statements and Capacity Provider logic for…
Browse files Browse the repository at this point in the history
… environments.
  • Loading branch information
Caesonia committed May 13, 2024
1 parent b3901d9 commit c42fc23
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 10 deletions.
23 changes: 18 additions & 5 deletions cfn/cfn-registry-cluster.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ Parameters:
AllowedValues: [1, 7, 14, 30, 90]
Default: 30

Conditions:
IsStaging: !Or [!Equals [!Ref DNS, 'staging'], !Equals [!Ref DNS, 'demo']]
IsPrimary: !Equals [!Ref DNS, 'prod']


Resources:

Expand All @@ -65,11 +69,18 @@ Resources:
- FARGATE
- FARGATE_SPOT
DefaultCapacityProviderStrategy:
- CapacityProvider: FARGATE
Weight: 1
Base: 1
- CapacityProvider: FARGATE_SPOT
Weight: 2
Fn::If:
- IsPrimary
-
- CapacityProvider: FARGATE
Weight: 1
Base: 1
- CapacityProvider: FARGATE_SPOT
Weight: 2
-
- CapacityProvider: FARGATE_SPOT
Base: 1
Weight: 1
ClusterSettings:
- Name: containerInsights
Value: enabled
Expand All @@ -82,6 +93,8 @@ Resources:
- Key: Name
Value: !Sub 'ecs-registry-${DNS}'
- Key: Environment
- Key: MicroServ
Value: registry
Value: !Ref DNS
- Key: Service
Value: registry
Expand Down
22 changes: 17 additions & 5 deletions cfn/cfn-registry-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ Parameters:
AllowedValues: [1, 7, 14, 30, 90]
Default: 30

Conditions:
IsStaging: !Or [!Equals [!Ref DNS, 'staging'], !Equals [!Ref DNS, 'demo']]
IsPrimary: !Equals [!Ref DNS, 'prod']

Resources:

Expand All @@ -65,11 +68,18 @@ Resources:
- FARGATE
- FARGATE_SPOT
DefaultCapacityProviderStrategy:
- CapacityProvider: FARGATE
Weight: 1
Base: 1
- CapacityProvider: FARGATE_SPOT
Weight: 2
Fn::If:
- IsPrimary
-
- CapacityProvider: FARGATE
Weight: 1
Base: 1
- CapacityProvider: FARGATE_SPOT
Weight: 2
-
- CapacityProvider: FARGATE_SPOT
Base: 1
Weight: 1
ClusterSettings:
- Name: containerInsights
Value: enabled
Expand Down Expand Up @@ -140,6 +150,8 @@ Resources:
Tags:
- Key: Service
Value: registry
- Key: MicroServ
Value: registry
- Key: Environment
Value: !Ref "DNS"
TaskDefinition: !Ref RegistryTaskDefinition
Expand Down

0 comments on commit c42fc23

Please sign in to comment.