File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ No modules.
9191| [ aws_iam_policy_document.this] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document ) | data source |
9292| [ aws_partition.current] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition ) | data source |
9393| [ aws_region.current] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region ) | data source |
94+ | [ aws_service_principal.rds] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/service_principal ) | data source |
9495
9596## Inputs
9697
Original file line number Diff line number Diff line change @@ -6,7 +6,12 @@ locals {
66
77data "aws_region" "current" {}
88data "aws_partition" "current" {}
9+ data "aws_service_principal" "rds" {
10+ count = var. create && var. create_iam_role ? 1 : 0
911
12+ service_name = " rds"
13+ region = data. aws_region . current . name
14+ }
1015# ###############################################################################
1116# RDS Proxy
1217# ###############################################################################
@@ -111,7 +116,7 @@ data "aws_iam_policy_document" "assume_role" {
111116
112117 principals {
113118 type = " Service"
114- identifiers = [" rds. ${ data . aws_partition . current . dns_suffix } " ]
119+ identifiers = [data . aws_service_principal . rds [ 0 ] . name ]
115120 }
116121 }
117122}
You can’t perform that action at this time.
0 commit comments