Skip to content

Commit 51e8411

Browse files
committed
Revert changes
1 parent e678238 commit 51e8411

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

.buildkite/steps/cleanup.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ fi
3232

3333
if [[ $OSTYPE =~ ^darwin ]] ; then
3434
cutoff_date=$(gdate --date='-1 days' +%Y-%m-%d)
35+
cutoff_date_milli=$(gdate --date='-1 days' +%s%3N)
3536
else
3637
cutoff_date=$(date --date='-1 days' +%Y-%m-%d)
38+
cutoff_date_milli=$(date --date='-1 days' +%s%3N)
3739
fi
3840

3941
echo "--- Cleaning up resources older than ${cutoff_date}"
@@ -59,4 +61,11 @@ aws ec2 describe-instances \
5961
--filters "Name=tag:Name,Values=Packer Builder" \
6062
--query "$(printf 'Reservations[].Instances[?LaunchTime<`%s`].[InstanceId]' "$cutoff_date")" \
6163
--output text \
62-
| xargs -n1 -t -I% aws ec2 terminate-instances --instance-ids "%"
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 "%"

templates/aws-stack.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,14 +1068,6 @@ Resources:
10681068
Role: !GetAtt AsgProcessSuspenderRole.Arn
10691069
Runtime: 'python3.7'
10701070

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-
10791071
AzRebalancingSuspender:
10801072
Type: AWS::CloudFormation::CustomResource
10811073
Version: 1.0

0 commit comments

Comments
 (0)