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(postgres): add root password parameter #521

Merged

Conversation

the-veloper
Copy link
Contributor

@the-veloper the-veloper commented Oct 5, 2023

Apparently a compliant root_password value is required, if there's a password policy set, due to the fact that:

NOTE on google_sql_database_instance:
- Second-generation instances include a default 'root'@'%' user with no password. This user will be deleted by Terraform on instance creation. You should use google_sql_user to define a custom user with a restricted host and strong password.

Otherwise there's the following error:

 Error: Error, failed to create instance postgre-dev-01: googleapi: Error 400: Invalid request: Root user's password is not policy compliant: Length of password cannot be less than 8. ., invalid
│
│   with module.postgre.google_sql_database_instance.default,
│   on .terraform/modules/postgre/modules/postgresql/main.tf line 50, in resource "google_sql_database_instance" "default":
│   50: resource "google_sql_database_instance" "default" {

Note source: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/sql_database_instance
Example from google: https://cloud.google.com/sql/docs/postgres/samples/cloud-sql-postgres-instance-pvp

@the-veloper the-veloper requested review from isaurabhuttam and a team as code owners October 5, 2023 13:25
@google-cla
Copy link

google-cla bot commented Oct 5, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@the-veloper the-veloper changed the title postgres add root password parameter feat(postgres): add root password parameter Oct 5, 2023
@imrannayer
Copy link
Collaborator

@the-veloper thanks for the PR. Lint test failed.
Thanks

@imrannayer imrannayer added the waiting-response Waiting for issue author to respond. label Nov 29, 2023
@g-awmalik g-awmalik requested a review from imrannayer as a code owner December 5, 2023 18:39
@g-awmalik
Copy link
Contributor

/gcbrun

@g-awmalik
Copy link
Contributor

/gcbrun

@g-awmalik
Copy link
Contributor

g-awmalik commented Dec 5, 2023

This will address #214

@g-awmalik g-awmalik merged commit be2da56 into terraform-google-modules:master Dec 5, 2023
4 checks passed
@the-veloper the-veloper deleted the root-password-path branch February 7, 2024 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-response Waiting for issue author to respond.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants