Skip to content

Commit

Permalink
Merge pull request #32 from mineiros-io/lukas/add-ssl-mode
Browse files Browse the repository at this point in the history
feat: add ssl_mode attribute
  • Loading branch information
Esanim authored Feb 27, 2024
2 parents 5458a73 + 6d5a92c commit 1606608
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 9 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ See [variables.tf] and [examples/] for details and use-cases.

Whether SSL connections over IP are enforced or not.

- [**`ssl_mode`**](#attr-ip_configuration-ssl_mode): *(Optional `string`)*<a name="attr-ip_configuration-ssl_mode"></a>

Specify how SSL connection should be enforced in DB connections.
To change this field, also set the correspoding value in require_ssl.
Check the value pairs [API reference](https://cloud.google.com/sql/docs/postgres/admin-api/rest/v1beta4/instances#ipconfiguration)

- [**`allocated_ip_range `**](#attr-ip_configuration-allocated_ip_range ): *(Optional `string`)*<a name="attr-ip_configuration-allocated_ip_range "></a>

The name of the allocated ip range for the private ip CloudSQL instance.
Expand Down
9 changes: 9 additions & 0 deletions README.tfdoc.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,15 @@ section {
Whether SSL connections over IP are enforced or not.
END
}

attribute "ssl_mode" {
type = string
description = <<-END
Specify how SSL connection should be enforced in DB connections.
To change this field, also set the correspoding value in require_ssl.
Check the value pairs [API reference](https://cloud.google.com/sql/docs/postgres/admin-api/rest/v1beta4/instances#ipconfiguration)
END
}
attribute "allocated_ip_range " {
type = string
description = <<-END
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ resource "google_sql_database_instance" "instance" {
ipv4_enabled = try(ip_configuration.value.ipv4_enabled, null)
private_network = try(ip_configuration.value.private_network, null)
require_ssl = try(ip_configuration.value.require_ssl, null)
ssl_mode = try(ip_configuration.value.ssl_mode, null)
allocated_ip_range = try(ip_configuration.value.allocated_ip_range, null)
enable_private_path_for_google_cloud_services = try(ip_configuration.value.enable_private_path_for_google_cloud_services, null)

Expand Down
4 changes: 2 additions & 2 deletions test/unit-complete/_generated_google.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5, <5.6"
version = ">= 5.6, <6"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5, <5.6"
version = ">= 5.6, <6"
}
random = {
source = "hashicorp/random"
Expand Down
1 change: 1 addition & 0 deletions test/unit-complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ module "test" {
}]
private_network = "projects/${local.project_id}/global/networks/default"
require_ssl = true
ssl_mode = "TRUSTED_CLIENT_CERTIFICATE_REQUIRED"
allocated_ip_range = "google-managed-services-default"
}

Expand Down
4 changes: 2 additions & 2 deletions test/unit-disabled/_generated_google.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5, <5.6"
version = ">= 5.6, <6"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5, <5.6"
version = ">= 5.6, <6"
}
random = {
source = "hashicorp/random"
Expand Down
4 changes: 2 additions & 2 deletions test/unit-minimal/_generated_google.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "5"
version = "5.6"
}
google-beta = {
source = "hashicorp/google-beta"
version = "5"
version = "5.6"
}
random = {
source = "hashicorp/random"
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5, <5.6"
version = ">= 5.6, <6"
}
}
}
4 changes: 2 additions & 2 deletions versions.tm.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ globals {
minimum_terraform_version = "1.0"

provider = "google"
minimum_provider_version = "5"
minimum_provider_version = "5.6"

provider_version_constraint = ">= ${global.minimum_provider_version}, <5.6"
provider_version_constraint = ">= ${global.minimum_provider_version}, <6"
terraform_version_constraint = "~> ${global.minimum_terraform_version}, != 1.1.0, != 1.1.1"
# we exclude 1.1.0 and 1.1.1 because of:
# https://github.com/hashicorp/terraform/blob/v1.1/CHANGELOG.md#112-december-17-2021
Expand Down

0 comments on commit 1606608

Please sign in to comment.