You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.keyrole_arn=each.value
}
Alternatives Considered
Current alternative is to add these role associations using a separate resource block.
The text was updated successfully, but these errors were encountered:
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.Alternatives Considered
Current alternative is to add these role associations using a separate
resource
block.The text was updated successfully, but these errors were encountered: