-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: added support for ssl_config for postgresql_profile #15768
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
Open
pete-layerhealth
wants to merge
6
commits into
GoogleCloudPlatform:main
Choose a base branch
from
pete-layerhealth:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+145
−0
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2cf6dda
feat: added support for ssl_config support for postgresql_profile
a6d57d2
Merge remote-tracking branch 'upstream/main'
pete-layerhealth 420bd60
reapply fixes
pete-layerhealth d769119
ignore_read_extra
pete-layerhealth beac869
just ignore the whole block
pete-layerhealth 31fb071
ignore password too
pete-layerhealth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
...rm/examples/datastream_stream_postgresql_sslconfig_server_and_client_verification.tf.tmpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| data "google_datastream_static_ips" "datastream_ips" { | ||
| location = "us-central1" | ||
| } | ||
|
|
||
| resource "google_sql_database_instance" "instance" { | ||
| name = "{{index $.Vars "database_instance_name"}}" | ||
| database_version = "POSTGRES_15" | ||
| region = "us-central1" | ||
| settings { | ||
| tier = "db-f1-micro" | ||
| ip_configuration { | ||
| ipv4_enabled = true | ||
| ssl_mode = "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" | ||
| dynamic "authorized_networks" { | ||
| for_each = data.google_datastream_static_ips.datastream_ips.static_ips | ||
| iterator = ip | ||
|
|
||
| content { | ||
| name = format("datastream-%d", ip.key) | ||
| value = ip.value | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| deletion_protection = {{index $.Vars "deletion_protection"}} | ||
| } | ||
|
|
||
| resource "google_sql_database" "db" { | ||
| instance = google_sql_database_instance.instance.name | ||
| name = "db" | ||
| } | ||
|
|
||
| resource "random_password" "pwd" { | ||
| length = 16 | ||
| special = false | ||
| } | ||
|
|
||
| resource "google_sql_user" "user" { | ||
| name = "user" | ||
| instance = google_sql_database_instance.instance.name | ||
| password = random_password.pwd.result | ||
| } | ||
|
|
||
| resource "google_sql_ssl_cert" "client_cert" { | ||
| common_name = "client-name" | ||
| instance = google_sql_database_instance.instance.name | ||
| } | ||
|
|
||
| resource "google_datastream_connection_profile" "{{$.PrimaryResourceId}}" { | ||
| display_name = "Connection Profile" | ||
| location = "us-central1" | ||
| connection_profile_id = "{{index $.Vars "connection_profile_id"}}" | ||
|
|
||
| postgresql_profile { | ||
| hostname = google_sql_database_instance.instance.public_ip_address | ||
| port = 5432 | ||
| username = "user" | ||
| password = random_password.pwd.result | ||
| database = google_sql_database.db.name | ||
| ssl_config { | ||
| server_and_client_verification { | ||
| client_certificate = google_sql_ssl_cert.client_cert.cert | ||
| client_key = google_sql_ssl_cert.client_cert.private_key | ||
| ca_certificate = google_sql_ssl_cert.client_cert.server_ca_cert | ||
| } | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This entire block may need ignore_read. I'm still seeing a diff when running the test