diff --git a/README.md b/README.md index afcd7548..8f9b52b8 100644 --- a/README.md +++ b/README.md @@ -338,6 +338,7 @@ No resources. | [db\_instance\_engine\_version\_actual](#output\_db\_instance\_engine\_version\_actual) | The running version of the database | | [db\_instance\_hosted\_zone\_id](#output\_db\_instance\_hosted\_zone\_id) | The canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record) | | [db\_instance\_identifier](#output\_db\_instance\_identifier) | The RDS instance identifier | +| [db\_instance\_master\_user\_secret\_arn](#output\_db\_instance\_master\_user\_secret\_arn) | The ARN of the master user secret (Only available when manage\_master\_user\_password is set to true) | | [db\_instance\_name](#output\_db\_instance\_name) | The database name | | [db\_instance\_port](#output\_db\_instance\_port) | The database port | | [db\_instance\_resource\_id](#output\_db\_instance\_resource\_id) | The RDS Resource ID of this instance | diff --git a/examples/complete-mssql/README.md b/examples/complete-mssql/README.md index 1cefe6b5..53a12f31 100644 --- a/examples/complete-mssql/README.md +++ b/examples/complete-mssql/README.md @@ -68,6 +68,7 @@ No inputs. | [db\_instance\_engine\_version\_actual](#output\_db\_instance\_engine\_version\_actual) | The running version of the database | | [db\_instance\_hosted\_zone\_id](#output\_db\_instance\_hosted\_zone\_id) | The canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record) | | [db\_instance\_identifier](#output\_db\_instance\_identifier) | The RDS instance identifier | +| [db\_instance\_master\_user\_secret\_arn](#output\_db\_instance\_master\_user\_secret\_arn) | The ARN of the master user secret (Only available when manage\_master\_user\_password is set to true) | | [db\_instance\_name](#output\_db\_instance\_name) | The database name | | [db\_instance\_port](#output\_db\_instance\_port) | The database port | | [db\_instance\_resource\_id](#output\_db\_instance\_resource\_id) | The RDS Resource ID of this instance | diff --git a/examples/complete-mssql/outputs.tf b/examples/complete-mssql/outputs.tf index f1bfb27f..d1ac11f6 100644 --- a/examples/complete-mssql/outputs.tf +++ b/examples/complete-mssql/outputs.tf @@ -103,3 +103,8 @@ output "db_instance_cloudwatch_log_groups" { description = "Map of CloudWatch log groups created and their attributes" value = module.db.db_instance_cloudwatch_log_groups } + +output "db_instance_master_user_secret_arn" { + description = "The ARN of the master user secret (Only available when manage_master_user_password is set to true)" + value = module.db.db_instance_master_user_secret_arn +} diff --git a/examples/complete-mysql/README.md b/examples/complete-mysql/README.md index 18119c14..d5fc0b6e 100644 --- a/examples/complete-mysql/README.md +++ b/examples/complete-mysql/README.md @@ -61,6 +61,7 @@ No inputs. | [db\_default\_instance\_engine\_version](#output\_db\_default\_instance\_engine\_version) | The running version of the database | | [db\_default\_instance\_hosted\_zone\_id](#output\_db\_default\_instance\_hosted\_zone\_id) | The canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record) | | [db\_default\_instance\_identifier](#output\_db\_default\_instance\_identifier) | The RDS instance identifier | +| [db\_default\_instance\_master\_user\_secret\_arn](#output\_db\_default\_instance\_master\_user\_secret\_arn) | The ARN of the master user secret (Only available when manage\_master\_user\_password is set to true) | | [db\_default\_instance\_name](#output\_db\_default\_instance\_name) | The database name | | [db\_default\_instance\_port](#output\_db\_default\_instance\_port) | The database port | | [db\_default\_instance\_resource\_id](#output\_db\_default\_instance\_resource\_id) | The RDS Resource ID of this instance | @@ -80,6 +81,7 @@ No inputs. | [db\_instance\_engine\_version\_actual](#output\_db\_instance\_engine\_version\_actual) | The running version of the database | | [db\_instance\_hosted\_zone\_id](#output\_db\_instance\_hosted\_zone\_id) | The canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record) | | [db\_instance\_identifier](#output\_db\_instance\_identifier) | The RDS instance identifier | +| [db\_instance\_master\_user\_secret\_arn](#output\_db\_instance\_master\_user\_secret\_arn) | The ARN of the master user secret (Only available when manage\_master\_user\_password is set to true) | | [db\_instance\_name](#output\_db\_instance\_name) | The database name | | [db\_instance\_port](#output\_db\_instance\_port) | The database port | | [db\_instance\_resource\_id](#output\_db\_instance\_resource\_id) | The RDS Resource ID of this instance | diff --git a/examples/complete-mysql/outputs.tf b/examples/complete-mysql/outputs.tf index 29b44a95..84d181ab 100644 --- a/examples/complete-mysql/outputs.tf +++ b/examples/complete-mysql/outputs.tf @@ -94,6 +94,11 @@ output "db_instance_cloudwatch_log_groups" { value = module.db.db_instance_cloudwatch_log_groups } +output "db_instance_master_user_secret_arn" { + description = "The ARN of the master user secret (Only available when manage_master_user_password is set to true)" + value = module.db.db_instance_master_user_secret_arn +} + # Default output "db_default_instance_address" { description = "The address of the RDS instance" @@ -185,3 +190,8 @@ output "db_default_cloudwatch_log_groups" { description = "Map of CloudWatch log groups created and their attributes" value = module.db_default.db_instance_cloudwatch_log_groups } + +output "db_default_instance_master_user_secret_arn" { + description = "The ARN of the master user secret (Only available when manage_master_user_password is set to true)" + value = module.db_default.db_instance_master_user_secret_arn +} diff --git a/examples/complete-oracle/README.md b/examples/complete-oracle/README.md index 558d62ed..8e0af7b2 100644 --- a/examples/complete-oracle/README.md +++ b/examples/complete-oracle/README.md @@ -63,6 +63,7 @@ No inputs. | [db\_instance\_engine\_version\_actual](#output\_db\_instance\_engine\_version\_actual) | The running version of the database | | [db\_instance\_hosted\_zone\_id](#output\_db\_instance\_hosted\_zone\_id) | The canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record) | | [db\_instance\_identifier](#output\_db\_instance\_identifier) | The RDS instance identifier | +| [db\_instance\_master\_user\_secret\_arn](#output\_db\_instance\_master\_user\_secret\_arn) | The ARN of the master user secret (Only available when manage\_master\_user\_password is set to true) | | [db\_instance\_name](#output\_db\_instance\_name) | The database name | | [db\_instance\_port](#output\_db\_instance\_port) | The database port | | [db\_instance\_resource\_id](#output\_db\_instance\_resource\_id) | The RDS Resource ID of this instance | diff --git a/examples/complete-oracle/outputs.tf b/examples/complete-oracle/outputs.tf index dd8b5128..4510f65c 100644 --- a/examples/complete-oracle/outputs.tf +++ b/examples/complete-oracle/outputs.tf @@ -88,3 +88,8 @@ output "db_instance_cloudwatch_log_groups" { description = "Map of CloudWatch log groups created and their attributes" value = module.db.db_instance_cloudwatch_log_groups } + +output "db_instance_master_user_secret_arn" { + description = "The ARN of the master user secret (Only available when manage_master_user_password is set to true)" + value = module.db.db_instance_master_user_secret_arn +} diff --git a/examples/complete-postgres/README.md b/examples/complete-postgres/README.md index c2794417..a20348fc 100644 --- a/examples/complete-postgres/README.md +++ b/examples/complete-postgres/README.md @@ -69,6 +69,7 @@ No inputs. | [db\_default\_instance\_resource\_id](#output\_db\_default\_instance\_resource\_id) | The RDS Resource ID of this instance | | [db\_default\_instance\_status](#output\_db\_default\_instance\_status) | The RDS instance status | | [db\_default\_instance\_username](#output\_db\_default\_instance\_username) | The master username for the database | +| [db\_default\_master\_user\_secret\_arn](#output\_db\_default\_master\_user\_secret\_arn) | The ARN of the master user secret (Only available when manage\_master\_user\_password is set to true) | | [db\_default\_parameter\_group\_arn](#output\_db\_default\_parameter\_group\_arn) | The ARN of the db parameter group | | [db\_default\_parameter\_group\_id](#output\_db\_default\_parameter\_group\_id) | The db parameter group id | | [db\_default\_subnet\_group\_arn](#output\_db\_default\_subnet\_group\_arn) | The ARN of the db subnet group | @@ -83,6 +84,7 @@ No inputs. | [db\_instance\_engine\_version\_actual](#output\_db\_instance\_engine\_version\_actual) | The running version of the database | | [db\_instance\_hosted\_zone\_id](#output\_db\_instance\_hosted\_zone\_id) | The canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record) | | [db\_instance\_identifier](#output\_db\_instance\_identifier) | The RDS instance identifier | +| [db\_instance\_master\_user\_secret\_arn](#output\_db\_instance\_master\_user\_secret\_arn) | The ARN of the master user secret (Only available when manage\_master\_user\_password is set to true) | | [db\_instance\_name](#output\_db\_instance\_name) | The database name | | [db\_instance\_port](#output\_db\_instance\_port) | The database port | | [db\_instance\_resource\_id](#output\_db\_instance\_resource\_id) | The RDS Resource ID of this instance | diff --git a/examples/complete-postgres/outputs.tf b/examples/complete-postgres/outputs.tf index 49ee6e4b..b43f8aae 100644 --- a/examples/complete-postgres/outputs.tf +++ b/examples/complete-postgres/outputs.tf @@ -94,6 +94,11 @@ output "db_instance_cloudwatch_log_groups" { value = module.db.db_instance_cloudwatch_log_groups } +output "db_instance_master_user_secret_arn" { + description = "The ARN of the master user secret (Only available when manage_master_user_password is set to true)" + value = module.db.db_instance_master_user_secret_arn +} + # Default output "db_default_instance_address" { description = "The address of the RDS instance" @@ -185,3 +190,8 @@ output "db_default_instance_cloudwatch_log_groups" { description = "Map of CloudWatch log groups created and their attributes" value = module.db_default.db_instance_cloudwatch_log_groups } + +output "db_default_master_user_secret_arn" { + description = "The ARN of the master user secret (Only available when manage_master_user_password is set to true)" + value = module.db_default.db_instance_master_user_secret_arn +} diff --git a/examples/enhanced-monitoring/README.md b/examples/enhanced-monitoring/README.md index 811356d6..c6cc9b6b 100644 --- a/examples/enhanced-monitoring/README.md +++ b/examples/enhanced-monitoring/README.md @@ -64,6 +64,7 @@ No inputs. | [db\_instance\_engine\_version\_actual](#output\_db\_instance\_engine\_version\_actual) | The running version of the database | | [db\_instance\_hosted\_zone\_id](#output\_db\_instance\_hosted\_zone\_id) | The canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record) | | [db\_instance\_identifier](#output\_db\_instance\_identifier) | The RDS instance identifier | +| [db\_instance\_master\_user\_secret\_arn](#output\_db\_instance\_master\_user\_secret\_arn) | The ARN of the master user secret (Only available when manage\_master\_user\_password is set to true) | | [db\_instance\_name](#output\_db\_instance\_name) | The database name | | [db\_instance\_port](#output\_db\_instance\_port) | The database port | | [db\_instance\_resource\_id](#output\_db\_instance\_resource\_id) | The RDS Resource ID of this instance | diff --git a/examples/enhanced-monitoring/outputs.tf b/examples/enhanced-monitoring/outputs.tf index dd8b5128..4510f65c 100644 --- a/examples/enhanced-monitoring/outputs.tf +++ b/examples/enhanced-monitoring/outputs.tf @@ -88,3 +88,8 @@ output "db_instance_cloudwatch_log_groups" { description = "Map of CloudWatch log groups created and their attributes" value = module.db.db_instance_cloudwatch_log_groups } + +output "db_instance_master_user_secret_arn" { + description = "The ARN of the master user secret (Only available when manage_master_user_password is set to true)" + value = module.db.db_instance_master_user_secret_arn +} diff --git a/examples/s3-import-mysql/README.md b/examples/s3-import-mysql/README.md index 3cb9169a..36d626ab 100644 --- a/examples/s3-import-mysql/README.md +++ b/examples/s3-import-mysql/README.md @@ -93,6 +93,7 @@ No inputs. | [db\_instance\_engine\_version\_actual](#output\_db\_instance\_engine\_version\_actual) | The running version of the database | | [db\_instance\_hosted\_zone\_id](#output\_db\_instance\_hosted\_zone\_id) | The canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record) | | [db\_instance\_identifier](#output\_db\_instance\_identifier) | The RDS instance identifier | +| [db\_instance\_master\_user\_secret\_arn](#output\_db\_instance\_master\_user\_secret\_arn) | The ARN of the master user secret (Only available when manage\_master\_user\_password is set to true) | | [db\_instance\_name](#output\_db\_instance\_name) | The database name | | [db\_instance\_port](#output\_db\_instance\_port) | The database port | | [db\_instance\_resource\_id](#output\_db\_instance\_resource\_id) | The RDS Resource ID of this instance | diff --git a/examples/s3-import-mysql/outputs.tf b/examples/s3-import-mysql/outputs.tf index dd8b5128..4510f65c 100644 --- a/examples/s3-import-mysql/outputs.tf +++ b/examples/s3-import-mysql/outputs.tf @@ -88,3 +88,8 @@ output "db_instance_cloudwatch_log_groups" { description = "Map of CloudWatch log groups created and their attributes" value = module.db.db_instance_cloudwatch_log_groups } + +output "db_instance_master_user_secret_arn" { + description = "The ARN of the master user secret (Only available when manage_master_user_password is set to true)" + value = module.db.db_instance_master_user_secret_arn +} diff --git a/modules/db_instance/README.md b/modules/db_instance/README.md index 344fc51e..1549bd3f 100644 --- a/modules/db_instance/README.md +++ b/modules/db_instance/README.md @@ -122,6 +122,7 @@ No modules. | [db\_instance\_engine\_version\_actual](#output\_db\_instance\_engine\_version\_actual) | The running version of the database | | [db\_instance\_hosted\_zone\_id](#output\_db\_instance\_hosted\_zone\_id) | The canonical hosted zone ID of the DB instance (to be used in a Route 53 Alias record) | | [db\_instance\_identifier](#output\_db\_instance\_identifier) | The RDS instance identifier | +| [db\_instance\_master\_user\_secret\_arn](#output\_db\_instance\_master\_user\_secret\_arn) | The ARN of the master user secret (Only available when manage\_master\_user\_password is set to true) | | [db\_instance\_name](#output\_db\_instance\_name) | The database name | | [db\_instance\_port](#output\_db\_instance\_port) | The database port | | [db\_instance\_resource\_id](#output\_db\_instance\_resource\_id) | The RDS Resource ID of this instance | diff --git a/modules/db_instance/outputs.tf b/modules/db_instance/outputs.tf index 29b45782..de06eb57 100644 --- a/modules/db_instance/outputs.tf +++ b/modules/db_instance/outputs.tf @@ -94,6 +94,11 @@ output "db_instance_domain_iam_role_name" { value = try(aws_db_instance.this[0].domain_iam_role_name, null) } +output "db_instance_master_user_secret_arn" { + description = "The ARN of the master user secret (Only available when manage_master_user_password is set to true)" + value = try(aws_db_instance.this[0].master_user_secret[0].secret_arn, null) +} + ################################################################################ # CloudWatch Log Group ################################################################################ diff --git a/outputs.tf b/outputs.tf index 630a8029..f9c771ec 100644 --- a/outputs.tf +++ b/outputs.tf @@ -94,6 +94,11 @@ output "db_instance_ca_cert_identifier" { value = module.db_instance.db_instance_ca_cert_identifier } +output "db_instance_master_user_secret_arn" { + description = "The ARN of the master user secret (Only available when manage_master_user_password is set to true)" + value = module.db_instance.db_instance_master_user_secret_arn +} + output "db_subnet_group_id" { description = "The db subnet group name" value = module.db_subnet_group.db_subnet_group_id