Skip to content

Commit

Permalink
add examples in docs/resources/connection.md (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
u110 authored Feb 12, 2025
1 parent e40227a commit d10b735
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 0 deletions.
97 changes: 97 additions & 0 deletions docs/resources/connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,103 @@ resource "trocco_connection" "snowflake" {
}
```

### Google Cloud Storage(GCS)

```terraform
resource "trocco_connection" "gcs" {
connection_type = "gcs"
name = "GCS Example"
description = "This is a Google Cloud Storage(GCS) connection example"
project_id = "example-project-id"
service_account_json_key = <<JSON
{
"type": "service_account",
"project_id": "example-project-id",
"private_key_id": "example-private-key-id",
"private_key":"-----BEGIN PRIVATE KEY-----\n..."
}
JSON
service_account_email = "joe@example-project.iam.gserviceaccount.com"
application_name = "example-application-name"
}
```

### MySQL

```terraform
resource "trocco_connection" "mysql" {
connection_type = "mysql"
name = "MySQL Example"
description = "This is a MySQL connection example"
host = "db.example.com"
port = 65535
user_name = "root"
password = "password"
ssl = {
ca = <<-SSL_CA
-----BEGIN PRIVATE KEY-----
...SSL CA...
-----END PRIVATE KEY-----
SSL_CA
cert = <<-SSL_CERT
-----BEGIN CERTIFICATE-----
...SSL CRT...
-----END CERTIFICATE-----
SSL_CERT
key = <<-SSL_KEY
-----BEGIN PRIVATE KEY-----
...SSL KEY...
-----END PRIVATE KEY-----
SSL_KEY
}
gateway = {
host = "gateway.example.com"
port = 1234
user_name = "gateway-joe"
password = "gateway-joepass"
key = <<-GATEWAY_KEY
-----BEGIN PRIVATE KEY-----
... GATEWAY KEY...
-----END PRIVATE KEY-----
GATEWAY_KEY
key_passphrase = "sample_passphrase"
}
resource_group_id = 1
}
```

### S3

```terraform
resource "trocco_connection" "s3" {
connection_type = "s3"
name = "S3 Example"
description = "This is a AWS S3 connection example"
aws_auth_type = "iam_user"
aws_iam_user = {
access_key_id = "YOUR_ACCESS_KEY_ID"
secret_access_key = "YOUR_SECRET_ACCESS_KEY"
}
}
resource "trocco_connection" "s3_with_assume_role" {
connection_type = "s3"
name = "S3 Example"
description = "This is a AWS S3 connection example"
aws_auth_type = "assume_role"
aws_assume_role = {
account_id = "123456789012"
role_name = "YOUR_ROLE_NAME"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

Expand Down
12 changes: 12 additions & 0 deletions templates/resources/connection.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ description: |-

{{codefile "terraform" "examples/resources/trocco_connection/snowflake.tf"}}

### Google Cloud Storage(GCS)

{{codefile "terraform" "examples/resources/trocco_connection/gcs.tf"}}

### MySQL

{{codefile "terraform" "examples/resources/trocco_connection/mysql.tf"}}

### S3

{{codefile "terraform" "examples/resources/trocco_connection/s3.tf"}}

{{.SchemaMarkdown}}

## Import
Expand Down

0 comments on commit d10b735

Please sign in to comment.