tail -f /dev/null

If you haven't had any obstacles lately, you're not challenging. be the worst.

CloudWatch Logs の retention expire を一括で変更しておく

デフォルトだと not expired である. 既に retention period が設定されている log を除き一括で 30d とかをさらっと設定しておく. Logs と併せ自動生成されるので, 後で Lambda 化して boto3 で書きます.

% aws --version
aws-cli/1.18.1 Python/3.7.1 Linux/4.4.0-18362-Microsoft botocore/1.15.41
#!/bin/sh

retention="30"
profile=""
region="ap-northeast-1"

for log in $(aws logs describe-log-groups \
    --query 'logGroups[?!not_null(retentionInDays)] | [].logGroupName' \
    --region ${region} \
    --profile ${profile} \
    --output text)
do
    aws logs put-retention-policy --log-group-name ${log} \
    --retention-in-days ${retention} \
    --profile ${profile}
done

CloudTrail とかの CW Log は never expired で良さそう.