Skip to content

Commit

Permalink
Support new DBT Git Project Creation Flow (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetran-aleksandrboldyrev authored Sep 9, 2024
1 parent 2de7c32 commit efdb4c5
Show file tree
Hide file tree
Showing 37 changed files with 8,824 additions and 5,812 deletions.
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,29 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/fivetran/terraform-provider-fivetran/compare/v1.2.10...HEAD)
## [Unreleased](https://github.com/fivetran/terraform-provider-fivetran/compare/v1.3.0...HEAD)

## [1.3.0](https://github.com/fivetran/terraform-provider-fivetran/compare/v1.2.10...v1.3.0)

## Added
- New resource `fivetran_dbt_git_project_config` to support the new flow for installing a public key in a Git repository (see the migration guide and the guide to adding a key to an external repository).

New connection services supported:
- Supported service: `connector_sdk`
- Supported service: `criteo_retail_media`
- Supported service: `ehr`
- Supported service: `google_classroom`
- Supported service: `jama_software`
- Supported service: `okendo`
- Supported service: `oncehub`
- Supported service: `placerai`
- Supported service: `planhat`
- Supported service: `podio`
- Supported service: `procore`
- Supported service: `safebase`
- Supported service: `shipnetwork`
- Supported service: `visma`
- Supported service: `zonka_feedback`

## [1.2.10](https://github.com/fivetran/terraform-provider-fivetran/compare/v1.2.9...v1.2.10)

Expand Down
Empty file removed destination-services-changelog.txt
Empty file.
402 changes: 368 additions & 34 deletions docs/data-sources/connector.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/data-sources/dbt_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ Read-Only:

Read-Only:

