mirror of
https://github.com/terraform-aws-modules/terraform-aws-rds-proxy.git
synced 2025-12-17 00:11:11 +00:00
fix: add count to service principal resource.
This commit is contained in:
parent
7217651b59
commit
2697d41e89
1 changed files with 2 additions and 1 deletions
3
main.tf
3
main.tf
|
|
@ -7,6 +7,7 @@ locals {
|
||||||
data "aws_region" "current" {}
|
data "aws_region" "current" {}
|
||||||
data "aws_partition" "current" {}
|
data "aws_partition" "current" {}
|
||||||
data "aws_service_principal" "rds" {
|
data "aws_service_principal" "rds" {
|
||||||
|
count = var.create && var.create_iam_role ? 1 : 0
|
||||||
service_name = "rds"
|
service_name = "rds"
|
||||||
region = data.aws_region.current.region
|
region = data.aws_region.current.region
|
||||||
}
|
}
|
||||||
|
|
@ -114,7 +115,7 @@ data "aws_iam_policy_document" "assume_role" {
|
||||||
|
|
||||||
principals {
|
principals {
|
||||||
type = "Service"
|
type = "Service"
|
||||||
identifiers = [data.aws_service_principal.rds.id]
|
identifiers = [data.aws_service_principal.rds[0].id]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue