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 ssl_mode attribute #32

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading