Skip to content

Commit 5069fe2

Browse files
authored
Merge pull request #242 from dbt-labs/release-0.2.22
2 parents 86a5840 + 740d0d4 commit 5069fe2

28 files changed

+557
-247
lines changed

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,20 @@
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.2.21...HEAD)
5+
## [Unreleased](https://github.com/dbt-labs/terraform-provider-dbtcloud/compare/v0.2.22...HEAD)
6+
7+
## [0.2.22](https://github.com/dbt-labs/terraform-provider-dbtcloud/compare/v0.2.21...v0.2.22)
8+
9+
## Changes
10+
11+
- [#240](https://github.com/dbt-labs/terraform-provider-dbtcloud/issues/240) Add notice of deprecation for `triggers.custom_branch_only` for jobs and update logic to make it work even though people have it to true or false in their config. We might raise an error if the field is still there in the future.
12+
- Update diff calculation for Extended Attributes, allowing strings which are not set with `jsonencode()`
13+
- [#241](https://github.com/dbt-labs/terraform-provider-dbtcloud/issues/241) Force recreation of env vars when values change to work with the recent changes in the dbt Cloud API
14+
15+
## Documentation
16+
17+
- Add list of permission names and permission codes in the docs of the `service_token` and `group`
18+
- Add info in `dbtcloud_repository` about the need to also create a `dbtcloud_project_repository`
619

720
## [0.2.21](https://github.com/dbt-labs/terraform-provider-dbtcloud/compare/v0.2.20...v0.2.21)
821

docs/resources/group.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,34 @@ description: |-
77

88
# dbtcloud_group (Resource)
99

10-
*Note*: Groups currently do not support updates, as per both the API and the UI.
10+
The mapping of permission names [from the docs](https://docs.getdbt.com/docs/cloud/manage-access/enterprise-permissions) to the permissions to set in Terraform is the following:
11+
12+
|Permission name......... | Permission code|
13+
|-- | --|
14+
|Account Admin | account_admin|
15+
|Account Viewer | account_viewer|
16+
|Admin | admin|
17+
|Analyst | analyst|
18+
|Billing Admin | billing_admin|
19+
|Database Admin | database_admin|
20+
|Developer | developer|
21+
|Git Admin | git_admin|
22+
|Job Admin | job_admin|
23+
|Job Runner | job_runner|
24+
|Job Viewer | job_viewer|
25+
|Member | member|
26+
|Metadata Only | metadata_only|
27+
|Owner | owner|
28+
|Project Creator | project_creator|
29+
|Read-Only | readonly|
30+
|Security Admin | security_admin|
31+
|Semantic Layer Only | semantic_layer_only|
32+
|Stakeholder | stakeholder|
33+
|Team Admin | team_admin|
34+
|Webhooks Only | webhooks_only|
35+
36+
37+
1138

1239
## Example Usage
1340

docs/resources/job.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ description: |-
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-
~> As of beginning of February 2024, job chaining with `job_completion_trigger_condition` is in private beta and not available to all users.
17-
<br/>
18-
<br/>
19-
This notice will be removed once the feature is generally available.
20-
2116

2217
## Example Usage
2318

@@ -41,7 +36,6 @@ resource "dbtcloud_job" "daily_job" {
4136
run_generate_sources = true
4237
target_name = "default"
4338
triggers = {
44-
"custom_branch_only" : false,
4539
"github_webhook" : false,
4640
"git_provider_webhook" : false,
4741
"schedule" : true
@@ -67,7 +61,6 @@ resource "dbtcloud_job" "ci_job" {
6761
project_id = dbtcloud_project.dbt_project.id
6862
run_generate_sources = false
6963
triggers = {
70-
"custom_branch_only" : true,
7164
"github_webhook" : true,
7265
"git_provider_webhook" : true,
7366
"schedule" : false
@@ -91,7 +84,6 @@ resource "dbtcloud_job" "downstream_job" {
9184
project_id = dbtcloud_project.dbt_project2.id
9285
run_generate_sources = true
9386
triggers = {
94-
"custom_branch_only" : false,
9587
"github_webhook" : false,
9688
"git_provider_webhook" : false,
9789
"schedule" : false
@@ -115,7 +107,7 @@ resource "dbtcloud_job" "downstream_job" {
115107
- `execute_steps` (List of String) List of commands to execute for the job
116108
- `name` (String) Job name
117109
- `project_id` (Number) Project ID to create the job in
118-
- `triggers` (Map of Boolean) Flags for which types of triggers to use, the values are `github_webhook`, `git_provider_webhook`, `schedule` and `custom_branch_only`. <br>`custom_branch_only` is only relevant for CI jobs triggered automatically on PR creation to only trigger a job on a PR to the custom branch of the environment. To create a job in a 'deactivated' state, set all to `false`.
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`.
119111

120112
### Optional
121113

docs/resources/project_repository.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
page_title: "dbtcloud_project_repository Resource - dbtcloud"
33
subcategory: ""
44
description: |-
5-
5+
This resource allows you to link a dbt Cloud project to a git repository.
66
---
77

88
# dbtcloud_project_repository (Resource)
99

1010

11-
11+
This resource allows you to link a dbt Cloud project to a git repository.
1212

1313
## Example Usage
1414

docs/resources/repository.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ description: |-
77

88
# dbtcloud_repository (Resource)
99

10-
*Note*: Some upstream resources can be slow to create, so if creating a project at
11-
the same time as the repository, it's recommended to use the `depends_on` meta argument.
10+
This resource allows you to manage connections to git repositories in dbt Cloud.
11+
12+
By itself, this resource won't show you the repository in the dbt Cloud UI.
13+
You will need to also set up a [`dbtcloud_project_repository` resource](https://registry.terraform.io/providers/dbt-labs/dbtcloud/latest/docs/resources/project_repository) as well to link your dbt Cloud project and the git repository.
1214

1315
In order to find the `github_installation_id`, you can log in to dbt Cloud, replace `<dbt_cloud_url>` by your dbt Cloud
1416
URL and run the following commands in the Google Chrome console:

docs/resources/service_token.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,32 @@ description: |-
77

88
# dbtcloud_service_token (Resource)
99

10+
The mapping of permission names [from the docs](https://docs.getdbt.com/docs/cloud/manage-access/enterprise-permissions) to the permissions to set in Terraform is the following:
11+
12+
|Permission name......... | Permission code|
13+
|-- | --|
14+
|Account Admin | account_admin|
15+
|Account Viewer | account_viewer|
16+
|Admin | admin|
17+
|Analyst | analyst|
18+
|Billing Admin | billing_admin|
19+
|Database Admin | database_admin|
20+
|Developer | developer|
21+
|Git Admin | git_admin|
22+
|Job Admin | job_admin|
23+
|Job Runner | job_runner|
24+
|Job Viewer | job_viewer|
25+
|Member | member|
26+
|Metadata Only | metadata_only|
27+
|Owner | owner|
28+
|Project Creator | project_creator|
29+
|Read-Only | readonly|
30+
|Security Admin | security_admin|
31+
|Semantic Layer Only | semantic_layer_only|
32+
|Stakeholder | stakeholder|
33+
|Team Admin | team_admin|
34+
|Webhooks Only | webhooks_only|
35+
1036

1137

1238

@@ -29,9 +55,6 @@ resource "dbtcloud_service_token" "test_service_token" {
2955
project_id = dbtcloud_project.dbt_project.id
3056
}
3157
}
32-
33-
// permission_set accepts one of the following values:
34-
// "account_admin","admin","database_admin","git_admin","team_admin","job_admin","job_viewer","analyst","developer","stakeholder","readonly","project_creator","account_viewer","metadata_only"
3558
```
3659

3760
<!-- schema generated by tfplugindocs -->

examples/resources/dbtcloud_job/resource.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ resource "dbtcloud_job" "daily_job" {
1717
run_generate_sources = true
1818
target_name = "default"
1919
triggers = {
20-
"custom_branch_only" : false,
2120
"github_webhook" : false,
2221
"git_provider_webhook" : false,
2322
"schedule" : true
@@ -43,7 +42,6 @@ resource "dbtcloud_job" "ci_job" {
4342
project_id = dbtcloud_project.dbt_project.id
4443
run_generate_sources = false
4544
triggers = {
46-
"custom_branch_only" : true,
4745
"github_webhook" : true,
4846
"git_provider_webhook" : true,
4947
"schedule" : false
@@ -67,7 +65,6 @@ resource "dbtcloud_job" "downstream_job" {
6765
project_id = dbtcloud_project.dbt_project2.id
6866
run_generate_sources = true
6967
triggers = {
70-
"custom_branch_only" : false,
7168
"github_webhook" : false,
7269
"git_provider_webhook" : false,
7370
"schedule" : false

examples/resources/dbtcloud_service_token/resource.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,3 @@ resource "dbtcloud_service_token" "test_service_token" {
1414
project_id = dbtcloud_project.dbt_project.id
1515
}
1616
}
17-
18-
// permission_set accepts one of the following values:
19-
// "account_admin","admin","database_admin","git_admin","team_admin","job_admin","job_viewer","analyst","developer","stakeholder","readonly","project_creator","account_viewer","metadata_only"

pkg/data_sources/job_acceptance_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ func jobs(jobName string) string {
6060
"dbt run"
6161
]
6262
triggers = {
63-
"custom_branch_only" : false,
6463
"github_webhook" : false,
6564
"schedule" : false,
6665
"git_provider_webhook": false

pkg/data_sources/notification_acceptance_test.go

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,20 @@ func TestAccDbtCloudNotificationDataSource(t *testing.T) {
1515
config := notification(randomProjectName)
1616

1717
check := resource.ComposeTestCheckFunc(
18-
resource.TestCheckResourceAttr("data.dbtcloud_notification.test_notification_external", "notification_type", "4"),
19-
resource.TestCheckResourceAttrSet("data.dbtcloud_notification.test_notification_external", "on_failure.0"),
20-
resource.TestCheckResourceAttr("data.dbtcloud_notification.test_notification_external", "external_email", "[email protected]"),
18+
resource.TestCheckResourceAttr(
19+
"data.dbtcloud_notification.test_notification_external",
20+
"notification_type",
21+
"4",
22+
),
23+
resource.TestCheckResourceAttrSet(
24+
"data.dbtcloud_notification.test_notification_external",
25+
"on_failure.0",
26+
),
27+
resource.TestCheckResourceAttr(
28+
"data.dbtcloud_notification.test_notification_external",
29+
"external_email",
30+
31+
),
2132
)
2233

2334
resource.ParallelTest(t, resource.TestCase{
@@ -55,7 +66,6 @@ func notification(projectName string) string {
5566
"github_webhook" : false,
5667
"git_provider_webhook" : false,
5768
"schedule" : false,
58-
"custom_branch_only" : false,
5969
}
6070
}
6171

0 commit comments

Comments
 (0)