Skip to content

Commit 50068f5

Browse files
authored
Merge pull request #253 from dbt-labs/release-0.3.1
2 parents 40a0432 + d1a05de commit 50068f5

File tree

46 files changed

+227
-149
lines changed

Some content is hidden

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

46 files changed

+227
-149
lines changed

CHANGELOG.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
## [Unreleased](https://github.com/dbt-labs/terraform-provider-dbtcloud/compare/v0.3.0...HEAD)
5+
## [Unreleased](https://github.com/dbt-labs/terraform-provider-dbtcloud/compare/v0.3.1...HEAD)
6+
7+
## [0.3.1](https://github.com/dbt-labs/terraform-provider-dbtcloud/compare/v0.3.0...v0.3.1)
8+
9+
## Changes
10+
11+
- Add `on_merge` trigger for jobs. The trigger is optional for now but will be required in the future.
12+
13+
## Documentation
14+
15+
- Remove mention of `dbt_cloud_xxx` resources in the docs
616

717
## [0.3.0](https://github.com/dbt-labs/terraform-provider-dbtcloud/compare/v0.2.25...v0.3.0)
818

docs/data-sources/job.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ description: |-
3131
- `name` (String) Given name for the job
3232
- `self_deferring` (Boolean) Whether this job defers on a previous run of itself (overrides value in deferring_job_id)
3333
- `timeout_seconds` (Number) Number of seconds before the job times out
34-
- `triggers` (Map of Boolean) Flags for which types of triggers to use, keys of github_webhook, git_provider_webhook, schedule, custom_branch_only
34+
- `triggers` (Map of Boolean) Flags for which types of triggers to use, keys of github_webhook, git_provider_webhook, schedule, on_merge
3535
- `triggers_on_draft_pr` (Boolean) Whether the CI job should be automatically triggered on draft PRs
3636

3737
<a id="nestedatt--job_completion_trigger_condition"></a>

docs/resources/bigquery_connection.md

-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ Resource to create BigQuery connections in dbt Cloud. Can be set to use OAuth fo
1313
## Example Usage
1414

