File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ Terraform documentation is generated automatically using [pre-commit hooks](http
114114| this\_ rds\_ cluster\_ database\_ name | Name for an automatically created database on cluster creation |
115115| this\_ rds\_ cluster\_ endpoint | The cluster endpoint |
116116| this\_ rds\_ cluster\_ id | The ID of the cluster |
117+ | this\_ rds\_ cluster\_ resource\_ id | The Resource ID of the cluster |
117118| this\_ rds\_ cluster\_ instance\_ endpoints | A list of all cluster instance endpoints |
118119| this\_ rds\_ cluster\_ master\_ password | The master password |
119120| this\_ rds\_ cluster\_ master\_ username | The master username |
Original file line number Diff line number Diff line change @@ -79,3 +79,24 @@ module "vpc" {
7979 " 10.0.9.0/25" ,
8080 ]
8181}
82+
83+ # IAM Policy for use with iam_database_authentication = true
84+ resource "aws_iam_policy" "aurora_mysql_policy_iam_auth" {
85+ name = " test-aurora-db-57-policy-iam-auth"
86+ policy = << POLICY
87+ {
88+ "Version": "2012-10-17",
89+ "Statement": [
90+ {
91+ "Effect": "Allow",
92+ "Action": [
93+ "rds-db:connect"
94+ ],
95+ "Resource": [
96+ "arn:aws:rds-db:us-east-1:123456789012:dbuser:${ module . aurora . this_rds_cluster_resource_id } /jane_doe"
97+ ]
98+ }
99+ ]
100+ }
101+ POLICY
102+ }
Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ output "this_rds_cluster_id" {
44 value = " ${ aws_rds_cluster . this . id } "
55}
66
7+ output "this_rds_cluster_resource_id" {
8+ description = " The Resource ID of the cluster"
9+ value = " ${ aws_rds_cluster . this . cluster_resource_id } "
10+ }
11+
712output "this_rds_cluster_endpoint" {
813 description = " The cluster endpoint"
914 value = " ${ aws_rds_cluster . this . endpoint } "
You can’t perform that action at this time.
0 commit comments