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!: Add pwd validation policy for mysql modules #409

Merged
merged 6 commits into from
Jan 27, 2023

Conversation

anuhyapolisetti
Copy link
Contributor

This PR adds support for the settings.password_validation_policy block in the mysql module

For Mysql, password validation policy is supported only for 5.7 Database version.

I've added the password_validation_policy block (and related tests) to the mysql-ha example.

@anuhyapolisetti anuhyapolisetti requested a review from a team as a code owner January 17, 2023 21:24
@anuhyapolisetti anuhyapolisetti changed the title Add pwd validation policy for mysql modules feat!: Add pwd validation policy for mysql modules Jan 17, 2023
@@ -48,6 +53,7 @@ resource "google_sql_database_instance" "default" {
region = var.region
encryption_key_name = var.encryption_key_name
deletion_protection = var.deletion_protection
root_password = coalesce(var.root_password, random_password.root-password.result)
Copy link
Member

Choose a reason for hiding this comment

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

Looks like root_password was previously force new and this may result in recreation of google_sql_database_instance for users on the older provider. Can we default to null if no var.root_password?

https://github.com/hashicorp/terraform-provider-google/pull/13574/files

@comment-bot-dev
Copy link

@anuhyapolisetti
Thanks for the PR! 🚀
✅ Lint checks have passed.

@bharathkkb bharathkkb merged commit df8accd into terraform-google-modules:master Jan 27, 2023
@philip-harvey
Copy link

The change from special = false to special = true is a very bad breaking change and there is no way to use this module with this change until this is fixed. I suggest adding another var to specifiy if the generated passwords should use special chars or not and defaulting to false since otherwise this is a bad breaking change

Copy link

@philip-harvey philip-harvey left a comment

Choose a reason for hiding this comment

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

This is a breaking change

@@ -178,7 +189,7 @@ resource "random_password" "user-password" {
}

length = 32
special = false

Choose a reason for hiding this comment

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

This change is a MAJOR breaking change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants