-
Notifications
You must be signed in to change notification settings - Fork 4
/
iam.tf
17 lines (14 loc) · 826 Bytes
/
iam.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# --------------------------------------------------------------------------------------------------
# Enhanced Monitoring
# --------------------------------------------------------------------------------------------------
resource "aws_iam_role" "enhanced_monitoring" {
count = "${var.create_monitoring_role ? 1 : 0}"
name = "${var.monitoring_role_name}"
assume_role_policy = "${file("${path.module}/data/policy/enhancedmonitoring.json")}"
tags = "${merge(map("Name", format("%s", var.monitoring_role_name)), var.tags)}"
}
resource "aws_iam_role_policy_attachment" "enhanced_monitoring" {
count = "${var.create_monitoring_role ? 1 : 0}"
role = "${aws_iam_role.enhanced_monitoring.name}"
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonRDSEnhancedMonitoringRole"
}