diff --git a/templates/aws-stack.yml b/templates/aws-stack.yml index dd430588c..0fd03a26b 100644 --- a/templates/aws-stack.yml +++ b/templates/aws-stack.yml @@ -406,6 +406,11 @@ Parameters: - "false" Default: "false" + WarmPoolMinSize: + Type: Number + Description: Minimum number of instances in warm pool + Default: 0 + Outputs: VpcId: Value: @@ -534,6 +539,9 @@ Conditions: - !Equals [ !Select [ 0, !Split [ ".", !Ref InstanceType ] ], "r6g" ] - !Equals [ !Select [ 0, !Split [ ".", !Ref InstanceType ] ], "r6gd" ] + UseWarmPool: + !Not [ !Equals [ !Ref WarmPoolMinSize, 0 ] ] + Mappings: ECRManagedPolicy: none : { Policy: '' } @@ -1026,6 +1034,14 @@ Resources: AutoScalingReplacingUpdate: WillReplace: true + AsgWarmPool: + Type: AWS::AutoScaling::WarmPool + Condition: UseWarmPool + Properties: + AutoScalingGroupName: !Ref AgentAutoScaleGroup + MinSize: !Ref WarmPoolMinSize + PoolState: Stopped + AsgProcessSuspenderRole: Type: AWS::IAM::Role Properties: