Skip to content

Commit

Permalink
Merge pull request #272 from dbt-labs/release-0.3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
b-per authored Jul 8, 2024
2 parents 3e0d3ba + 6cd7200 commit 0e3fee8
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 9 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@

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

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

## [0.3.9](https://github.com/dbt-labs/terraform-provider-dbtcloud/compare/v0.3.8...v0.3.9)

### Fixes

- [#271](https://github.com/dbt-labs/terraform-provider-dbtcloud/issues/271) Force creation of a new connection when the project is changed or deleted

### Docs

- Fix typo in environment code example

## [0.3.8](https://github.com/dbt-labs/terraform-provider-dbtcloud/compare/v0.3.7...v0.3.8)

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/bigquery_connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ resource "dbtcloud_bigquery_connection" "my_connection_with_oauth" {
auth_provider_x509_cert_url = "my_auth_provider_x509_cert_url"
client_x509_cert_url = "my_client_x509_cert_url"
retries = 3
appplication_id = "oauth_application_id"
application_id = "oauth_application_id"
application_secret = "oauth_secret_id"
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ resource "dbtcloud_environment" "dev_environment" {

- `credential_id` (Number) Credential ID to create the environment with. A credential is not required for development environments but is required for deployment environments
- `custom_branch` (String) Which custom branch to use in this environment
- `deployment_type` (String) The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to 'production'
- `deployment_type` (String) The type of environment. Only valid for environments of type 'deployment' and for now can only be 'production', 'staging' or left empty for generic environments
- `extended_attributes_id` (Number) ID of the extended attributes for the environment
- `is_active` (Boolean) Whether the environment is active
- `use_custom_branch` (Boolean) Whether to use a custom git branch in this environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ resource "dbtcloud_bigquery_connection" "my_connection_with_oauth" {
auth_provider_x509_cert_url = "my_auth_provider_x509_cert_url"
client_x509_cert_url = "my_client_x509_cert_url"
retries = 3
appplication_id = "oauth_application_id"
application_id = "oauth_application_id"
application_secret = "oauth_secret_id"
}
25 changes: 21 additions & 4 deletions pkg/sdkv2/resources/bigquery_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func ResourceBigQueryConnection() *schema.Resource {
"project_id": &schema.Schema{
Type: schema.TypeInt,
Required: true,
ForceNew: true,
Description: "Project ID to create the connection in",
},
"name": &schema.Schema{
Expand Down Expand Up @@ -172,7 +173,11 @@ func ResourceBigQueryConnection() *schema.Resource {
}
}

func resourceBigQueryConnectionCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
func resourceBigQueryConnectionCreate(
ctx context.Context,
d *schema.ResourceData,
m interface{},
) diag.Diagnostics {
c := m.(*dbt_cloud.Client)

var diags diag.Diagnostics
Expand Down Expand Up @@ -292,7 +297,11 @@ func resourceBigQueryConnectionCreate(ctx context.Context, d *schema.ResourceDat
return diags
}

func resourceBigQueryConnectionRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
func resourceBigQueryConnectionRead(
ctx context.Context,
d *schema.ResourceData,
m interface{},
) diag.Diagnostics {
c := m.(*dbt_cloud.Client)

var diags diag.Diagnostics
Expand Down Expand Up @@ -385,7 +394,11 @@ func resourceBigQueryConnectionRead(ctx context.Context, d *schema.ResourceData,
return diags
}

func resourceBigQueryConnectionUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
func resourceBigQueryConnectionUpdate(
ctx context.Context,
d *schema.ResourceData,
m interface{},
) diag.Diagnostics {
c := m.(*dbt_cloud.Client)

projectIdString := strings.Split(d.Id(), dbt_cloud.ID_DELIMITER)[0]
Expand Down Expand Up @@ -548,7 +561,11 @@ func resourceBigQueryConnectionUpdate(ctx context.Context, d *schema.ResourceDat
return resourceBigQueryConnectionRead(ctx, d, m)
}

func resourceBigQueryConnectionDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
func resourceBigQueryConnectionDelete(
ctx context.Context,
d *schema.ResourceData,
m interface{},
) diag.Diagnostics {

return resourceConnectionDelete(ctx, d, m)

Expand Down
1 change: 1 addition & 0 deletions pkg/sdkv2/resources/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func ResourceConnection() *schema.Resource {
"project_id": &schema.Schema{
Type: schema.TypeInt,
Required: true,
ForceNew: true,
Description: "Project ID to create the connection in",
},
"name": &schema.Schema{
Expand Down
2 changes: 1 addition & 1 deletion pkg/sdkv2/resources/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func ResourceEnvironment() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Default: "",
Description: "The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to 'production'",
Description: "The type of environment. Only valid for environments of type 'deployment' and for now can only be 'production', 'staging' or left empty for generic environments",
},
"environment_id": &schema.Schema{
Type: schema.TypeInt,
Expand Down

0 comments on commit 0e3fee8

Please sign in to comment.