- `folder_path` (String) Folder in Git repo with your dbt project.
- `git_branch` (String) Git branch.
- `git_remote_url` (String) Git remote URL with your dbt project.
- `folder_path` (String) Folder in Git repo with your dbt project
- `git_branch` (String) Git branch
- `git_remote_url` (String) Git remote URL with your dbt project
47 changes: 33 additions & 14 deletions docs/data-sources/destination.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ Read-Only:
- `auth` (String) Field usage depends on `service` value:
- Service `snowflake`: Password-based or key-based authentication type
- `auth_type` (String) Field usage depends on `service` value:
- Service `databricks`: Authentication type
- Service `redshift`: Authentication type. Default value: `PASSWORD`.
- `bootstrap_servers` (Set of String)
- `bootstrap_servers` (Set of String) Field usage depends on `service` value:
- Service `confluent_cloud_wh`: Comma-separated list of Confluent Cloud servers in the `server:port` format.
- `bucket` (String) Field usage depends on `service` value:
- Service `big_query`: Customer bucket. If specified, your GCS bucket will be used to process the data instead of a Fivetran-managed bucket. The bucket must be present in the same location as the dataset location.
- Service `big_query_dts`: Customer bucket. If specified, your GCS bucket will be used to process the data instead of a Fivetran-managed bucket. The bucket must be present in the same location as the dataset location.
Expand Down Expand Up @@ -111,7 +113,8 @@ Read-Only:
- `controller_id` (String)
- `create_external_tables` (Boolean) Field usage depends on `service` value:
- Service `databricks`: Whether to create external tables
- `data_format` (String)
- `data_format` (String) Field usage depends on `service` value:
- Service `confluent_cloud_wh`: Confluent Cloud message format.
- `data_set_location` (String) Field usage depends on `service` value:
- Service `big_query`: Data location. Datasets will reside in this location.
- Service `big_query_dts`: Data location. Datasets will reside in this location.
Expand Down Expand Up @@ -179,11 +182,12 @@ Read-Only:
- `lakehouse_name` (String) Field usage depends on `service` value:
- Service `onelake`: Name of your lakehouse
- `msk_sts_region` (String)
- `num_of_partitions` (Number)
- `num_of_partitions` (Number) Field usage depends on `service` value:
- Service `confluent_cloud_wh`: Number of partitions per topic.
- `oauth2_client_id` (String) Field usage depends on `service` value:
- Service `databricks`: OAuth 2.0 client ID. Required if auth_type is set to OAUTH2.
- Service `databricks`: OAuth 2.0 client ID
- `oauth2_secret` (String, Sensitive) Field usage depends on `service` value:
- Service `databricks`: OAuth 2.0 secret. Required if auth_type is set to OAUTH2.
- Service `databricks`: OAuth 2.0 secret
- `passphrase` (String, Sensitive) Field usage depends on `service` value:
- Service `snowflake`: In case private key is encrypted, you are required to enter passphrase that was used to encrypt the private key. The field can be specified if authentication type is `KEY_PAIR`.
- `password` (String, Sensitive) Field usage depends on `service` value:
Expand Down Expand Up @@ -260,7 +264,8 @@ Read-Only:
- Service `new_s3_datalake`: Region of your AWS S3 bucket
- `registry_name` (String)
- `registry_sts_region` (String)
- `replication_factor` (Number)
- `replication_factor` (Number) Field usage depends on `service` value:
- Service `confluent_cloud_wh`: Replication factor.
- `resource_id` (String) Field usage depends on `service` value:
- Service `aurora_postgres_warehouse`: This field is currently being introduced to test the Self-serve Private Link functionality
- Service `aurora_warehouse`: This field is currently being introduced to test the Self-serve Private Link functionality
Expand All @@ -286,29 +291,43 @@ Read-Only:
- Service `snowflake`: If not specified, Fivetran will use the user's default role
- `role_arn` (String, Sensitive) Field usage depends on `service` value:
- Service `redshift`: Role ARN with Redshift permissions. Required if authentication type is `IAM`.
- `sasl_mechanism` (String)
- `sasl_plain_key` (String, Sensitive)
- `sasl_plain_secret` (String, Sensitive)
- `sasl_mechanism` (String) Field usage depends on `service` value:
- Service `confluent_cloud_wh`: Security protocol for Confluent Cloud interaction.
- `sasl_plain_key` (String, Sensitive) Field usage depends on `service` value:
- Service `confluent_cloud_wh`: Confluent Cloud SASL key.
- `sasl_plain_secret` (String, Sensitive) Field usage depends on `service` value:
- Service `confluent_cloud_wh`: Confluent Cloud SASL secret.
- `schema_compatibility` (String)
- `schema_registry` (String)
- `schema_registry_api_key` (String, Sensitive)
- `schema_registry_api_secret` (String, Sensitive)
- `schema_registry_url` (String)
- `schema_registry` (String) Field usage depends on `service` value:
- Service `confluent_cloud_wh`: Schema Registry
- `schema_registry_api_key` (String, Sensitive) Field usage depends on `service` value:
- Service `confluent_cloud_wh`: Schema registry API key.
- `schema_registry_api_secret` (String, Sensitive) Field usage depends on `service` value:
- Service `confluent_cloud_wh`: Schema registry API secret.
- `schema_registry_url` (String) Field usage depends on `service` value:
- Service `confluent_cloud_wh`: Schema registry URL.
- `secret_key` (String, Sensitive) Field usage depends on `service` value:
- Service `big_query`: Private key of the customer service account. If specified, your service account will be used to process the data instead of the Fivetran-managed service account.
- Service `big_query_dts`: Private key of the customer service account. If specified, your service account will be used to process the data instead of the Fivetran-managed service account.
- Service `managed_big_query`: Private key of the customer service account. If specified, your service account will be used to process the data instead of the Fivetran-managed service account.
- `secret_value` (String, Sensitive) Field usage depends on `service` value:
- Service `adls`: Secret value for service principal
- Service `onelake`: Secret value for service principal
- `security_protocol` (String)
- `security_protocol` (String) Field usage depends on `service` value:
- Service `confluent_cloud_wh`: Security protocol for Confluent Cloud interaction.
- `server_host_name` (String) Field usage depends on `service` value:
- Service `databricks`: Server name
- `snapshot_retention_period` (String) Field usage depends on `service` value:
- Service `adls`: Snapshots older than the retention period are deleted every week. Default value: `ONE_WEEK`.
- Service `new_s3_datalake`: Snapshots older than the retention period are deleted every week. Default value: `ONE_WEEK`.
- Service `onelake`: Snapshots older than the retention period are deleted every week. Default value: `ONE_WEEK`.
- `snowflake_cloud` (String)
- `snowflake_region` (String)
- `storage_account_name` (String) Field usage depends on `service` value:
- Service `adls`: Storage account for Azure Data Lake Storage Gen2 name
- Service `onelake`: Storage account for Azure Data Lake Storage Gen2 name
- `table_format` (String) Field usage depends on `service` value:
- Service `new_s3_datalake`: (Immutable) The table format in which you want to sync your tables. Valid values are ICEBERG and DELTA_LAKE
- `tenant_id` (String) Field usage depends on `service` value:
- Service `adls`: Tenant id of service principal
- Service `onelake`: Tenant ID of service principal
Expand Down
34 changes: 17 additions & 17 deletions docs/guides/dbt_private_git_deploy_key.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,43 @@ subcategory: "Getting Started"

