Skip to content

Commit

Permalink
Merge pull request #225 from dbt-labs/release-0.2.16
Browse files Browse the repository at this point in the history
Release 0.2.16
  • Loading branch information
b-per authored Nov 22, 2023
2 parents 91f9fa8 + 118604a commit d16c272
Show file tree
Hide file tree
Showing 53 changed files with 1,291 additions and 457 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@

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

## [Unreleased](https://github.com/dbt-labs/terraform-provider-dbtcloud/compare/v0.2.15...HEAD)
## [Unreleased](https://github.com/dbt-labs/terraform-provider-dbtcloud/compare/v0.2.16...HEAD)

## [0.2.16](https://github.com/dbt-labs/terraform-provider-dbtcloud/compare/v0.2.15...v0.2.16)

## Changes

- #99 - add the resource `environment_variable_job_override` to allow environment variable override in jobs
- Update the go version and packages versions

## Fixes

- #221 - removing the value for an env var scope was not removing it in dbt Cloud
- add better messages and error handling for jobs

## [0.2.15](https://github.com/dbt-labs/terraform-provider-dbtcloud/compare/v0.2.14...v0.2.15)

Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ deps:
release:
git tag "v$(VERSION)"
git push origin "v$(VERSION)"

d2doc:
d2 terraform_resources.d2 terraform_resources.png -l elk
2 changes: 0 additions & 2 deletions docs/data-sources/azure_dev_ops_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,3 @@ data "dbtcloud_azure_dev_ops_project" "my_ado_project" {

- `id` (String) The internal Azure Dev Ops ID of the ADO Project
- `url` (String) The URL of the ADO project


2 changes: 0 additions & 2 deletions docs/data-sources/azure_dev_ops_repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,3 @@ data "dbtcloud_azure_dev_ops_repository" "my_ado_repository" {
- `id` (String) The internal Azure Dev Ops ID of the ADO Repository
- `remote_url` (String) The HTTP URL of the ADO repository used to connect to dbt Cloud
- `web_url` (String) The URL of the ADO repository accessible in the browser


2 changes: 0 additions & 2 deletions docs/data-sources/bigquery_connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,3 @@ description: |-
- `timeout_seconds` (Number) Timeout in seconds for queries
- `token_uri` (String) Token URI for the Service Account
- `type` (String) The type of connection


2 changes: 0 additions & 2 deletions docs/data-sources/bigquery_credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,3 @@ description: |-
- `id` (String) The ID of this resource.
- `is_active` (Boolean) Whether the BigQuery credential is active
- `num_threads` (Number) Number of threads to use


2 changes: 0 additions & 2 deletions docs/data-sources/connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,3 @@ description: |-
- `role` (String) Role name for the connection
- `type` (String) Connection type
- `warehouse` (String) Warehouse name for the connection


2 changes: 0 additions & 2 deletions docs/data-sources/databricks_credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,3 @@ description: |-
- `num_threads` (Number) Number of threads to use
- `schema` (String) The schema where to create models
- `target_name` (String) Target name


2 changes: 0 additions & 2 deletions docs/data-sources/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,3 @@ description: |-
- `name` (String) Environment name
- `type` (String) The type of environment (must be either development or deployment)
- `use_custom_branch` (Boolean) Whether to use a custom git branch in this environment


2 changes: 0 additions & 2 deletions docs/data-sources/environment_variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,3 @@ description: |-

- `environment_values` (Map of String) Map containing the environment variables
- `id` (String) The ID of this resource.


2 changes: 0 additions & 2 deletions docs/data-sources/extended_attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,3 @@ data "dbtcloud_extended_attributes" "my_extended_attributes" {
- `extended_attributes` (String) A JSON string listing the extended attributes mapping
- `id` (String) The ID of this resource.
- `state` (Number) The state of the extended attributes (1 = active, 2 = inactive)


2 changes: 0 additions & 2 deletions docs/data-sources/group.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,3 @@ description: |-
- `is_active` (Boolean) Whether the group is active
- `name` (String) Group name
- `sso_mapping_groups` (List of String) SSO mapping group names for this group


2 changes: 0 additions & 2 deletions docs/data-sources/group_users.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,3 @@ Read-Only:

- `email` (String)
- `id` (Number)


2 changes: 0 additions & 2 deletions docs/data-sources/job.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,3 @@ description: |-
- `timeout_seconds` (Number) Number of seconds before the job times out
- `triggers` (Map of Boolean) Flags for which types of triggers to use, keys of github_webhook, git_provider_webhook, schedule, custom_branch_only
- `triggers_on_draft_pr` (Boolean) Whether the CI job should be automatically triggered on draft PRs


2 changes: 0 additions & 2 deletions docs/data-sources/notification.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,3 @@ data "dbtcloud_notification" "my_notification" {
- `on_failure` (Set of Number) List of job IDs to trigger the webhook on failure
- `on_success` (Set of Number) List of job IDs to trigger the webhook on success
- `user_id` (Number) Internal dbt Cloud User ID. Must be the user_id for an existing user even if the notification is an external one


2 changes: 0 additions & 2 deletions docs/data-sources/postgres_credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ description: |-
- `is_active` (Boolean) Whether the Postgres credential is active
- `num_threads` (Number) Number of threads to use
- `username` (String) Username for Postgres


2 changes: 0 additions & 2 deletions docs/data-sources/privatelink_endpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,3 @@ data "dbtcloud_privatelink_endpoint" "test_with_name_and_url" {
- `id` (String) The internal ID of the PrivateLink Endpoint
- `state` (Number) PrivatelinkEndpoint state should be 1 = active, as 2 = deleted
- `type` (String) Type of the PrivateLink Endpoint


2 changes: 0 additions & 2 deletions docs/data-sources/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,3 @@ data "dbtcloud_project" "test_project" {
- `id` (String) The ID of this resource.
- `repository_id` (Number) ID of the repository associated with the project
- `state` (Number) Project state should be 1 = active, as 2 = deleted


2 changes: 0 additions & 2 deletions docs/data-sources/repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,3 @@ description: |-
- `is_active` (Boolean) Whether the repository is active
- `remote_url` (String) Connection name
- `repository_credentials_id` (Number) Credentials ID for the repository (From the repository side not the dbt Cloud ID)


2 changes: 0 additions & 2 deletions docs/data-sources/service_token.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,3 @@ Read-Only:
- `all_projects` (Boolean)
- `permission_set` (String)
- `project_id` (Number)


2 changes: 0 additions & 2 deletions docs/data-sources/snowflake_credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,3 @@ description: |-
- `num_threads` (Number) Number of threads to use
- `schema` (String) Default schema name
- `user` (String) Username for Snowflake


2 changes: 0 additions & 2 deletions docs/data-sources/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,3 @@ data "dbtcloud_user" "my_user" {
### Read-Only

- `id` (Number) ID of the user


2 changes: 0 additions & 2 deletions docs/data-sources/user_groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,3 @@ data "dbtcloud_user_groups" "my_user_groups" {

- `group_ids` (Set of Number) IDs of the groups assigned to the user
- `id` (String) The ID of this resource.


2 changes: 0 additions & 2 deletions docs/data-sources/webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@ description: |-
- `id` (String) The ID of this resource.
- `job_ids` (List of Number) List of job IDs to trigger the webhook
- `name` (String) Webhooks Name


10 changes: 5 additions & 5 deletions docs/resources/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ resource "dbtcloud_environment" "prod_environment" {
credential_id = dbtcloud_snowflake_credential.prod_credential.credential_id
deployment_type = "production"
}
// Creating a development environment
resource "dbtcloud_environment" "dev_environment" {
dbt_version = "1.6.0-latest"
name = "Dev"
project_id = dbtcloud_project.dbt_project.id
type = "development"
dbt_version = "1.6.0-latest"
name = "Dev"
project_id = dbtcloud_project.dbt_project.id
type = "development"
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/environment_variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ resource "dbtcloud_environment_variable" "dbt_my_env_var" {
"project" : "my_project_level_value",
"Dev" : "my_env_level_value",
"CI" : "my_ci_override_value",
"Prod" "my_prod_override_value"
"Prod" : "my_prod_override_value"
}
depends_on = [
dbtcloud_project.dbt_project,
Expand Down
47 changes: 47 additions & 0 deletions docs/resources/environment_variable_job_override.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
page_title: "dbtcloud_environment_variable_job_override Resource - dbtcloud"
subcategory: ""
description: |-
---

# dbtcloud_environment_variable_job_override (Resource)




## Example Usage

```terraform
resource "dbtcloud_environment_variable_job_override" "my_env_var_job_override" {
name = dbtcloud_environment_variable.dbt_my_env_var.name
project_id = dbtcloud_project.dbt_project.id
job_definition_id = dbtcloud_job.daily_job.id
raw_value = "my_override_value"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `job_definition_id` (Number) The job ID for which the environment variable is being overridden
- `name` (String) The environment variable name to override
- `project_id` (Number) The project ID for which the environment variable is being overridden
- `raw_value` (String) The value for the override of the environment variable

### Read-Only

- `environment_variable_job_override_id` (Number) The ID of the environment variable job override
- `id` (String) The ID of this resource.

## Import

Import is supported using the following syntax:

```shell
# Import using a project ID, a job ID and the environment variable override ID
terraform import dbtcloud_environment_variable_job_override.test_environment_variable_job_override "project_id:job_id:environment_variable_override_id"
terraform import dbtcloud_environment_variable_job_override.test_environment_variable_job_override 12345:678:123456
```
2 changes: 1 addition & 1 deletion docs/resources/extended_attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ resource "dbtcloud_extended_attributes" "my_attributes" {
project_id = var.dbt_project.id
}
resource dbtcloud_environment issue_depl {
resource "dbtcloud_environment" "issue_depl" {
dbt_version = "1.6.0-latest"
name = "My environment"
project_id = var.dbt_project.id
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/job.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ resource "dbtcloud_job" "daily_job" {
"schedule" : true
}
# this is the default that gets set up when modifying jobs in the UI
schedule_days = [0, 1, 2, 3, 4, 5, 6]
schedule_type = "days_of_week"
schedule_days = [0, 1, 2, 3, 4, 5, 6]
schedule_type = "days_of_week"
schedule_hours = [0]
}
Expand Down
6 changes: 3 additions & 3 deletions docs/resources/license_map.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ description: |-
```terraform
# Developer license group mapping
resource "dbtcloud_license_map" "dev_license_map" {
license_type = "developer"
license_type = "developer"
sso_license_mapping_groups = ["DEV-SSO-GROUP"]
}
# Read-only license mapping
resource "dbtcloud_license_map" "read_only_license_map" {
license_type = "read_only"
license_type = "read_only"
sso_license_mapping_groups = ["READ-ONLY-SSO-GROUP"]
}
# IT license mapping
resource "dbtcloud_license_map" "it_license_map" {
license_type = "it"
license_type = "it"
sso_license_mapping_groups = ["IT-SSO-GROUP"]
}
```
Expand Down
10 changes: 5 additions & 5 deletions docs/resources/user_groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ If you would like a different behavior, please open an issue on GitHub. To remov
```terraform
// we can assign groups to users
resource "dbtcloud_user_groups" "my_user_groups" {
user_id = dbtcloud_user.my_user.id
group_ids = [
user_id = dbtcloud_user.my_user.id
group_ids = [
// the group_id can be written directly
1234,
// or we can refer to a group created by Terraform
dbtcloud_group.my_group.id,
// or we can use a local variable (see the guide on how to use the HTTP provider)
local.my_group_id,
]
]
}
// as Delete is not handled currently, by design, removing all groups from a user can be done with
resource "dbtcloud_user_groups" "my_other_user_groups" {
user_id = 123456
group_ids = []
user_id = 123456
group_ids = []
}
```

Expand Down
10 changes: 5 additions & 5 deletions examples/resources/dbtcloud_environment/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ resource "dbtcloud_environment" "prod_environment" {
credential_id = dbtcloud_snowflake_credential.prod_credential.credential_id
deployment_type = "production"
}

// Creating a development environment
resource "dbtcloud_environment" "dev_environment" {
dbt_version = "1.6.0-latest"
name = "Dev"
project_id = dbtcloud_project.dbt_project.id
type = "development"
dbt_version = "1.6.0-latest"
name = "Dev"
project_id = dbtcloud_project.dbt_project.id
type = "development"
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resource "dbtcloud_environment_variable" "dbt_my_env_var" {
"project" : "my_project_level_value",
"Dev" : "my_env_level_value",
"CI" : "my_ci_override_value",
"Prod" "my_prod_override_value"
"Prod" : "my_prod_override_value"
}
depends_on = [
dbtcloud_project.dbt_project,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Import using a project ID, a job ID and the environment variable override ID
terraform import dbtcloud_environment_variable_job_override.test_environment_variable_job_override "project_id:job_id:environment_variable_override_id"
terraform import dbtcloud_environment_variable_job_override.test_environment_variable_job_override 12345:678:123456
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "dbtcloud_environment_variable_job_override" "my_env_var_job_override" {
name = dbtcloud_environment_variable.dbt_my_env_var.name
project_id = dbtcloud_project.dbt_project.id
job_definition_id = dbtcloud_job.daily_job.id
raw_value = "my_override_value"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ resource "dbtcloud_extended_attributes" "my_attributes" {
project_id = var.dbt_project.id
}

resource dbtcloud_environment issue_depl {
resource "dbtcloud_environment" "issue_depl" {
dbt_version = "1.6.0-latest"
name = "My environment"
project_id = var.dbt_project.id
Expand Down
4 changes: 2 additions & 2 deletions examples/resources/dbtcloud_job/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ resource "dbtcloud_job" "daily_job" {
"schedule" : true
}
# this is the default that gets set up when modifying jobs in the UI
schedule_days = [0, 1, 2, 3, 4, 5, 6]
schedule_type = "days_of_week"
schedule_days = [0, 1, 2, 3, 4, 5, 6]
schedule_type = "days_of_week"
schedule_hours = [0]
}

Expand Down
6 changes: 3 additions & 3 deletions examples/resources/dbtcloud_license_map/resource.tf
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Developer license group mapping
resource "dbtcloud_license_map" "dev_license_map" {
license_type = "developer"
license_type = "developer"
sso_license_mapping_groups = ["DEV-SSO-GROUP"]
}

# Read-only license mapping
resource "dbtcloud_license_map" "read_only_license_map" {
license_type = "read_only"
license_type = "read_only"
sso_license_mapping_groups = ["READ-ONLY-SSO-GROUP"]
}

# IT license mapping
resource "dbtcloud_license_map" "it_license_map" {
license_type = "it"
license_type = "it"
sso_license_mapping_groups = ["IT-SSO-GROUP"]
}
Loading

0 comments on commit d16c272

Please sign in to comment.