AWS Secrets Manager enables you to audit and monitor secrets via integration with AWS logging, monitoring, and notification services. For example, after enabling AWS CloudTrail for an AWS region, you can audit when a secret is stored or rotated by viewing AWS CloudTrail logs. Similarly, you can configure Amazon CloudWatch to receive email messages using the Amazon Simple Notification Service when secrets remain unused for a period, or you can configure Amazon CloudWatch Events to receive push notifications when Secrets Manager rotates your secrets:
resource "aws_secretsmanager_secret" "rotation-example" {
name = "rotation-example"
rotation_lambda_arn = "${aws_lambda_function.example.arn}"
rotation_rules {
automatically_after_days = 7
}
}
Here is a key value example:
# The map here can come from other supported configurations...