-
-
Notifications
You must be signed in to change notification settings - Fork 178
Open
Description
Describe the Feature
Allow the module to internally configure aws_db_instance_role_association
resources, to centralize more of the RDS configuration in this single module.
Describe Ideal Solution
Example code snippet, using for_each
to have the TF state being indexed by the feature name.
variable "role_associations" {
type = map(string)
description = "Map of role associations for the DB Instance. Key is the name of the feature for association, and value is the IAM Role ARN to associate. (e.g. { s3Import: \"arn:aws:iam::1234567890:role/rds-s3-import-role\" })"
default = {}
}
resource "aws_db_instance_role_association" "default" {
for_each = module.this.enabled ? var.role_associations : {}
db_instance_identifier = join("", aws_db_instance.default.*.id)
feature_name = each.key
role_arn = each.value
}
Alternatives Considered
Current alternative is to add these role associations using a separate resource
block.
Metadata
Metadata
Assignees
Labels
No labels