Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Enhanced Monitoring IAM role prefix to be configurable variable #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ so don't bother manually changing them.
| enabled\_cloudwatch\_logs\_exports | List of log types to export to CloudWatch Logs. If omitted, no logs will be exported. The following log types are supported: audit, error, general, slowquery, postgresql. | `list(string)` | `[]` | no |
| engine | Aurora database engine type, currently aurora, aurora-mysql or aurora-postgresql | `string` | `"aurora"` | no |
| engine-version | Aurora database engine version. | `string` | `"5.6.10a"` | no |
| enhanced_monitoring_iam_role_prefix | Enhanced Monitoring IAM role prefix | `string` | `"rds-enhanced-mon-"` | no |
| final\_snapshot\_identifier | The name to use when creating a final snapshot on cluster destroy, appends a random 8 digits to name to ensure it's unique too. | `string` | `"final"` | no |
| iam\_database\_authentication\_enabled | Whether to enable IAM database authentication for the RDS Cluster | `string` | `false` | no |
| identifier\_prefix | Prefix for cluster and instance identifier | `string` | `""` | no |
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ data "aws_iam_policy_document" "monitoring-rds-assume-role-policy" {

resource "aws_iam_role" "rds-enhanced-monitoring" {
count = var.enabled && var.monitoring_interval > 0 ? 1 : 0
name_prefix = "rds-enhanced-mon-${var.envname}-"
name_prefix = "${var.enhanced_monitoring_iam_role_prefix}${var.envname}-"
assume_role_policy = data.aws_iam_policy_document.monitoring-rds-assume-role-policy[0].json
}

Expand Down
10 changes: 8 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ variable "storage_encrypted" {
}

variable "kms_key_id" {
type = string
default = ""
type = string
default = ""
description = "Specify the KMS Key to use for encryption"
}

Expand Down Expand Up @@ -265,3 +265,9 @@ variable "enabled_cloudwatch_logs_exports" {
default = []
description = "List of log types to export to CloudWatch Logs. If omitted, no logs will be exported. The following log types are supported: audit, error, general, slowquery, postgresql."
}

variable "enhanced_monitoring_iam_role_prefix" {
type = string
default = "rds-enhanced-mon-"
description = "RDS Enhanced Monitoring IAM role name prefix"
}