Skip to content
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

feat: support for random password #306

Merged
merged 19 commits into from
Mar 18, 2021

Conversation

codezninja
Copy link
Contributor

@codezninja codezninja commented Mar 9, 2021

Description

Add support to create a random password

Motivation and Context

Rather than having the parent project create it I wanted to follow a similiar pattern that was established in terraform-aws-rds-aurora.

Breaking Changes

  • No

How Has This Been Tested?

  • currently using this forked version of the module so I don't have to create the password. The complexity was simple enough to validate the password change.
  • Confirmed can still set password
  • Confirmed if no password set, random password is create if create_random_password flag is set
  • Confirmed if password set, random password was used instead if create_random_password flag is set

@codezninja codezninja changed the title support for random password feat: support for random password Mar 9, 2021
@codezninja

This comment has been minimized.

@codezninja
Copy link
Contributor Author

@bryantbiggs do we think this feature could be added to the next release?

main.tf Outdated Show resolved Hide resolved
variables.tf Outdated Show resolved Hide resolved
@bryantbiggs
Copy link
Member

overall looks good - if you could update the complete examples when you get a chance, I run through a couple tests and we should be good to go

@codezninja
Copy link
Contributor Author

codezninja commented Mar 10, 2021

@bryantbiggs do you want me to add the create_password to all the complete examples AND create a new example like random_password

nvm i'll add random password module to all the complete examples

@bryantbiggs
Copy link
Member

@bondezbond no no - I've added two instances to the complete-mysql and complete-postgresql to test two scenarios:

  1. complete setup of RDS instance which enables most features/functionality https://github.com/bryantbiggs/terraform-aws-rds/blob/a9f87a5cdae69d11d6653309659dc69cb6de9a1a/examples/complete-mysql/main.tf#L61
  2. default setup of RDS instance which relies on the module defaults with the minimum amount of required input https://github.com/bryantbiggs/terraform-aws-rds/blob/a9f87a5cdae69d11d6653309659dc69cb6de9a1a/examples/complete-mysql/main.tf#L112

so if you could just add the following to both complete-mysql and complete-postgresql to the first instance (see 1 above) to show how users can utilize this functionality and also for us to use in testing

	create_random_password = true
	random_password_length = 16

and also add an output to the examples for this_db_instance_master_password

@codezninja
Copy link
Contributor Author

codezninja commented Mar 10, 2021

@bryantbiggs I opted to create its own module resource to show how you can create a random password without setting password. Found a bug that way. I'm hoping thats okay to leave as is. I tested by running terraform plan -target=module.db_random_password in both repos

@codezninja
Copy link
Contributor Author

@bryantbiggs is there anything else you need for this PR?

@codezninja
Copy link
Contributor Author

kk I've removed the second resource

Copy link
Member

@bryantbiggs bryantbiggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validated with complete-postgresql - good to go @antonbabenko 👍🏼 - thanks @bondezbond 🎉

@codezninja
Copy link
Contributor Author

thanks for validating!

@antonbabenko antonbabenko merged commit cd58b76 into terraform-aws-modules:master Mar 18, 2021
@antonbabenko
Copy link
Member

Thanks @bondezbond for this one!

v2.32.0 has been just released.

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants