-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support new DBT Git Project Creation Flow (#347)
- Loading branch information
1 parent
2de7c32
commit efdb4c5
Showing
37 changed files
with
8,824 additions
and
5,812 deletions.
There are no files selected for viewing
This file contains 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
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -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" | ||
} | ||
``` | ||
|
This file contains 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,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 | ||
``` |
Oops, something went wrong.