Closed paulrob-100 closed 2 years ago
This pull request is now in conflict. Could you fix it @paulrob-100? 🙏
@paulrob-100 could you remove the changes unrelated to the multiple principals ?
I think we can do something as simple as this
locals {
enabled = module.this.enabled
ram_resource_share_enabled = local.enabled && var.ram_resource_share_enabled
ram_principals = toset(concat(var.ram_principals, data.aws_organizations_organization.default.*.arn))
}
resource "aws_ram_principal_association" "default" {
for_each = local.ram_resource_share_enabled ? toset(local.ram_principals) : toset([])
principal = each.value
resource_share_arn = try(aws_ram_resource_share.default[0].id, "")
}
Also @paulrob-100 so you're unblocked, we're also outputting the ram_resource_share_id so principals can be attached to the RAM share from outside the module.
what
why
references