Skip to content

Commit e9702f8

Browse files
committed
add comment and update docs regarding manage_master_user_password_rotation
1 parent f804167 commit e9702f8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,12 @@ resource "aws_rds_cluster_activity_stream" "this" {
453453
# Managed Secret Rotation
454454
################################################################################
455455

456+
# There is not currently a way to disable secret rotation on an initial apply.
457+
# In order to use master password secrets management without a rotation, the following workaround can be used:
458+
# `manage_master_user_password_rotation` must be set to true first and applied followed by setting it to false and another apply.
459+
# Note: when setting `manage_master_user_password_rotation` to true, a schedule must also be set using `master_user_password_rotation_schedule_expression` or `master_user_password_rotation_automatically_after_days`.
460+
# To prevent password from being immediately rotated when implementing this workaround, set `master_user_password_rotate_immediately` to false.
461+
# See: https://github.com/hashicorp/terraform-provider-aws/issues/37779
456462
resource "aws_secretsmanager_secret_rotation" "this" {
457463
count = local.create && var.manage_master_user_password && var.manage_master_user_password_rotation ? 1 : 0
458464

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ variable "engine_native_audit_fields_included" {
789789
################################################################################
790790

791791
variable "manage_master_user_password_rotation" {
792-
description = "Whether to manage the master user password rotation. Setting this value to false after previously having been set to true will disable automatic rotation."
792+
description = "Whether to manage the master user password rotation. By default, false on creation, rotation is managed by RDS. There is not currently a way to disable this on initial creation even when set to false. Setting this value to false after previously having been set to true will disable automatic rotation."
793793
type = bool
794794
default = false
795795
}

0 commit comments

Comments
 (0)