Skip to content

Commit 2697d41

Browse files
fix: add count to service principal resource.
1 parent 7217651 commit 2697d41

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ locals {
77
data "aws_region" "current" {}
88
data "aws_partition" "current" {}
99
data "aws_service_principal" "rds" {
10+
count = var.create && var.create_iam_role ? 1 : 0
1011
service_name = "rds"
1112
region = data.aws_region.current.region
1213
}
@@ -114,7 +115,7 @@ data "aws_iam_policy_document" "assume_role" {
114115

115116
principals {
116117
type = "Service"
117-
identifiers = [data.aws_service_principal.rds.id]
118+
identifiers = [data.aws_service_principal.rds[0].id]
118119
}
119120
}
120121
}

0 commit comments

Comments
 (0)