1515
```terraform
16-
// NOTE for customers using the LEGACY dbt_cloud provider:
17-
// use dbt_cloud_bigquery_connection instead of dbtcloud_bigquery_connection for the legacy resource names
18-
// legacy names will be removed from 0.3 onwards
19-
2016
resource "dbtcloud_bigquery_connection" "my_connection" {
2117
project_id = dbtcloud_project.dbt_project.id
2218
name = "Project Name"

docs/resources/bigquery_credential.md

-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ description: |-
1313
## Example Usage
1414

1515
```terraform
16-
// NOTE for customers using the LEGACY dbt_cloud provider:
17-
// use dbt_cloud_bigquery_credential instead of dbtcloud_bigquery_credential for the legacy resource names
18-
// legacy names will be removed from 0.3 onwards
19-
2016
resource "dbtcloud_bigquery_credential" "my_credential" {
2117
project_id = dbtcloud_project.dbt_project.id
2218
dataset = "my_bq_dataset"

docs/resources/connection.md

-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ For BigQuery, due to the list of fields being very different, you can use the `d
1818
## Example Usage
1919

2020
```terraform
21-
// NOTE for customers using the LEGACY dbt_cloud provider:
22-
// use dbt_cloud_connection instead of dbtcloud_connection for the legacy resource names
23-
// legacy names will be removed from 0.3 onwards
24-
2521
resource "dbtcloud_connection" "databricks" {
2622
project_id = dbtcloud_project.dbt_project.id
2723
type = "adapter"

docs/resources/databricks_credential.md

-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ description: |-
1313
## Example Usage
1414

1515
```terraform
16-
// NOTE for customers using the LEGACY dbt_cloud provider:
17-
// use dbt_cloud_databricks_credential instead of dbtcloud_databricks_credential for the legacy resource names
18-
// legacy names will be removed from 0.3 onwards
19-
2016
# when using the Databricks adapter
2117
resource "dbtcloud_databricks_credential" "my_databricks_cred" {
2218
project_id = dbtcloud_project.dbt_project.id

docs/resources/environment.md

-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ description: |-
1313
## Example Usage
1414

1515
```terraform
16-
// NOTE for customers using the LEGACY dbt_cloud provider:
17-
// use dbt_cloud_environment instead of dbtcloud_environment for the legacy resource names
18-
// legacy names will be removed from 0.3 onwards
19-
2016
resource "dbtcloud_environment" "ci_environment" {
2117
// the dbt_version is major.minor.0-latest , major.minor.0-pre or versionless (Beta on 15 Feb 2024, to always be on the latest dbt version)
2218
dbt_version = "1.6.0-latest"

docs/resources/environment_variable.md

-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ the same time as the environment variables, it's recommended to use the `depends
1313
## Example Usage
1414

1515
```terraform
16-
// NOTE for customers using the LEGACY dbt_cloud provider:
17-
// use dbt_cloud_environment_variable instead of dbtcloud_environment_variable for the legacy resource names
18-
// legacy names will be removed from 0.3 onwards
19-
2016
resource "dbtcloud_environment_variable" "dbt_my_env_var" {
2117
name = "DBT_MY_ENV_VAR"
2218
project_id = dbtcloud_project.dbt_project.id

docs/resources/extended_attributes.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
page_title: "dbtcloud_extended_attributes Resource - dbtcloud"
33
subcategory: ""
44
description: |-
5-
This resource allows setting extended attributes which can be assigned to a given environment (see docs https://docs.getdbt.com/docs/dbt-cloud-environments#extended-attributes-beta).In dbt Cloud those values are provided as YML but in the provider they need to be provided as JSON (see example below).
5+
This resource allows setting extended attributes which can be assigned to a given environment (see docs https://docs.getdbt.com/docs/dbt-cloud-environments#extended-attributes).In dbt Cloud those values are provided as YML but in the provider they need to be provided as JSON (see example below).
66
---
77

88
# dbtcloud_extended_attributes (Resource)
99

1010

11-
This resource allows setting extended attributes which can be assigned to a given environment ([see docs](https://docs.getdbt.com/docs/dbt-cloud-environments#extended-attributes-beta)).<br/><br/>In dbt Cloud those values are provided as YML but in the provider they need to be provided as JSON (see example below).
11+
This resource allows setting extended attributes which can be assigned to a given environment ([see docs](https://docs.getdbt.com/docs/dbt-cloud-environments#extended-attributes)).<br/><br/>In dbt Cloud those values are provided as YML but in the provider they need to be provided as JSON (see example below).
1212

1313
## Example Usage
1414

docs/resources/group.md

-4
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ The mapping of permission names [from the docs](https://docs.getdbt.com/docs/clo
3939
## Example Usage
4040

4141
```terraform
42-
// NOTE for customers using the LEGACY dbt_cloud provider:
43-
// use dbt_cloud_group instead of dbtcloud_group for the legacy resource names
44-
// legacy names will be removed from 0.3 onwards
45-
4642
resource "dbtcloud_group" "tf_group_1" {
4743
name = "TF Group 1"
4844
group_permissions {

docs/resources/job.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ description: |-
77

88
# dbtcloud_job (Resource)
99

10-
~> As of October 2023, CI improvements have been rolled out to dbt Cloud with minor impacts to some jobs: [more info](https://docs.getdbt.com/docs/dbt-versions/release-notes/june-2023/ci-updates-phase1-rn).
10+
~> In October 2023, CI improvements have been rolled out to dbt Cloud with minor impacts to some jobs: [more info](https://docs.getdbt.com/docs/dbt-versions/release-notes/june-2023/ci-updates-phase1-rn).
1111
<br/>
1212
<br/>
1313
Those improvements include modifications to deferral which was historically set at the job level and will now be set at the environment level.
1414
Deferral can still be set to "self" by setting `self_deferring` to `true` but with the new approach, deferral to other runs need to be done with `deferring_environment_id` instead of `deferring_job_id`.
1515

16+
~> New with 0.3.1, `triggers` now accepts a `on_merge` value to trigger jobs when code is merged in git. If `on_merge` is `true` all other triggers need to be `false`.
17+
<br/>
18+
<br/>
19+
For now, it is not a mandatory field, but it will be in a future version. Please add `on_merge` in your config or modules.
1620

1721
## Example Usage
1822

1923
```terraform
20-
// NOTE for customers using the LEGACY dbt_cloud provider:
21-
// use dbt_cloud_job instead of dbtcloud_job for the legacy resource names
22-
// legacy names will be removed from 0.3 onwards
23-
2424
# a job that has github_webhook and git_provider_webhook
2525
# set to false will be categorized as a "Deploy Job"
2626
resource "dbtcloud_job" "daily_job" {
@@ -39,6 +39,7 @@ resource "dbtcloud_job" "daily_job" {
3939
"github_webhook" : false,
4040
"git_provider_webhook" : false,
4141
"schedule" : true
42+
"on_merge" : false
4243
}
4344
# this is the default that gets set up when modifying jobs in the UI
4445
schedule_days = [0, 1, 2, 3, 4, 5, 6]
@@ -64,6 +65,7 @@ resource "dbtcloud_job" "ci_job" {
6465
"github_webhook" : true,
6566
"git_provider_webhook" : true,
6667
"schedule" : false
68+
"on_merge" : false
6769
}
6870
# this is the default that gets set up when modifying jobs in the UI
6971
# this is not going to be used when schedule is set to false
@@ -87,6 +89,7 @@ resource "dbtcloud_job" "downstream_job" {
8789
"github_webhook" : false,
8890
"git_provider_webhook" : false,
8991
"schedule" : false
92+
"on_merge" : false
9093
}
9194
schedule_days = [0, 1, 2, 3, 4, 5, 6]
9295
schedule_type = "days_of_week"
@@ -107,7 +110,7 @@ resource "dbtcloud_job" "downstream_job" {
107110
- `execute_steps` (List of String) List of commands to execute for the job
108111
- `name` (String) Job name
109112
- `project_id` (Number) Project ID to create the job in
110-
- `triggers` (Map of Boolean) Flags for which types of triggers to use, the values are `github_webhook`, `git_provider_webhook`, and `schedule`. <br>`custom_branch_only` used to be allowed but has been deprecated from the API. The jobs will use the custom branch of the environment. Please remove the `custom_branch_only` from your config. <br>To create a job in a 'deactivated' state, set all to `false`.
113+
- `triggers` (Map of Boolean) Flags for which types of triggers to use, the values are `github_webhook`, `git_provider_webhook`, `schedule` and `on_merge`. All flags should be listed and set with `true` or `false`. When `on_merge` is `true`, all the other values must be false.<br>`custom_branch_only` used to be allowed but has been deprecated from the API. The jobs will use the custom branch of the environment. Please remove the `custom_branch_only` from your config. <br>To create a job in a 'deactivated' state, set all to `false`.
111114

112115
### Optional
113116

docs/resources/notification.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ Setup notifications on jobs success/failure to internal users, external email ad
1414

1515
```terraform
1616
// dbt Cloud allows us to create internal and external notifications
17-
17+
//
1818
// an internal notification will send emails to the user mentioned in `user_id`
1919
//
2020
// NOTE: If internal notification settings already exist for a user, currently you MUST import
2121
// those first into the state file before you can create a new internal notification for that user.
2222
// Failure to do so, will result in the user losing access to existing notifications and dbt
2323
// support will need to be contacted to restore access.
2424
// cmd: terraform import dbtcloud_notification.prod_job_internal_notification <user_id>
25+
2526
resource "dbtcloud_notification" "prod_job_internal_notification" {
2627
// user_id is the internal ID of a given user in dbt Cloud
2728
user_id = 100

docs/resources/postgres_credential.md

-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ description: |-
1313
## Example Usage
1414

1515
```terraform
16-
// NOTE for customers using the LEGACY dbt_cloud provider:
17-
// use dbt_cloud_postgres_credential instead of dbtcloud_postgres_credential for the legacy resource names
18-
// legacy names will be removed from 0.3 onwards
19-
2016
resource "dbtcloud_postgres_credential" "postgres_prod_credential" {
2117
is_active = true
2218
project_id = dbtcloud_project.dbt_project.id

docs/resources/project.md

-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ description: |-
1313
## Example Usage
1414

1515
```terraform
16-
// NOTE for customers using the LEGACY dbt_cloud provider:
17-
// use dbt_cloud_project instead of dbtcloud_project for the legacy resource names
18-
// legacy names will be removed from 0.3 onwards
19-
2016
resource "dbtcloud_project" "dbt_project" {
2117
name = "Analytics"
2218
}

docs/resources/project_artefacts.md

-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ description: |-
1313
## Example Usage
1414

1515
```terraform
16-
// NOTE for customers using the LEGACY dbt_cloud provider:
17-
// use dbt_cloud_project_artefacts instead of dbtcloud_project_artefacts for the legacy resource names
18-
// legacy names will be removed from 0.3 onwards
19-
2016
resource "dbtcloud_project_artefacts" "my_project_artefacts" {
2117
project_id = dbtcloud_project.dbt_project.id
2218
docs_job_id = dbtcloud_job.prod_job.id

docs/resources/project_connection.md

-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ description: |-
1313
## Example Usage
1414

1515
```terraform
16-
// NOTE for customers using the LEGACY dbt_cloud provider:
17-
// use dbt_cloud_project_connection instead of dbtcloud_project_connection for the legacy resource names
18-
// legacy names will be removed from 0.3 onwards
19-
2016
resource "dbtcloud_project_connection" "dbt_project_connection" {
2117
project_id = dbtcloud_project.dbt_project.id
2218
connection_id = dbtcloud_connection.dbt_connection.connection_id

docs/resources/project_repository.md

-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ This resource allows you to link a dbt Cloud project to a git repository.
1313
## Example Usage
1414

1515
```terraform
16-
// NOTE for customers using the LEGACY dbt_cloud provider:
17-
// use dbt_cloud_project_repository instead of dbtcloud_project_repository for the legacy resource names
18-
// legacy names will be removed from 0.3 onwards
19-
2016
resource "dbtcloud_project_repository" "dbt_project_repository" {
2117
project_id = dbtcloud_project.dbt_project.id
2218
repository_id = dbtcloud_repository.dbt_repository.repository_id

docs/resources/repository.md

-5
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ value of `id` or use the `http` provider to retrieve it automatically like in t
2626
## Example Usage
2727

2828
```terraform
29-
// NOTE for customers using the LEGACY dbt_cloud provider:
30-
// use dbt_cloud_repository instead of dbtcloud_repository for the legacy resource names
31-
// legacy names will be removed from 0.3 onwards
32-
33-
3429
### repo cloned via the GitHub integration, manually entering the `github_installation_id`
3530
resource "dbtcloud_repository" "github_repo" {
3631
project_id = dbtcloud_project.dbt_project.id

docs/resources/service_token.md

-4
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ The mapping of permission names [from the docs](https://docs.getdbt.com/docs/clo
3939
## Example Usage
4040

4141
```terraform
42-
// NOTE for customers using the LEGACY dbt_cloud provider:
43-
// use dbt_cloud_service_token instead of dbtcloud_service_token for the legacy resource names
44-
// legacy names will be removed from 0.3 onwards
45-
4642
resource "dbtcloud_service_token" "test_service_token" {
4743
name = "Test Service Token"
4844
service_token_permissions {

docs/resources/snowflake_credential.md

-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ description: |-
1313
## Example Usage
1414

1515
```terraform
16-
// NOTE for customers using the LEGACY dbt_cloud provider:
17-
// use dbt_cloud_snowflake_credential instead of dbtcloud_snowflake_credential for the legacy resource names
18-
// legacy names will be removed from 0.3 onwards
19-
2016
resource "dbtcloud_snowflake_credential" "prod_credential" {
2117
project_id = data.dbtcloud_project.dbt_project.id
2218
auth_type = "password"

docs/resources/webhook.md

-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ description: |-
1313
## Example Usage
1414

1515
```terraform
16-
// NOTE for customers using the LEGACY dbt_cloud provider:
17-
// use dbt_cloud_webhook instead of dbtcloud_webhook for the legacy resource names
18-
// legacy names will be removed from 0.3 onwards
19-
2016
resource "dbtcloud_webhook" "test_webhook" {
2117
name = "test-webhook"
2218
description = "Test webhook"

examples/resources/dbtcloud_bigquery_connection/resource.tf

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
// NOTE for customers using the LEGACY dbt_cloud provider:
2-
// use dbt_cloud_bigquery_connection instead of dbtcloud_bigquery_connection for the legacy resource names
3-
// legacy names will be removed from 0.3 onwards
4-
51
resource "dbtcloud_bigquery_connection" "my_connection" {
62
project_id = dbtcloud_project.dbt_project.id
73
name = "Project Name"

examples/resources/dbtcloud_bigquery_credential/resource.tf

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
// NOTE for customers using the LEGACY dbt_cloud provider:
2-
// use dbt_cloud_bigquery_credential instead of dbtcloud_bigquery_credential for the legacy resource names
3-
// legacy names will be removed from 0.3 onwards
4-
51
resource "dbtcloud_bigquery_credential" "my_credential" {
62
project_id = dbtcloud_project.dbt_project.id
73
dataset = "my_bq_dataset"

examples/resources/dbtcloud_connection/resource.tf

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
// NOTE for customers using the LEGACY dbt_cloud provider:
2-
// use dbt_cloud_connection instead of dbtcloud_connection for the legacy resource names
3-
// legacy names will be removed from 0.3 onwards
4-
51
resource "dbtcloud_connection" "databricks" {
62
project_id = dbtcloud_project.dbt_project.id
73
type = "adapter"

examples/resources/dbtcloud_databricks_credential/resource.tf

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
// NOTE for customers using the LEGACY dbt_cloud provider:
2-
// use dbt_cloud_databricks_credential instead of dbtcloud_databricks_credential for the legacy resource names
3-
// legacy names will be removed from 0.3 onwards
4-
51
# when using the Databricks adapter
62
resource "dbtcloud_databricks_credential" "my_databricks_cred" {
73
project_id = dbtcloud_project.dbt_project.id

examples/resources/dbtcloud_environment/resource.tf

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
// NOTE for customers using the LEGACY dbt_cloud provider:
2-
// use dbt_cloud_environment instead of dbtcloud_environment for the legacy resource names
3-
// legacy names will be removed from 0.3 onwards
4-
51
resource "dbtcloud_environment" "ci_environment" {
62
// the dbt_version is major.minor.0-latest , major.minor.0-pre or versionless (Beta on 15 Feb 2024, to always be on the latest dbt version)
73
dbt_version = "1.6.0-latest"

examples/resources/dbtcloud_environment_variable/resource.tf

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
// NOTE for customers using the LEGACY dbt_cloud provider:
2-
// use dbt_cloud_environment_variable instead of dbtcloud_environment_variable for the legacy resource names
3-
// legacy names will be removed from 0.3 onwards
4-
51
resource "dbtcloud_environment_variable" "dbt_my_env_var" {
62
name = "DBT_MY_ENV_VAR"
73
project_id = dbtcloud_project.dbt_project.id

examples/resources/dbtcloud_group/resource.tf

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
// NOTE for customers using the LEGACY dbt_cloud provider:
2-
// use dbt_cloud_group instead of dbtcloud_group for the legacy resource names
3-
// legacy names will be removed from 0.3 onwards
4-
51
resource "dbtcloud_group" "tf_group_1" {
62
name = "TF Group 1"
73
group_permissions {

examples/resources/dbtcloud_job/resource.tf

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
// NOTE for customers using the LEGACY dbt_cloud provider:
2-
// use dbt_cloud_job instead of dbtcloud_job for the legacy resource names
3-
// legacy names will be removed from 0.3 onwards
4-
51
# a job that has github_webhook and git_provider_webhook
62
# set to false will be categorized as a "Deploy Job"
73
resource "dbtcloud_job" "daily_job" {
@@ -20,6 +16,7 @@ resource "dbtcloud_job" "daily_job" {
2016
"github_webhook" : false,
2117
"git_provider_webhook" : false,
2218
"schedule" : true
19+
"on_merge" : false
2320
}
2421
# this is the default that gets set up when modifying jobs in the UI
2522
schedule_days = [0, 1, 2, 3, 4, 5, 6]
@@ -45,6 +42,7 @@ resource "dbtcloud_job" "ci_job" {
4542
"github_webhook" : true,
4643
"git_provider_webhook" : true,
4744
"schedule" : false
45+
"on_merge" : false
4846
}
4947
# this is the default that gets set up when modifying jobs in the UI
5048
# this is not going to be used when schedule is set to false
@@ -68,6 +66,7 @@ resource "dbtcloud_job" "downstream_job" {
6866
"github_webhook" : false,
6967
"git_provider_webhook" : false,
7068
"schedule" : false
69+
"on_merge" : false
7170
}
7271
schedule_days = [0, 1, 2, 3, 4, 5, 6]
7372
schedule_type = "days_of_week"

examples/resources/dbtcloud_notification/resource.tf

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// dbt Cloud allows us to create internal and external notifications
2-
2+
//
33
// an internal notification will send emails to the user mentioned in `user_id`
44
//
55
// NOTE: If internal notification settings already exist for a user, currently you MUST import
66
// those first into the state file before you can create a new internal notification for that user.
77
// Failure to do so, will result in the user losing access to existing notifications and dbt
88
// support will need to be contacted to restore access.
99
// cmd: terraform import dbtcloud_notification.prod_job_internal_notification <user_id>
10+
1011
resource "dbtcloud_notification" "prod_job_internal_notification" {
1112
// user_id is the internal ID of a given user in dbt Cloud
1213
user_id = 100

0 commit comments

Comments
 (0)