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.
91
91
| [ aws_iam_policy_document.this] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document ) | data source |
92
92
| [ aws_partition.current] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition ) | data source |
93
93
| [ 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 |
94
95
95
96
## Inputs
96
97
Original file line number Diff line number Diff line change @@ -6,7 +6,12 @@ locals {
6
6
7
7
data "aws_region" "current" {}
8
8
data "aws_partition" "current" {}
9
+ data "aws_service_principal" "rds" {
10
+ count = var. create && var. create_iam_role ? 1 : 0
9
11
12
+ service_name = " rds"
13
+ region = data. aws_region . current . name
14
+ }
10
15
# ###############################################################################
11
16
# RDS Proxy
12
17
# ###############################################################################
@@ -111,7 +116,7 @@ data "aws_iam_policy_document" "assume_role" {
111
116
112
117
principals {
113
118
type = " Service"
114
- identifiers = [" rds. ${ data . aws_partition . current . dns_suffix } " ]
119
+ identifiers = [data . aws_service_principal . rds [ 0 ] . name ]
115
120
}
116
121
}
117
122
}
You can’t perform that action at this time.
0 commit comments