File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -61,11 +61,4 @@ aws ec2 describe-instances \
61
61
--filters " Name=tag:Name,Values=Packer Builder" \
62
62
--query " $( printf ' Reservations[].Instances[?LaunchTime<`%s`].[InstanceId]' " $cutoff_date " ) " \
63
63
--output text \
64
- | xargs -n1 -t -I% aws ec2 terminate-instances --instance-ids " %"
65
-
66
- echo " --- Deleting old lambda logs after ${cutoff_date_milli} "
67
- aws logs describe-log-groups \
68
- --log-group-name-prefix " /aws/lambda/buildkite-aws-stack-test-" \
69
- --query " $( printf ' logGroups[?creationTime<`%s`].[logGroupName]' " $cutoff_date_milli " ) " \
70
- --output text \
71
- | xargs -n1 -t -I% aws logs delete-log-group --log-group-name " %"
64
+ | xargs -n1 -t -I% aws ec2 terminate-instances --instance-ids " %"
Original file line number Diff line number Diff line change @@ -1068,6 +1068,14 @@ Resources:
1068
1068
Role : !GetAtt AsgProcessSuspenderRole.Arn
1069
1069
Runtime : ' python3.7'
1070
1070
1071
+ # This mirrors the group that would be created by the lambda, but enforces
1072
+ # a retention period and also ensures it's removed when the stack is removed
1073
+ AzRebalancingSuspenderFunctionLogGroup :
1074
+ Type : AWS::Logs::LogGroup
1075
+ Properties :
1076
+ LogGroupName : !Sub "/aws/lambda/${AzRebalancingSuspenderFunction}"
1077
+ RetentionInDays : 1
1078
+
1071
1079
AzRebalancingSuspender :
1072
1080
Type : AWS::CloudFormation::CustomResource
1073
1081
Version : 1.0
You can’t perform that action at this time.
0 commit comments