Skip to content

Commit 6dddc2a

Browse files
committed
Move aarch64 capacity provider association
1 parent a8346f6 commit 6dddc2a

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

spire/templates/root.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ Resources:
405405
VpcPublicSubnet1Id: !GetAtt SharedVpcStack.Outputs.PublicSubnet1Id
406406
VpcPublicSubnet2Id: !GetAtt SharedVpcStack.Outputs.PublicSubnet2Id
407407
VpcPublicSubnet3Id: !GetAtt SharedVpcStack.Outputs.PublicSubnet3Id
408+
Aarch64AsgCapacityProviderName: !GetAtt SharedEcsAsgAarch64Stack.Outputs.CapacityProviderName
408409
EcsClusterName: !GetAtt SharedEcsClusterStack.Outputs.EcsClusterName
409410
SharedEcsAsgInstanceSecurityGroupId: !GetAtt SharedEcsAsgSecurityGroupStack.Outputs.InstanceSecurityGroupId
410411
LoadBalancerSecurityGroupId: !GetAtt SharedAlbStack.Outputs.LoadBalancerSecurityGroupId

spire/templates/shared-ecs/asg-aarch64.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,9 @@ Resources:
400400
- !Ref VpcPublicSubnet2Id
401401
- !Ref VpcPublicSubnet3Id
402402

403+
# The capacity provider is associated with the ECS cluster in the x86-64
404+
# template, for that's where the association resource was originally created
405+
# and it's a pain to move.
403406
DefaultCapacityProvider:
404407
Type: AWS::ECS::CapacityProvider
405408
Properties:
@@ -424,21 +427,9 @@ Resources:
424427
- { Key: prx:cloudformation:root-stack-id, Value: !Ref RootStackId }
425428
- { Key: prx:ops:environment, Value: !Ref EnvironmentType }
426429
- { Key: prx:dev:application, Value: Common }
427-
ClusterCapacityProviderAssociation:
428-
Type: AWS::ECS::ClusterCapacityProviderAssociations
429-
Properties:
430-
Cluster: !Ref EcsClusterName
431-
CapacityProviders:
432-
- !Ref DefaultCapacityProvider
433-
- !If [IsStaging, FARGATE, !Ref "AWS::NoValue"]
434-
- !If [IsStaging, FARGATE_SPOT, !Ref "AWS::NoValue"]
435-
DefaultCapacityProviderStrategy:
436-
# With only one default capacity provider, the base and weight won't
437-
# factor into scheduling; everything will be even within the ASG
438-
- Base: 0
439-
Weight: 1
440-
CapacityProvider: !Ref DefaultCapacityProvider
441430

442431
Outputs:
443432
AsgName:
444433
Value: !Ref Asg
434+
CapacityProviderName:
435+
Value: !Ref DefaultCapacityProvider

spire/templates/shared-ecs/asg-x86-64.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Parameters:
3434
VpcPublicSubnet1Id: { Type: AWS::EC2::Subnet::Id }
3535
VpcPublicSubnet2Id: { Type: AWS::EC2::Subnet::Id }
3636
VpcPublicSubnet3Id: { Type: AWS::EC2::Subnet::Id }
37+
Aarch64AsgCapacityProviderName: { Type: String }
3738
EcsClusterName: { Type: String }
3839
SharedEcsAsgInstanceSecurityGroupId: { Type: AWS::EC2::SecurityGroup::Id }
3940
LoadBalancerSecurityGroupId: { Type: AWS::EC2::SecurityGroup::Id }
@@ -433,11 +434,15 @@ Resources:
433434
- { Key: prx:ops:environment, Value: !Ref EnvironmentType }
434435
- { Key: prx:dev:application, Value: Common }
435436
ClusterCapacityProviderAssociation:
437+
# This is handling associations for capacity providers, even ones not
438+
# created in this template. It exists here because we used to only have one
439+
# ASG template, and moving it is sort of a pain.
436440
Type: AWS::ECS::ClusterCapacityProviderAssociations
437441
Properties:
438442
Cluster: !Ref EcsClusterName
439443
CapacityProviders:
440444
- !Ref DefaultCapacityProvider
445+
- !Ref Aarch64AsgCapacityProviderName
441446
- !If [IsStaging, FARGATE, !Ref "AWS::NoValue"]
442447
- !If [IsStaging, FARGATE_SPOT, !Ref "AWS::NoValue"]
443448
DefaultCapacityProviderStrategy:

0 commit comments

Comments
 (0)