# How to set up a dbt Project with private Git Repo.

To be able to use private dbt Progect Git repository you have to grant Fivetran access to this repo.
To do that you need to add a Deploy Key to your repository. To get SSH key from Fivetran use `fivetran_group_ssh_key` datasource:
To be able to use private dbt Project Git repository you have to grant Fivetran access to this repo.
To do that you need to add a Deploy Key to your repository.
To get SSH key from Fivetran create `fivetran_dbt_project` resource:

```hcl
resource "fivetran_group" "my_group" {
name = "My_Group"
}
data "fivetran_group_ssh_key" "my_group_public_key" {
id = fivetran_group.my_group.id
resource "fivetran_dbt_project" "project" {
group_id = fivetran_group.my_group.id
dbt_version = "1.3.2"
threads = 1
default_schema = "your_project_default_schema"
type = "GIT"
}
```

Then you need to set up the group SSH key as a deploy key into your repo using [GitHub Provider Repository Deploy Key Resource](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository_deploy_key):
Then you need to set up the dbt Project public key (field `public_key` in created resource) as a deploy key into your repo using [GitHub Provider Repository Deploy Key Resource](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository_deploy_key):

```hcl
resource "github_repository_deploy_key" "example_repository_deploy_key" {
title = "Repository test key"
repository = "your-repo"
key = data.fivetran_group_ssh_key.my_group_public_key.public_key
key = fivetran_dbt_project.project.public_key
read_only = true
}
```

And after that you can configure your project:
And after that you can configure your project in `fivetran_dbt_git_project_config` resource:

```hcl
resource "fivetran_dbt_project" "project" {
group_id = fivetran_group.my_group.id
dbt_version = "1.3.2"
threads = 1
default_schema = "your_project_default_schema"
type = "GIT"
project_config {
git_remote_url = "[email protected]:your-repo.git"
git_branch = "main"
}
resource "fivetran_dbt_git_project_config" "project_config" {
id = fivetran_dbt_project.project.id
git_remote_url = "[email protected]:your-repo.git"
git_branch = "main"
}
```

91 changes: 91 additions & 0 deletions docs/guides/version_1.3.0_update_guides.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
----
page_title: "Version Update 1.3.0"
subcategory: "Upgrade Guides"
---

# Version 1.3.0

## What's new in 1.3.0

In version `1.3.0` of Fivetran Terraform provider, resource `fivetran_dbt_project` behavior changed:
- installation of the DBT project configuration should now occur in a separate resource `fivetran_dbt_git_project_config`, after installing the key in the repository

## Migration guide

### Provider

Update your provider configuration in the following way:

Previous configuration:

```hcl
required_providers {
fivetran = {
version = "~> 1.2.8"
source = "fivetran/fivetran"
}
}
```

Updated configuration:

```hcl
required_providers {
fivetran = {
version = ">= 1.3.0"
source = "fivetran/fivetran"
}
}
```

### Resource `fivetran_dbt_project`

Update all your connector schema config resources (`fivetran_dbt_project`):

Previous configuration:

```hcl
resource "fivetran_dbt_project" "test_project" {
provider = fivetran-provider
group_id = fivetran_destination.test_destination.id
dbt_version = "1.0.1"
threads = 1
default_schema = "dbt_demo_test_e2e_terraform"
type = "GIT"
project_config {
folder_path = "/folder/path"
git_remote_url = "[email protected]:fivetran/dbt_demo.git"
git_branch = "main"
}
}
```

Updated configuration:

```hcl
resource "fivetran_dbt_project" "test_project" {
provider = fivetran-provider
group_id = fivetran_destination.test_destination.id
dbt_version = "1.0.1"
threads = 1
default_schema = "dbt_demo_test_e2e_terraform"
type = "GIT"
}
resource "fivetran_dbt_git_project_config" "test_project_config" {
id = fivetran_dbt_project.test_project.id
folder_path = "/folder/path"
git_remote_url = "[email protected]:fivetran/dbt_demo.git"
git_branch = "main"
}
```

### Update terraform state

Once all configurations have been updated, run:

```
terraform init -upgrade
```
Loading

0 comments on commit efdb4c5

Please sign in to comment.