-
Notifications
You must be signed in to change notification settings - Fork 9.5k
r/aws_docdb_cluster: add support for manage_master_user_password
argument
#42563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
r/aws_docdb_cluster: add support for manage_master_user_password
argument
#42563
Conversation
Community GuidelinesThis comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀 Voting for Prioritization
Pull Request Authors
|
✅ Thank you for correcting the previously detected issues! The maintainers appreciate your efforts to make the review process as smooth as possible. |
mange_master_user_password
argument
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=TestAccDocDBCluster_' PKG=docdb ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.8 test ./internal/service/docdb/... -v -count 1 -parallel 3 -run=TestAccDocDBCluster_ -timeout 720m -vet=off
2025/05/11 17:16:37 Initializing Terraform AWS Provider...
=== RUN TestAccDocDBCluster_basic
=== PAUSE TestAccDocDBCluster_basic
=== RUN TestAccDocDBCluster_disappears
=== PAUSE TestAccDocDBCluster_disappears
=== RUN TestAccDocDBCluster_identifierGenerated
=== PAUSE TestAccDocDBCluster_identifierGenerated
=== RUN TestAccDocDBCluster_identifierPrefix
=== PAUSE TestAccDocDBCluster_identifierPrefix
=== RUN TestAccDocDBCluster_tags
=== PAUSE TestAccDocDBCluster_tags
=== RUN TestAccDocDBCluster_takeFinalSnapshot
=== PAUSE TestAccDocDBCluster_takeFinalSnapshot
=== RUN TestAccDocDBCluster_missingUserNameCausesError
=== PAUSE TestAccDocDBCluster_missingUserNameCausesError
=== RUN TestAccDocDBCluster_updateCloudWatchLogsExports
=== PAUSE TestAccDocDBCluster_updateCloudWatchLogsExports
=== RUN TestAccDocDBCluster_kmsKey
=== PAUSE TestAccDocDBCluster_kmsKey
=== RUN TestAccDocDBCluster_encrypted
=== PAUSE TestAccDocDBCluster_encrypted
=== RUN TestAccDocDBCluster_backupsUpdate
=== PAUSE TestAccDocDBCluster_backupsUpdate
=== RUN TestAccDocDBCluster_pointInTimeRestore
=== PAUSE TestAccDocDBCluster_pointInTimeRestore
=== RUN TestAccDocDBCluster_port
=== PAUSE TestAccDocDBCluster_port
=== RUN TestAccDocDBCluster_deleteProtection
=== PAUSE TestAccDocDBCluster_deleteProtection
=== RUN TestAccDocDBCluster_GlobalClusterIdentifier
=== PAUSE TestAccDocDBCluster_GlobalClusterIdentifier
=== RUN TestAccDocDBCluster_GlobalClusterIdentifier_Add
=== PAUSE TestAccDocDBCluster_GlobalClusterIdentifier_Add
=== RUN TestAccDocDBCluster_GlobalClusterIdentifier_Remove
=== PAUSE TestAccDocDBCluster_GlobalClusterIdentifier_Remove
=== RUN TestAccDocDBCluster_GlobalClusterIdentifier_Update
=== PAUSE TestAccDocDBCluster_GlobalClusterIdentifier_Update
=== RUN TestAccDocDBCluster_GlobalClusterIdentifier_PrimarySecondaryClusters
=== PAUSE TestAccDocDBCluster_GlobalClusterIdentifier_PrimarySecondaryClusters
=== RUN TestAccDocDBCluster_updateEngineMajorVersion
cluster_test.go:805: Amazon DocumentDB has identified an issue and is temporarily disallowing major version upgrades (MVU) in all regions.
--- SKIP: TestAccDocDBCluster_updateEngineMajorVersion (0.00s)
=== RUN TestAccDocDBCluster_storageType
=== PAUSE TestAccDocDBCluster_storageType
=== RUN TestAccDocDBCluster_passwordWriteOnly
=== PAUSE TestAccDocDBCluster_passwordWriteOnly
=== RUN TestAccDocDBCluster_manageMasterUserPassword
=== PAUSE TestAccDocDBCluster_manageMasterUserPassword
=== CONT TestAccDocDBCluster_basic
=== CONT TestAccDocDBCluster_pointInTimeRestore
=== CONT TestAccDocDBCluster_missingUserNameCausesError
--- PASS: TestAccDocDBCluster_missingUserNameCausesError (6.29s)
=== CONT TestAccDocDBCluster_backupsUpdate
--- PASS: TestAccDocDBCluster_basic (119.60s)
=== CONT TestAccDocDBCluster_encrypted
--- PASS: TestAccDocDBCluster_backupsUpdate (148.17s)
=== CONT TestAccDocDBCluster_updateCloudWatchLogsExports
--- PASS: TestAccDocDBCluster_encrypted (107.58s)
=== CONT TestAccDocDBCluster_identifierPrefix
--- PASS: TestAccDocDBCluster_updateCloudWatchLogsExports (148.79s)
=== CONT TestAccDocDBCluster_takeFinalSnapshot
--- PASS: TestAccDocDBCluster_identifierPrefix (96.41s)
=== CONT TestAccDocDBCluster_tags
--- PASS: TestAccDocDBCluster_pointInTimeRestore (336.28s)
=== CONT TestAccDocDBCluster_GlobalClusterIdentifier_Update
--- PASS: TestAccDocDBCluster_tags (123.66s)
=== CONT TestAccDocDBCluster_manageMasterUserPassword
--- PASS: TestAccDocDBCluster_GlobalClusterIdentifier_Update (125.73s)
=== CONT TestAccDocDBCluster_passwordWriteOnly
cluster_test.go:936: Terraform CLI version 1.10.4 is below minimum version 1.11.0: skipping test
--- SKIP: TestAccDocDBCluster_passwordWriteOnly (0.08s)
=== CONT TestAccDocDBCluster_storageType
--- PASS: TestAccDocDBCluster_manageMasterUserPassword (161.17s)
=== CONT TestAccDocDBCluster_GlobalClusterIdentifier_PrimarySecondaryClusters
--- PASS: TestAccDocDBCluster_takeFinalSnapshot (270.73s)
=== CONT TestAccDocDBCluster_identifierGenerated
--- PASS: TestAccDocDBCluster_storageType (199.12s)
=== CONT TestAccDocDBCluster_disappears
--- PASS: TestAccDocDBCluster_identifierGenerated (116.43s)
=== CONT TestAccDocDBCluster_GlobalClusterIdentifier
--- PASS: TestAccDocDBCluster_disappears (106.00s)
=== CONT TestAccDocDBCluster_GlobalClusterIdentifier_Remove
--- PASS: TestAccDocDBCluster_GlobalClusterIdentifier (108.78s)
=== CONT TestAccDocDBCluster_GlobalClusterIdentifier_Add
--- PASS: TestAccDocDBCluster_GlobalClusterIdentifier_Add (123.78s)
=== CONT TestAccDocDBCluster_kmsKey
--- PASS: TestAccDocDBCluster_kmsKey (126.24s)
=== CONT TestAccDocDBCluster_deleteProtection
=== NAME TestAccDocDBCluster_GlobalClusterIdentifier_Remove
cluster_test.go:691: Step 3/3 error: Error running apply: exit status 1
Error: deleting DocumentDB Global Cluster (tf-acc-test-3973061279176917188): operation error DocDB: DeleteGlobalCluster, https response error StatusCode: 400, RequestID: 997c2629-e26f-4752-9921-0885ad06645d, InvalidGlobalClusterStateFault: Global Cluster arn:aws:rds::187416307283:global-cluster:tf-acc-test-3973061279176917188 is not empty
--- FAIL: TestAccDocDBCluster_GlobalClusterIdentifier_Remove (403.87s)
=== CONT TestAccDocDBCluster_port
--- PASS: TestAccDocDBCluster_deleteProtection (233.47s)
--- PASS: TestAccDocDBCluster_port (220.35s)
--- PASS: TestAccDocDBCluster_GlobalClusterIdentifier_PrimarySecondaryClusters (2051.96s)
FAIL
FAIL github.com/hashicorp/terraform-provider-aws/internal/service/docdb 2571.428s
FAIL
make: *** [testacc] Error 1
Failure is unrelated to this change and is occurring in CI.
mange_master_user_password
argument manage_master_user_password
argument
@ewbankkit Thank you for your review and I apologize for the many inadequacies in formatting and notation of constants. I will be careful to address these issues in other PRs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=TestAccDocDBCluster_manageMasterUserPassword\|TestAccDocDBCluster_basic' PKG=docdb
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.8 test ./internal/service/docdb/... -v -count 1 -parallel 20 -run=TestAccDocDBCluster_manageMasterUserPassword\|TestAccDocDBCluster_basic -timeout 720m -vet=off
2025/05/12 09:07:14 Initializing Terraform AWS Provider...
=== RUN TestAccDocDBCluster_basic
=== PAUSE TestAccDocDBCluster_basic
=== RUN TestAccDocDBCluster_manageMasterUserPassword
=== PAUSE TestAccDocDBCluster_manageMasterUserPassword
=== CONT TestAccDocDBCluster_basic
=== CONT TestAccDocDBCluster_manageMasterUserPassword
--- PASS: TestAccDocDBCluster_basic (110.44s)
--- PASS: TestAccDocDBCluster_manageMasterUserPassword (149.76s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/docdb 154.818s
@badmintoncryer Thanks for the contribution 🎉 👏. |
Warning This Issue has been closed, meaning that any additional comments are much easier for the maintainers to miss. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
This functionality has been released in v5.98.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
Description
This PR adds support for the
manage_master_user_password
argument to theaws_docdb_cluster
resource, allowing users to manage their DocumentDB master user password through AWS Secrets Manager rather than storing it as plaintext in Terraform state.manage_master_user_password
boolean parameter to the resource schema (defaults to false)master_user_secret
attribute that returns information about the secret in Secrets Manager when enabledmaster_password
optional whenmanage_master_user_password
is set to trueRelations
Closes #41115
References
ManageMasterUserPassword
inCreateDBClusterInput
: https://github.com/aws/aws-sdk-go-v2/blob/main/service/docdb/api_op_CreateDBCluster.go#L127MasterUserSecret
inDescribeDBClustersOutput
: https://github.com/aws/aws-sdk-go-v2/blob/main/service/docdb/types/types.go#L90Output from Acceptance Testing