Add CloudTrail delivery to CloudWatch Logs

This commit is contained in:
2026-11-15 01:42:07 +09:00
parent ff7221dd78
commit 7eded181e7
7 changed files with 170 additions and 1 deletions
@@ -63,6 +63,25 @@ run "apply_group1_osaka" {
error_message = "The Osaka test CloudTrail trail must be single-Region."
}
assert {
condition = (
length(aws_cloudwatch_log_group.cloudtrail_protected) == 0 &&
length(aws_cloudwatch_log_group.cloudtrail_unprotected) == 1 &&
aws_cloudwatch_log_group.cloudtrail_unprotected[0].retention_in_days == 30
)
error_message = "The Osaka test must create one unprotected CloudTrail log group with 30-day retention."
}
assert {
condition = (
length(aws_iam_role.cloudtrail_cloudwatch_protected) == 0 &&
length(aws_iam_role.cloudtrail_cloudwatch_unprotected) == 1 &&
length(aws_iam_role_policy.cloudtrail_cloudwatch_protected) == 0 &&
length(aws_iam_role_policy.cloudtrail_cloudwatch_unprotected) == 1
)
error_message = "The Osaka test must use unprotected CloudTrail delivery IAM resources."
}
assert {
condition = aws_kms_key.vault_unprotected[0].deletion_window_in_days == 7
error_message = "The Osaka test KMS key must use the minimum seven-day deletion window."