Skip to content

Commit dc40fdd

Browse files
authored
Revert "add connection_type: PostgreSQL (#45)" (#55)
This reverts commit ec54988.
1 parent ec54988 commit dc40fdd

File tree

5 files changed

+33
-199
lines changed

5 files changed

+33
-199
lines changed

docs/resources/connection.md

Lines changed: 16 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ resource "trocco_connection" "bigquery" {
3232
}
3333
```
3434

35-
### Snowflake
35+
### Snowflake
3636

3737
```terraform
3838
resource "trocco_connection" "snowflake" {
@@ -161,20 +161,18 @@ resource "trocco_connection" "s3_with_assume_role" {
161161
- `aws_auth_type` (String) S3: The authentication type for the S3 connection. It must be one of `iam_user` or `assume_role`.
162162
- `aws_iam_user` (Attributes) S3: IAM User configuration. (see [below for nested schema](#nestedatt--aws_iam_user))
163163
- `description` (String) The description of the connection.
164-
- `driver` (String) PostgreSQL: The name of a PostgreSQL driver.
165-
- `gateway` (Attributes) MySQL, PostgreSQL: Whether to connect via SSH (see [below for nested schema](#nestedatt--gateway))
166-
- `host` (String) Snowflake, PostgreSQL: The host of a (Snowflake, PostgreSQL) account.
167-
- `password` (String, Sensitive) Snowflake, PostgreSQL: The password for the (Snowflake, PostgreSQL) user.
168-
- `port` (Number) MySQL, PostgreSQL: The port of the (MySQL, PostgreSQL) server.
164+
- `gateway` (Attributes) MySQL: Whether to connect via SSH (see [below for nested schema](#nestedatt--gateway))
165+
- `host` (String) Snowflake: The host of a Snowflake account.
166+
- `password` (String, Sensitive) Snowflake: The password for the Snowflake user.
167+
- `port` (Number) MySQL: The port of the MySQL server.
169168
- `private_key` (String, Sensitive) Snowflake: A private key for the Snowflake user.
170169
- `project_id` (String) BigQuery, GCS: A GCP project ID.
171170
- `resource_group_id` (Number) The ID of the resource group the connection belongs to.
172171
- `role` (String) Snowflake: A role attached to the Snowflake user.
173172
- `service_account_email` (String, Sensitive) GCS: A GCP service account email.
174173
- `service_account_json_key` (String, Sensitive) BigQuery: A GCP service account key.
175-
- `ssl` (Attributes) MySQL, PostgreSQL: SSL configuration. (see [below for nested schema](#nestedatt--ssl))
176-
- `ssl_mode` (String) PostgreSQL: SSL connection mode.
177-
- `user_name` (String) Snowflake, PostgreSQL: The name of a (Snowflake, PostgreSQL) user.
174+
- `ssl` (Attributes) MySQL: SSL configuration. (see [below for nested schema](#nestedatt--ssl))
175+
- `user_name` (String) Snowflake: The name of a Snowflake user.
178176

179177
### Read-Only
180178

@@ -203,72 +201,26 @@ Optional:
203201

204202
Optional:
205203

206-
- `host` (String, Sensitive) MySQL, PostgreSQL: SSH Host
207-
- `key` (String, Sensitive) MySQL, PostgreSQL: SSH Private Key
208-
- `key_passphrase` (String, Sensitive) MySQL, PostgreSQL: SSH Private Key Passphrase
209-
- `password` (String, Sensitive) MySQL, PostgreSQL: SSH Password
210-
- `port` (Number, Sensitive) MySQL, PostgreSQL: SSH Port
211-
- `user_name` (String, Sensitive) MySQL, PostgreSQL: SSH User
204+
- `host` (String, Sensitive) MySQL: SSH Host
205+
- `key` (String, Sensitive) MySQL: SSH Private Key
206+
- `key_passphrase` (String, Sensitive) MySQL: SSH Private Key Passphrase
207+
- `password` (String, Sensitive) MySQL: SSH Password
208+
- `port` (Number, Sensitive) MySQL: SSH Port
209+
- `user_name` (String, Sensitive) MySQL: SSH User
212210

213211

214212
<a id="nestedatt--ssl"></a>
215213
### Nested Schema for `ssl`
216214

217215
Optional:
218216

219-
- `ca` (String, Sensitive) MySQL, PostgreSQL: CA certificate
220-
- `cert` (String, Sensitive) MySQL, PostgreSQL: Certificate (CRT file)
221-
- `key` (String, Sensitive) MySQL, PostgreSQL: Key (KEY file)
217+
- `ca` (String, Sensitive) MySQL: CA certificate
218+
- `cert` (String, Sensitive) MySQL: Certificate (CRT file)
219+
- `key` (String, Sensitive) MySQL: Key (KEY file)
222220

223221

224222

225223

226-
### PostgreSQL
227-
228-
```terraform
229-
resource "trocco_connection" "postgresql" {
230-
connection_type = "postgresql"
231-
name = "PostgreSQL Example"
232-
description = "This is a PostgreSQL connection example"
233-
host = "db.example.com"
234-
port = 5432
235-
user_name = "root"
236-
password = "password"
237-
ssl_mode = "require"
238-
driver = "postgresql_42_5_1"
239-
ssl = {
240-
ca = <<-SSL_CA
241-
-----BEGIN PRIVATE KEY-----
242-
...SSL CA...
243-
-----END PRIVATE KEY-----
244-
SSL_CA
245-
cert = <<-SSL_CERT
246-
-----BEGIN CERTIFICATE-----
247-
...SSL CRT...
248-
-----END CERTIFICATE-----
249-
SSL_CERT
250-
key = <<-SSL_KEY
251-
-----BEGIN PRIVATE KEY-----
252-
...SSL KEY...
253-
-----END PRIVATE KEY-----
254-
SSL_KEY
255-
}
256-
gateway = {
257-
host = "gateway.example.com"
258-
port = 1234
259-
user_name = "gateway-joe"
260-
password = "gateway-joepass"
261-
key = <<-GATEWAY_KEY
262-
-----BEGIN PRIVATE KEY-----
263-
... GATEWAY KEY...
264-
-----END PRIVATE KEY-----
265-
GATEWAY_KEY
266-
key_passphrase = "sample_passphrase"
267-
}
268-
resource_group_id = 1
269-
}
270-
```
271-
272224
## Import
273225

274226
Import is supported using the following syntax:

examples/resources/trocco_connection/postgresql.tf

Lines changed: 0 additions & 41 deletions
This file was deleted.

internal/client/connection.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ type Connection struct {
4848
AWSSecretAccessKey *string `json:"aws_secret_access_key,omitempty"`
4949
AWSAssumeRoleAccountID *string `json:"aws_assume_role_account_id,omitempty"`
5050
AWSAssumeRoleName *string `json:"aws_assume_role_name,omitempty"`
51-
52-
// PostgreSQL Fields
53-
SSLMode *string `json:"ssl_mode,omitempty"`
5451
}
5552

5653
type GetConnectionsInput struct {
@@ -100,12 +97,6 @@ type CreateConnectionInput struct {
10097
AWSSecretAccessKey *string `json:"aws_secret_access_key,omitempty"`
10198
AWSAssumeRoleAccountID *string `json:"aws_assume_role_account_id,omitempty"`
10299
AWSAssumeRoleName *string `json:"aws_assume_role_name,omitempty"`
103-
104-
// PostgreSQL Fields
105-
SSLClientCa *string `json:"ssl_client_ca,omitempty"`
106-
SSLClientKey *string `json:"ssl_client_key,omitempty"`
107-
SSLMode *string `json:"ssl_mode,omitempty"`
108-
Driver *string `json:"driver,omitempty"`
109100
}
110101

111102
type UpdateConnectionInput struct {
@@ -150,12 +141,6 @@ type UpdateConnectionInput struct {
150141
AWSSecretAccessKey *string `json:"aws_secret_access_key,omitempty"`
151142
AWSAssumeRoleAccountID *string `json:"aws_assume_role_account_id,omitempty"`
152143
AWSAssumeRoleName *string `json:"aws_assume_role_name,omitempty"`
153-
154-
// PostgreSQL Fields
155-
SSLClientCa *string `json:"ssl_client_ca,omitempty"`
156-
SSLClientKey *string `json:"ssl_client_key,omitempty"`
157-
SSLMode *string `json:"ssl_mode,omitempty"`
158-
Driver *string `json:"driver,omitempty"`
159144
}
160145

161146
func (c *TroccoClient) GetConnections(connectionType string, in *GetConnectionsInput) (*ConnectionList, error) {

0 commit comments

Comments
 (0)