Skip to content

Commit d1e245c

Browse files
authored
Merge pull request #150 from dbt-labs/update-authentication
Update authentication and rename docs
2 parents 5c83023 + cd6592f commit d1e245c

File tree

99 files changed

+229
-147
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+229
-147
lines changed

.github/workflows/unit.yml

+1
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ jobs:
3232
env:
3333
DBT_CLOUD_ACCOUNT_ID: ${{ secrets.TEST_DBT_CLOUD_ACCOUNT_ID }}
3434
DBT_CLOUD_TOKEN: ${{ secrets.TEST_DBT_CLOUD_TOKEN }}
35+
DBT_CLOUD_HOST_URL: ${{ secrets.TEST_DBT_CLOUD_HOST_URL }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
vendor/
33
terraform-provider*
44
.idea
5+
.vscode

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
NAME=dbt-cloud
1+
NAME=dbtcloud
22
VERSION=$(shell cat VERSION)
33
BINARY=terraform-provider-$(NAME)_v$(VERSION)
44

README.md

+24-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
1-
# terraform-provider-dbt-cloud
2-
Terraform Provider for dbt Cloud
1+
# terraform-provider-dbtcloud
2+
3+
## Terraform Provider for dbt Cloud
4+
5+
This repo was originally created by a dbt community member, Gary James [[GtheSheep](https://github.com/GtheSheep)]
6+
7+
| If you are still using the GtheSheep/dbt-cloud source, see [Upgrading from the community Provider](UPGRADING_PROVIDER.md) to upgrade to the latest version.
8+
9+
## Scope
10+
11+
Provide the ability to manage dbt Cloud projects and account settings via Terraform resources.
12+
Data sources are also available for most resources.
313

4-
Primarily focused on managing jobs in dbt Cloud, given what
5-
is available via the API.
6-
Data sources for other concepts are added for convenience.
714
In order to use this provider, add the following to your Terraform providers
815
setup, with the latest version number.
16+
917
```terraform
1018
terraform {
1119
required_providers {
1220
dbt = {
13-
source = "GtheSheep/dbt-cloud"
21+
source = "dbt-labs/dbtcloud"
1422
version = "<version>"
1523
}
1624
}
@@ -22,6 +30,7 @@ terraform {
2230
If you want to explicitly set the authentication variables on the provider, you
2331
can do so as below, though likely via a `variables.tf` file or config in your
2432
CI-CD pipeline to keep these credentials safe.
33+
2534
```terraform
2635
provider "dbt" {
2736
// required
@@ -30,16 +39,24 @@ provider "dbt" {
3039
host_url = "..."
3140
}
3241
```
42+
3343
You can also set them via environment variables:
3444
`DBT_CLOUD_ACCOUNT_ID` for the `account_id`.
3545
`DBT_CLOUD_TOKEN` for the `token`.
3646
`DBT_CLOUD_HOST_URL` (Optional) for the `host_url`.
3747

3848
## Examples
49+
3950
Check out the `examples/` folder for some usage options, these are intended to
4051
simply showcase what this module can do rather than be best practices for any
4152
given use case.
4253

4354
## Running Acceptance Tests
55+
4456
Currently, acceptance tests, run via `make test-acceptance` must be done on your
45-
own account, as there is no free tier of dbt Cloud that grants API access
57+
own account
58+
59+
## Acknowledgement
60+
61+
Thanks to Gary James [[GtheSheep](https://github.com/GtheSheep)], for all the effort put in creating this provier originally
62+
and for being a great dbt community member!

UPGRADING_PROVIDER.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Upgrading from the GtheSheep Provider
2+
3+
As of (6/14/2023) the provider has been transferred from the dbt community member Gary James [[GtheSheep](https://github.com/GtheSheep)] to dbt-labs.
4+
5+
To upgrade from the community provider to the dbt-labs one, please run the following command:
6+
7+
```shell
8+
terraform state replace-provider GtheSheep/dbt-cloud dbt-labs/dbtcloud
9+
```
10+
11+
You should also update your lock file / Terraform provider version pinning. From the deprecated source:
12+
13+
```hcl
14+
# deprecated source
15+
terraform {
16+
required_providers {
17+
dbt = {
18+
source = "GtheSheep/dbt-cloud"
19+
version = "0.1.11"
20+
}
21+
}
22+
}
23+
```
24+
25+
To new source:
26+
27+
```hcl
28+
# new source
29+
terraform {
30+
required_providers {
31+
dbt = {
32+
source = "dbt-labs/dbtcloud"
33+
version = "0.1.12"
34+
}
35+
}
36+
}
37+
```
38+
39+
To change version of the provider please also run the following command
40+
41+
```sh
42+
terraform init -upgrade
43+
```
44+
45+
>**Note**: 0.1.12 is the first version published after the transfer. For earlier versions, please continue using the GtheSheep/dbt-cloud source

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.11
1+
0.1.12

docs/data-sources/dbt_cloud_bigquery_connection.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_bigquery_connection Data Source - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_bigquery_connection Data Source - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/data-sources/dbt_cloud_bigquery_credential.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_bigquery_credential Data Source - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_bigquery_credential Data Source - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/data-sources/dbt_cloud_connection.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_connection Data Source - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_connection Data Source - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/data-sources/dbt_cloud_databricks_credential.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_databricks_credential Data Source - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_databricks_credential Data Source - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/data-sources/dbt_cloud_environment.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_environment Data Source - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_environment Data Source - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/data-sources/dbt_cloud_environment_variable.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_environment_variable Data Source - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_environment_variable Data Source - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/data-sources/dbt_cloud_group.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_group Data Source - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_group Data Source - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/data-sources/dbt_cloud_job.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_job Data Source - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_job Data Source - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/data-sources/dbt_cloud_postgres_credential.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_postgres_credential Data Source - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_postgres_credential Data Source - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/data-sources/dbt_cloud_privatelink_endpoint.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_privatelink_endpoint Data Source - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_privatelink_endpoint Data Source - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/data-sources/dbt_cloud_project.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_project Data Source - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_project Data Source - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/data-sources/dbt_cloud_repository.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_repository Data Source - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_repository Data Source - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66
@@ -26,13 +26,13 @@ description: |-
2626

2727
### Read-Only
2828

29-
- `deploy_key` (String) Public key generated by DBT when using `deploy_key` clone strategy
29+
- `deploy_key` (String) Public key generated by dbt when using `deploy_key` clone strategy
3030
- `git_clone_strategy` (String) Git clone strategy for the repository
3131
- `github_installation_id` (Number) Identifier for the GitHub installation
3232
- `gitlab_project_id` (Number) Identifier for the Gitlab project
3333
- `id` (String) The ID of this resource.
3434
- `is_active` (Boolean) Whether the repository is active
3535
- `remote_url` (String) Connection name
36-
- `repository_credentials_id` (Number) Credentials ID for the repository (From the repository side not the DBT Cloud ID)
36+
- `repository_credentials_id` (Number) Credentials ID for the repository (From the repository side not the dbt Cloud ID)
3737

3838

docs/data-sources/dbt_cloud_service_token.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_service_token Data Source - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_service_token Data Source - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/data-sources/dbt_cloud_snowflake_credential.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_snowflake_credential Data Source - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_snowflake_credential Data Source - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/data-sources/dbt_cloud_user.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_user Data Source - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_user Data Source - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/data-sources/dbt_cloud_webhook.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_webhook Data Source - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_webhook Data Source - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/index.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt-cloud Provider"
3+
page_title: "dbtcloud Provider"
44
subcategory: ""
55
description: |-
66
77
---
88

9-
# dbt-cloud Provider
9+
# dbtcloud Provider
1010

1111

1212

@@ -16,8 +16,8 @@ description: |-
1616
terraform {
1717
required_providers {
1818
dbt = {
19-
source = "GtheSheep/dbt-cloud"
20-
version = "0.1.0"
19+
source = "dbt-labs/dbtcloud"
20+
version = "0.1.12"
2121
}
2222
}
2323
}

docs/resources/dbt_cloud_bigquery_connection.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_bigquery_connection Resource - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_bigquery_connection Resource - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/resources/dbt_cloud_bigquery_credential.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_bigquery_credential Resource - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_bigquery_credential Resource - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/resources/dbt_cloud_connection.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_connection Resource - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_connection Resource - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/resources/dbt_cloud_databricks_credential.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_databricks_credential Resource - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_databricks_credential Resource - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/resources/dbt_cloud_environment.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_environment Resource - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_environment Resource - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66

docs/resources/dbt_cloud_group.md

+13
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,26 @@ resource "dbt_cloud_group" "test_group" {
4040
### Optional
4141
4242
- `assign_by_default` (Boolean) Whether or not to assign this group to users by default
43+
- `group_permissions` (Block Set) (see [below for nested schema](#nestedblock--group_permissions))
4344
- `is_active` (Boolean) Whether the group is active
4445
- `sso_mapping_groups` (List of String) SSO mapping group names for this group
4546
4647
### Read-Only
4748
4849
- `id` (String) The ID of this resource.
4950
51+
<a id="nestedblock--group_permissions"></a>
52+
### Nested Schema for `group_permissions`
53+
54+
Required:
55+
56+
- `all_projects` (Boolean) Whether or not to apply this permission to all projects for this group
57+
- `permission_set` (String) Set of permissions to apply
58+
59+
Optional:
60+
61+
- `project_id` (Number) Project ID to apply this permission to for this group
62+
5063
## Import
5164
5265
Import is supported using the following syntax:

docs/resources/dbt_cloud_job.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dbt_cloud_job Resource - terraform-provider-dbt-cloud"
3+
page_title: "dbt_cloud_job Resource - terraform-provider-dbtcloud"
44
subcategory: ""
55
description: |-
66
@@ -28,8 +28,12 @@ resource "dbt_cloud_job" "test" {
2828
triggers = {
2929
"custom_branch_only" : true,
3030
"github_webhook" : false,
31+
"git_provider_webhook" : false,
3132
"schedule" : false
3233
}
34+
# this is the default that gets set up when modifying jobs in the UI
35+
schedule_days = [0,1,2,3,4,5,6]
36+
schedule_type = "days_of_week"
3337
}
3438
```
3539

@@ -58,7 +62,7 @@ resource "dbt_cloud_job" "test" {
5862
- `schedule_interval` (Number) Number of hours between job executions if running on a schedule
5963
- `schedule_type` (String) Type of schedule to use, one of every_day/ days_of_week/ custom_cron
6064
- `self_deferring` (Boolean) Whether this job defers on a previous run of itself
61-
- `target_name` (String) Target name for the DBT profile
65+
- `target_name` (String) Target name for the dbt profile
6266
- `timeout_seconds` (Number) Number of seconds to allow the job to run before timing out
6367

6468
### Read-Only

0 commit comments

Comments
 (0)