output "alert_topic_arn" { description = "Where the alarms go." value = local.topic_arn } output "read_trail" { description = "The trail that records object reads from the sensitive buckets, or empty when none were named." value = local.reads_on ? aws_cloudtrail.reads[0].arn : "" } output "verify" { description = "The drills, one per alarm." value = <<-EOT Sharing: add and remove a statement on a test bucket's policy. ${var.name}-shared-outside fires within about ten minutes. Bulk read, in a test bucket you added to sensitive_bucket_arns, with bulk_read_threshold set low for the drill: aws s3 cp s3:/// /tmp/drill --recursive ${var.name}-bulk-read fires within about fifteen minutes, and the rule names the principal: aws cloudwatch get-insight-rule-report --rule-name ${var.name}-bulk-readers --start-time <15 min ago> --end-time --period 300 --max-contributor-count 5 aws cloudwatch describe-alarms --alarm-name-prefix ${var.name} --query 'MetricAlarms[].[AlarmName,StateValue]' Put bulk_read_threshold back afterwards. EOT }