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

fix: random password for default user and additional users will also follow password validation policy #443

Merged
merged 39 commits into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
5e57aa9
Added functionality to simply specify the database version number ins…
ravisiddhu Dec 12, 2022
711569f
Merge branch 'master' into master
bharathkkb Dec 13, 2022
34f187b
Added functionality to simply specify the database version number ins…
ravisiddhu Dec 12, 2022
0e166cb
Added functionality to simply specify the database version number ins…
ravisiddhu Dec 12, 2022
d675bfc
Merge branch 'terraform-google-modules:master' into master
ravisiddhu Dec 15, 2022
b35ece3
Added senstitive=true field in 'primary' output in mssql module, sinc…
ravisiddhu Dec 15, 2022
a7835d2
Revert "Added senstitive=true field in 'primary' output in mssql modu…
ravisiddhu Dec 15, 2022
72587fc
chore(deps): update module github.com/googlecloudplatform/cloud-found…
renovate[bot] Dec 15, 2022
f59e733
fix: Added sensitive field in output "primary" in mssql module (#394)
ravisiddhu Dec 17, 2022
8f7d928
fix: made the behavour of the 'additional_users' resource in mssql mo…
ravisiddhu Dec 22, 2022
d7ca31e
fix: fixes lint issues and generates metadata (#392)
g-awmalik Dec 27, 2022
d30e9a8
chore: update .github/workflows/stale.yml
cloud-foundation-bot Dec 28, 2022
158cb8b
Merge branch 'terraform-google-modules:master' into master
ravisiddhu Dec 28, 2022
0ed4c37
Merge branch 'master' into master
ravisiddhu Jan 2, 2023
a0689ce
feat: Added new resource called additional_users_with_random_password…
ravisiddhu Jan 5, 2023
8a83d83
Merge branch 'master' into master
ravisiddhu Jan 5, 2023
2eb594a
feat: Aligned the behaviour of additional_users resource in all 3 Clo…
ravisiddhu Jan 9, 2023
6e71be3
feat: Aligned the behaviour of additional_users resource in all 3 Clo…
ravisiddhu Jan 9, 2023
c3adffc
feat: Aligned the behaviour of additional_users resource in all 3 Clo…
ravisiddhu Jan 9, 2023
9c2b6b8
feat: added support for creating IAM users in all 3 modules
ravisiddhu Jan 10, 2023
5a33a14
Merge branch 'terraform-google-modules:master' into master
ravisiddhu Jan 10, 2023
85f2be1
Merge branch 'terraform-google-modules:master' into master
ravisiddhu Jan 10, 2023
2b5492a
Merge branch 'master' of https://github.com/ravisiddhu/terraform-goog…
ravisiddhu Jan 10, 2023
2d7f7b1
Merge branch 'master' of https://github.com/ravisiddhu/terraform-goog…
ravisiddhu Jan 10, 2023
86de1f5
Merge branch 'master' of https://github.com/ravisiddhu/terraform-goog…
ravisiddhu Jan 10, 2023
58079e7
Merge branch 'master' of https://github.com/ravisiddhu/terraform-goog…
ravisiddhu Jan 10, 2023
72463e2
Merge branch 'master' of https://github.com/ravisiddhu/terraform-goog…
ravisiddhu Jan 11, 2023
35d0f76
Merge branch 'master' of https://github.com/ravisiddhu/terraform-goog…
ravisiddhu Jan 11, 2023
7e77964
Merge branch 'master' of https://github.com/ravisiddhu/terraform-goog…
ravisiddhu Jan 12, 2023
b6e52c8
Merge branch 'master' of https://github.com/ravisiddhu/terraform-goog…
ravisiddhu Jan 12, 2023
bab75cf
Merge branch 'master' of https://github.com/ravisiddhu/terraform-goog…
ravisiddhu Jan 12, 2023
c1fa7b2
Merge branch 'terraform-google-modules:master' into master
ravisiddhu Jan 13, 2023
9e2d419
Merge branch 'terraform-google-modules:master' into master
ravisiddhu Jan 24, 2023
a42fe97
Merge branch 'terraform-google-modules:master' into master
ravisiddhu Feb 21, 2023
2be84a1
Merge branch 'terraform-google-modules:master' into master
ravisiddhu Mar 13, 2023
31655ab
fix: random password for default usser and additional users will also…
ravisiddhu Mar 14, 2023
0b0e0c9
Merge branch 'terraform-google-modules:master' into pwd-policy
ravisiddhu Mar 14, 2023
9155d5d
fix: random password for default usser and additional users will also…
ravisiddhu Mar 14, 2023
c53f7b4
Merge branch 'pwd-policy' of https://github.com/ravisiddhu/terraform-…
ravisiddhu Mar 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 14 additions & 6 deletions modules/mysql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -188,19 +188,27 @@ resource "random_password" "user-password" {
name = google_sql_database_instance.default.name
}

length = 32
special = var.enable_random_password_special
depends_on = [null_resource.module_depends_on, google_sql_database_instance.default]
min_lower = 1
min_numeric = 1
min_upper = 1
length = var.password_validation_policy_config != null ? (var.password_validation_policy_config.min_length != null ? var.password_validation_policy_config.min_length + 4 : 32) : 32
special = var.enable_random_password_special ? true : (var.password_validation_policy_config != null ? (var.password_validation_policy_config.complexity != "COMPLEXITY_UNSPECIFIED" ? true : false) : false)
min_special = var.enable_random_password_special ? 1 : (var.password_validation_policy_config != null ? (var.password_validation_policy_config.complexity != "COMPLEXITY_UNSPECIFIED" ? 1 : 0) : 0)
depends_on = [null_resource.module_depends_on, google_sql_database_instance.default]
}

resource "random_password" "additional_passwords" {
for_each = local.users
keepers = {
name = google_sql_database_instance.default.name
}
length = 32
special = var.enable_random_password_special
depends_on = [null_resource.module_depends_on, google_sql_database_instance.default]
min_lower = 1
min_numeric = 1
min_upper = 1
length = var.password_validation_policy_config != null ? (var.password_validation_policy_config.min_length != null ? var.password_validation_policy_config.min_length + 4 : 32) : 32
special = var.enable_random_password_special ? true : (var.password_validation_policy_config != null ? (var.password_validation_policy_config.complexity != "COMPLEXITY_UNSPECIFIED" ? true : false) : false)
min_special = var.enable_random_password_special ? 1 : (var.password_validation_policy_config != null ? (var.password_validation_policy_config.complexity != "COMPLEXITY_UNSPECIFIED" ? 1 : 0) : 0)
depends_on = [null_resource.module_depends_on, google_sql_database_instance.default]
}

resource "google_sql_user" "default" {
Expand Down
21 changes: 14 additions & 7 deletions modules/postgresql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -197,20 +197,27 @@ resource "random_password" "user-password" {
keepers = {
name = google_sql_database_instance.default.name
}

length = 32
special = var.enable_random_password_special
depends_on = [null_resource.module_depends_on, google_sql_database_instance.default]
min_lower = 1
min_numeric = 1
min_upper = 1
length = var.password_validation_policy_config != null ? (var.password_validation_policy_config.min_length != null ? var.password_validation_policy_config.min_length + 4 : 32) : 32
special = var.enable_random_password_special ? true : (var.password_validation_policy_config != null ? (var.password_validation_policy_config.complexity != "COMPLEXITY_UNSPECIFIED" ? true : false) : false)
min_special = var.enable_random_password_special ? 1 : (var.password_validation_policy_config != null ? (var.password_validation_policy_config.complexity != "COMPLEXITY_UNSPECIFIED" ? 1 : 0) : 0)
depends_on = [null_resource.module_depends_on, google_sql_database_instance.default]
}

resource "random_password" "additional_passwords" {
for_each = local.users
keepers = {
name = google_sql_database_instance.default.name
}
length = 32
special = var.enable_random_password_special
depends_on = [null_resource.module_depends_on, google_sql_database_instance.default]
min_lower = 1
min_numeric = 1
min_upper = 1
length = var.password_validation_policy_config != null ? (var.password_validation_policy_config.min_length != null ? var.password_validation_policy_config.min_length + 4 : 32) : 32
special = var.enable_random_password_special ? true : (var.password_validation_policy_config != null ? (var.password_validation_policy_config.complexity != "COMPLEXITY_UNSPECIFIED" ? true : false) : false)
min_special = var.enable_random_password_special ? 1 : (var.password_validation_policy_config != null ? (var.password_validation_policy_config.complexity != "COMPLEXITY_UNSPECIFIED" ? 1 : 0) : 0)
depends_on = [null_resource.module_depends_on, google_sql_database_instance.default]
}

resource "google_sql_user" "default" {
Expand Down