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: added enable_private_path_for_google_cloud_services field in ip_configuration for google_sql_database_instance resource #449

Merged
merged 38 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 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
2080abb
Merge branch 'terraform-google-modules:master' into master
ravisiddhu Mar 14, 2023
dc11da2
Merge branch 'terraform-google-modules:master' into master
ravisiddhu Mar 21, 2023
19c2c02
feat: added enable_private_path_for_google_cloud_services field in ip…
ravisiddhu Mar 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions modules/mssql/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
source:
repo: https://github.com/terraform-google-modules/terraform-google-sql-db
sourceType: git
version: 13.0.1
version: 14.1.0
actuationTool:
type: Terraform
version: '>= 0.13'
Expand Down Expand Up @@ -106,7 +106,7 @@ spec:
- name: create_timeout
description: The optional timeout that is applied to limit long database creates.
type: string
default: 15m
default: 30m
required: false
- name: database_flags
description: The database flags for the master instance. See [more details](https://cloud.google.com/sql/docs/sqlserver/flags)
Expand Down Expand Up @@ -147,6 +147,21 @@ spec:
type: bool
default: true
required: false
- name: deletion_protection_enabled
description: Enables protection of an instance from accidental deletion protection across all surfaces (API, gcloud, Cloud Console and Terraform).
type: bool
default: false
required: false
- name: deny_maintenance_period
description: The Deny Maintenance Period fields to prevent automatic maintenance from occurring during a 90-day time period. See [more details](https://cloud.google.com/sql/docs/sqlserver/maintenance)
type: |-
list(object({
end_date = string
start_date = string
time = string
}))
default: []
required: false
- name: disk_autoresize
description: Configuration to increase storage size.
type: bool
Expand Down Expand Up @@ -257,7 +272,7 @@ spec:
- name: update_timeout
description: The optional timeout that is applied to limit long database updates.
type: string
default: 15m
default: 30m
required: false
- name: user_labels
description: The key/value labels for the master instances.
Expand Down
4 changes: 2 additions & 2 deletions modules/mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Note: CloudSQL provides [disk autoresize](https://cloud.google.com/sql/docs/mysq
| additional\_users | A list of users to be created in your cluster. A random password would be set for the user if the `random_password` variable is set. | <pre>list(object({<br> name = string<br> password = string<br> random_password = bool<br> type = string<br> host = string<br> }))</pre> | `[]` | no |
| availability\_type | The availability type for the master instance. Can be either `REGIONAL` or `null`. | `string` | `"REGIONAL"` | no |
| backup\_configuration | The backup\_configuration settings subblock for the database setings | <pre>object({<br> binary_log_enabled = bool<br> enabled = bool<br> start_time = string<br> location = string<br> transaction_log_retention_days = string<br> retained_backups = number<br> retention_unit = string<br> })</pre> | <pre>{<br> "binary_log_enabled": false,<br> "enabled": false,<br> "location": null,<br> "retained_backups": null,<br> "retention_unit": null,<br> "start_time": null,<br> "transaction_log_retention_days": null<br>}</pre> | no |
| connector\_enforcement | Force clients to use the connector. See[more details](https://cloud.google.com/sql/docs/mysql/connect-connectors). | `bool` | `false` | no |
| connector\_enforcement | Enforce that clients use the connector library | `bool` | `false` | no |
| create\_timeout | The optional timout that is applied to limit long database creates. | `string` | `"30m"` | no |
| database\_flags | List of Cloud SQL flags that are applied to the database server. See [more details](https://cloud.google.com/sql/docs/mysql/flags) | <pre>list(object({<br> name = string<br> value = string<br> }))</pre> | `[]` | no |
| database\_version | The database version to use | `string` | n/a | yes |
Expand All @@ -33,7 +33,7 @@ Note: CloudSQL provides [disk autoresize](https://cloud.google.com/sql/docs/mysq
| encryption\_key\_name | The full path to the encryption key used for the CMEK disk encryption | `string` | `null` | no |
| follow\_gae\_application | A Google App Engine application whose zone to remain in. Must be in the same region as this instance. | `string` | `null` | no |
| insights\_config | The insights\_config settings for the database. | <pre>object({<br> query_string_length = number<br> record_application_tags = bool<br> record_client_address = bool<br> })</pre> | `null` | no |
| ip\_configuration | The ip\_configuration settings subblock | <pre>object({<br> authorized_networks = list(map(string))<br> ipv4_enabled = bool<br> private_network = string<br> require_ssl = bool<br> allocated_ip_range = string<br> })</pre> | <pre>{<br> "allocated_ip_range": null,<br> "authorized_networks": [],<br> "ipv4_enabled": true,<br> "private_network": null,<br> "require_ssl": null<br>}</pre> | no |
| ip\_configuration | The ip\_configuration settings subblock | <pre>object({<br> authorized_networks = list(map(string))<br> ipv4_enabled = bool<br> private_network = string<br> require_ssl = bool<br> allocated_ip_range = string<br> enable_private_path_for_google_cloud_services = optional(bool)<br> })</pre> | <pre>{<br> "allocated_ip_range": null,<br> "authorized_networks": [],<br> "enable_private_path_for_google_cloud_services": false,<br> "ipv4_enabled": true,<br> "private_network": null,<br> "require_ssl": null<br>}</pre> | no |
| maintenance\_window\_day | The day of week (1-7) for the master instance maintenance. | `number` | `1` | no |
| maintenance\_window\_hour | The hour of day (0-23) maintenance window for the master instance maintenance. | `number` | `23` | no |
| maintenance\_window\_update\_track | The update track of maintenance window for the master instance maintenance. Can be either `canary` or `stable`. | `string` | `"canary"` | no |
Expand Down
12 changes: 7 additions & 5 deletions modules/mysql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ locals {
retained_backups = lookup(var.backup_configuration, "retained_backups", null)
retention_unit = lookup(var.backup_configuration, "retention_unit", null)

// Force the usage of connector_enforcement
// Force the usage of connector_enforcement
connector_enforcement = var.connector_enforcement ? "REQUIRED" : "NOT_REQUIRED"
}

Expand All @@ -59,6 +59,7 @@ resource "google_sql_database_instance" "default" {
availability_type = var.availability_type
deletion_protection_enabled = var.deletion_protection_enabled
connector_enforcement = local.connector_enforcement

dynamic "backup_configuration" {
for_each = [var.backup_configuration]
content {
Expand Down Expand Up @@ -108,10 +109,11 @@ resource "google_sql_database_instance" "default" {
dynamic "ip_configuration" {
for_each = [local.ip_configurations[local.ip_configuration_enabled ? "enabled" : "disabled"]]
content {
ipv4_enabled = lookup(ip_configuration.value, "ipv4_enabled", null)
private_network = lookup(ip_configuration.value, "private_network", null)
require_ssl = lookup(ip_configuration.value, "require_ssl", null)
allocated_ip_range = lookup(ip_configuration.value, "allocated_ip_range", null)
ipv4_enabled = lookup(ip_configuration.value, "ipv4_enabled", null)
private_network = lookup(ip_configuration.value, "private_network", null)
require_ssl = lookup(ip_configuration.value, "require_ssl", null)
allocated_ip_range = lookup(ip_configuration.value, "allocated_ip_range", null)
enable_private_path_for_google_cloud_services = lookup(ip_configuration.value, "enable_private_path_for_google_cloud_services", false)

dynamic "authorized_networks" {
for_each = lookup(ip_configuration.value, "authorized_networks", [])
Expand Down
29 changes: 18 additions & 11 deletions modules/mysql/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ spec:
source:
repo: https://github.com/terraform-google-modules/terraform-google-sql-db
sourceType: git
version: 13.0.1
version: 14.1.0
actuationTool:
type: Terraform
version: '>= 0.13'
version: '>= 1.3'
examples:
- name: mssql-public
location: examples/mssql-public
Expand Down Expand Up @@ -101,14 +101,14 @@ spec:
transaction_log_retention_days: null
required: false
- name: connector_enforcement
description: Force the client to use the connector. See [more details](https://cloud.google.com/sql/docs/mysql/connect-connectors)
description: Enforce that clients use the connector library
type: bool
default: false
required: false
- name: create_timeout
description: The optional timout that is applied to limit long database creates.
type: string
default: 10m
default: 30m
required: false
- name: database_flags
description: List of Cloud SQL flags that are applied to the database server. See [more details](https://cloud.google.com/sql/docs/mysql/flags)
Expand Down Expand Up @@ -141,7 +141,7 @@ spec:
- name: delete_timeout
description: The optional timout that is applied to limit long database deletes.
type: string
default: 10m
default: 30m
required: false
- name: deletion_protection
description: Used to block Terraform from deleting a SQL Instance.
Expand Down Expand Up @@ -193,6 +193,11 @@ spec:
type: bool
default: true
required: false
- name: enable_random_password_special
description: Enable special characters in generated random passwords.
type: bool
default: false
required: false
- name: encryption_key_name
description: The full path to the encryption key used for the CMEK disk encryption
type: string
Expand All @@ -214,15 +219,17 @@ spec:
description: The ip_configuration settings subblock
type: |-
object({
authorized_networks = list(map(string))
ipv4_enabled = bool
private_network = string
require_ssl = bool
allocated_ip_range = string
authorized_networks = list(map(string))
ipv4_enabled = bool
private_network = string
require_ssl = bool
allocated_ip_range = string
enable_private_path_for_google_cloud_services = optional(bool)
})
default:
allocated_ip_range: null
authorized_networks: []
enable_private_path_for_google_cloud_services: false
ipv4_enabled: true
private_network: null
require_ssl: null
Expand Down Expand Up @@ -341,7 +348,7 @@ spec:
- name: update_timeout
description: The optional timout that is applied to limit long database updates.
type: string
default: 10m
default: 30m
required: false
- name: user_host
description: The host for the default user
Expand Down
22 changes: 12 additions & 10 deletions modules/mysql/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -200,18 +200,20 @@ variable "insights_config" {
variable "ip_configuration" {
description = "The ip_configuration settings subblock"
type = object({
authorized_networks = list(map(string))
ipv4_enabled = bool
private_network = string
require_ssl = bool
allocated_ip_range = string
authorized_networks = list(map(string))
ipv4_enabled = bool
private_network = string
require_ssl = bool
allocated_ip_range = string
enable_private_path_for_google_cloud_services = optional(bool)
})
default = {
authorized_networks = []
ipv4_enabled = true
private_network = null
require_ssl = null
allocated_ip_range = null
authorized_networks = []
ipv4_enabled = true
private_network = null
require_ssl = null
allocated_ip_range = null
enable_private_path_for_google_cloud_services = false
}
}

Expand Down
2 changes: 1 addition & 1 deletion modules/postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Note: CloudSQL provides [disk autoresize](https://cloud.google.com/sql/docs/mysq
| follow\_gae\_application | A Google App Engine application whose zone to remain in. Must be in the same region as this instance. | `string` | `null` | no |
| iam\_user\_emails | A list of IAM users to be created in your cluster | `list(string)` | `[]` | no |
| insights\_config | The insights\_config settings for the database. | <pre>object({<br> query_string_length = number<br> record_application_tags = bool<br> record_client_address = bool<br> })</pre> | `null` | no |
| ip\_configuration | The ip configuration for the master instances. | <pre>object({<br> authorized_networks = list(map(string))<br> ipv4_enabled = bool<br> private_network = string<br> require_ssl = bool<br> allocated_ip_range = string<br> })</pre> | <pre>{<br> "allocated_ip_range": null,<br> "authorized_networks": [],<br> "ipv4_enabled": true,<br> "private_network": null,<br> "require_ssl": null<br>}</pre> | no |
| ip\_configuration | The ip configuration for the master instances. | <pre>object({<br> authorized_networks = list(map(string))<br> ipv4_enabled = bool<br> private_network = string<br> require_ssl = bool<br> allocated_ip_range = string<br> enable_private_path_for_google_cloud_services = optional(bool)<br> })</pre> | <pre>{<br> "allocated_ip_range": null,<br> "authorized_networks": [],<br> "enable_private_path_for_google_cloud_services": false,<br> "ipv4_enabled": true,<br> "private_network": null,<br> "require_ssl": null<br>}</pre> | no |
| maintenance\_window\_day | The day of week (1-7) for the master instance maintenance. | `number` | `1` | no |
| maintenance\_window\_hour | The hour of day (0-23) maintenance window for the master instance maintenance. | `number` | `23` | no |
| maintenance\_window\_update\_track | The update track of maintenance window for the master instance maintenance.Can be either `canary` or `stable`. | `string` | `"canary"` | no |
Expand Down
9 changes: 5 additions & 4 deletions modules/postgresql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ resource "google_sql_database_instance" "default" {
dynamic "ip_configuration" {
for_each = [local.ip_configurations[local.ip_configuration_enabled ? "enabled" : "disabled"]]
content {
ipv4_enabled = lookup(ip_configuration.value, "ipv4_enabled", null)
private_network = lookup(ip_configuration.value, "private_network", null)
require_ssl = lookup(ip_configuration.value, "require_ssl", null)
allocated_ip_range = lookup(ip_configuration.value, "allocated_ip_range", null)
ipv4_enabled = lookup(ip_configuration.value, "ipv4_enabled", null)
private_network = lookup(ip_configuration.value, "private_network", null)
require_ssl = lookup(ip_configuration.value, "require_ssl", null)
allocated_ip_range = lookup(ip_configuration.value, "allocated_ip_range", null)
enable_private_path_for_google_cloud_services = lookup(ip_configuration.value, "enable_private_path_for_google_cloud_services", false)

dynamic "authorized_networks" {
for_each = lookup(ip_configuration.value, "authorized_networks", [])
Expand Down
27 changes: 17 additions & 10 deletions modules/postgresql/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ spec:
source:
repo: https://github.com/terraform-google-modules/terraform-google-sql-db
sourceType: git
version: 13.0.1
version: 14.1.0
actuationTool:
type: Terraform
version: '>= 0.13'
version: '>= 1.3'
examples:
- name: mssql-public
location: examples/mssql-public
Expand Down Expand Up @@ -101,7 +101,7 @@ spec:
- name: create_timeout
description: The optional timout that is applied to limit long database creates.
type: string
default: 15m
default: 30m
required: false
- name: database_deletion_policy
description: 'The deletion policy for the database. Setting ABANDON allows the resource to be abandoned rather than deleted. This is useful for Postgres, where databases cannot be deleted from the API if there are users other than cloudsqlsuperuser with access. Possible values are: "ABANDON".'
Expand Down Expand Up @@ -138,7 +138,7 @@ spec:
- name: delete_timeout
description: The optional timout that is applied to limit long database deletes.
type: string
default: 15m
default: 30m
required: false
- name: deletion_protection
description: Used to block Terraform from deleting a SQL Instance.
Expand Down Expand Up @@ -190,6 +190,11 @@ spec:
type: bool
default: true
required: false
- name: enable_random_password_special
description: Enable special characters in generated random passwords.
type: bool
default: false
required: false
- name: encryption_key_name
description: The full path to the encryption key used for the CMEK disk encryption
type: string
Expand All @@ -216,15 +221,17 @@ spec:
description: The ip configuration for the master instances.
type: |-
object({
authorized_networks = list(map(string))
ipv4_enabled = bool
private_network = string
require_ssl = bool
allocated_ip_range = string
authorized_networks = list(map(string))
ipv4_enabled = bool
private_network = string
require_ssl = bool
allocated_ip_range = string
enable_private_path_for_google_cloud_services = optional(bool)
})
default:
allocated_ip_range: null
authorized_networks: []
enable_private_path_for_google_cloud_services: false
ipv4_enabled: true
private_network: null
require_ssl: null
Expand Down Expand Up @@ -334,7 +341,7 @@ spec:
- name: update_timeout
description: The optional timout that is applied to limit long database updates.
type: string
default: 15m
default: 30m
required: false
- name: user_deletion_policy
description: 'The deletion policy for the user. Setting ABANDON allows the resource to be abandoned rather than deleted. This is useful for Postgres, where users cannot be deleted from the API if they have been granted SQL roles. Possible values are: "ABANDON".'
Expand Down
22 changes: 12 additions & 10 deletions modules/postgresql/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -209,18 +209,20 @@ variable "password_validation_policy_config" {
variable "ip_configuration" {
description = "The ip configuration for the master instances."
type = object({
authorized_networks = list(map(string))
ipv4_enabled = bool
private_network = string
require_ssl = bool
allocated_ip_range = string
authorized_networks = list(map(string))
ipv4_enabled = bool
private_network = string
require_ssl = bool
allocated_ip_range = string
enable_private_path_for_google_cloud_services = optional(bool)
})
default = {
authorized_networks = []
ipv4_enabled = true
private_network = null
require_ssl = null
allocated_ip_range = null
authorized_networks = []
ipv4_enabled = true
private_network = null
require_ssl = null
allocated_ip_range = null
enable_private_path_for_google_cloud_services = false
}
}

Expand Down
2 changes: 1 addition & 1 deletion modules/private_service_access/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
source:
repo: https://github.com/terraform-google-modules/terraform-google-sql-db
sourceType: git
version: 13.0.1
version: 14.1.0
actuationTool:
type: Terraform
version: '>= 0.13'
Expand Down
Loading