Skip to content

Commit da91dd9

Browse files
authored
Add MaxInstanceLifetime
1 parent a503072 commit da91dd9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

templates/aws-stack.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,12 @@ Parameters:
407407
- "false"
408408
Default: "false"
409409

410+
MaxInstanceLifetime:
411+
Type: Number
412+
Description: The maximum amount of time, in seconds, that an instance can be in service. The default is null. If specified, the value must be either 0 or a number equal to or greater than 86,400 seconds (1 day).
413+
Default: 0
414+
MinValue: 0
415+
410416
Outputs:
411417
VpcId:
412418
Value:
@@ -535,6 +541,10 @@ Conditions:
535541
- !Equals [ !Select [ 0, !Split [ ".", !Ref InstanceType ] ], "r6g" ]
536542
- !Equals [ !Select [ 0, !Split [ ".", !Ref InstanceType ] ], "r6gd" ]
537543

544+
UseMaxInstanceLifetime:
545+
!Not [ !Equals [ !Ref MaxInstanceLifetime, 0 ] ]
546+
547+
538548
Mappings:
539549
ECRManagedPolicy:
540550
none : { Policy: '' }
@@ -1013,6 +1023,7 @@ Resources:
10131023
TerminationPolicies:
10141024
- OldestLaunchConfiguration
10151025
- ClosestToNextInstanceHour
1026+
MaxInstanceLifetime: !If [UseMaxInstanceLifetime, !Ref MaxInstanceLifetime, !Ref "AWS::NoValue"]
10161027
CreationPolicy:
10171028
ResourceSignal:
10181029
Timeout: !If [ UseDefaultInstanceCreationTimeout, !If [ UseWindowsAgents, PT10M, PT5M ], !Ref InstanceCreationTimeout ]

0 commit comments

Comments
 (0)