一括有効化
for REGION in `aws ec2 describe-regions | jq -r ".Regions[] | .RegionName"`; do
aws --region ${REGION} guardduty create-detector --enable
done
一括停止
for REGION in `aws ec2 describe-regions | jq -r ".Regions[] | .RegionName"`; do
DETECTOR=`aws --region ${REGION} guardduty list-detectors | jq -r ".DetectorIds | .[]"`
aws --region ${REGION} guardduty update-detector --detector-id ${DETECTOR} --no-enable
done
一括削除
for REGION in `aws ec2 describe-regions | jq -r ".Regions[] | .RegionName"`; do
DETECTOR=`aws --region ${REGION} guardduty list-detectors | jq -r ".DetectorIds | .[]"`
aws --region ${REGION} guardduty delete-detector --detector-id ${DETECTOR}
done