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

Add support for RDS DB Instance role associations #131

Open
adamantike opened this issue Dec 23, 2021 · 2 comments
Open

Add support for RDS DB Instance role associations #131

adamantike opened this issue Dec 23, 2021 · 2 comments

Comments

@adamantike
Copy link

adamantike commented Dec 23, 2021

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.

@korenyoni
Copy link
Member

Hi @adamantike, thanks for suggesting this.

I am working on this feature right now in #132.

@adamantike
Copy link
Author

That's great, thank you for tackling it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants