mirror of
https://github.com/terraform-aws-modules/terraform-aws-rds-proxy.git
synced 2025-12-16 16:01:11 +00:00
fix: Correct service principal to rds.amazonaws.com (incl China) (#32)
Co-authored-by: Bryant Biggs <bryantbiggs@gmail.com> Co-authored-by: Anton Babenko <anton@antonbabenko.com>
This commit is contained in:
parent
99df7e3913
commit
bbbf50ce87
2 changed files with 7 additions and 1 deletions
|
|
@ -91,6 +91,7 @@ No modules.
|
|||
| [aws_iam_policy_document.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
|
||||
| [aws_partition.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition) | data source |
|
||||
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |
|
||||
| [aws_service_principal.rds](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/service_principal) | data source |
|
||||
|
||||
## Inputs
|
||||
|
||||
|
|
|
|||
7
main.tf
7
main.tf
|
|
@ -6,7 +6,12 @@ locals {
|
|||
|
||||
data "aws_region" "current" {}
|
||||
data "aws_partition" "current" {}
|
||||
data "aws_service_principal" "rds" {
|
||||
count = var.create && var.create_iam_role ? 1 : 0
|
||||
|
||||
service_name = "rds"
|
||||
region = data.aws_region.current.name
|
||||
}
|
||||
################################################################################
|
||||
# RDS Proxy
|
||||
################################################################################
|
||||
|
|
@ -111,7 +116,7 @@ data "aws_iam_policy_document" "assume_role" {
|
|||
|
||||
principals {
|
||||
type = "Service"
|
||||
identifiers = ["rds.${data.aws_partition.current.dns_suffix}"]
|
||||
identifiers = [data.aws_service_principal.rds[0].name]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue