diff --git a/CHANGELOG.md b/CHANGELOG.md index 01fb4413..1e348e68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/docs/resources/bigquery_connection.md b/docs/resources/bigquery_connection.md index 99985b63..69eb62bc 100644 --- a/docs/resources/bigquery_connection.md +++ b/docs/resources/bigquery_connection.md @@ -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" } ``` diff --git a/docs/resources/environment.md b/docs/resources/environment.md index c29e6f80..9a3b3c2e 100644 --- a/docs/resources/environment.md +++ b/docs/resources/environment.md @@ -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 diff --git a/examples/resources/dbtcloud_bigquery_connection/resource.tf b/examples/resources/dbtcloud_bigquery_connection/resource.tf index 11d40b2d..ca3c02dc 100644 --- a/examples/resources/dbtcloud_bigquery_connection/resource.tf +++ b/examples/resources/dbtcloud_bigquery_connection/resource.tf @@ -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" } diff --git a/pkg/sdkv2/resources/bigquery_connection.go b/pkg/sdkv2/resources/bigquery_connection.go index 7886af5b..cbbe7d77 100644 --- a/pkg/sdkv2/resources/bigquery_connection.go +++ b/pkg/sdkv2/resources/bigquery_connection.go @@ -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{ @@ -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 @@ -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 @@ -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] @@ -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) diff --git a/pkg/sdkv2/resources/connection.go b/pkg/sdkv2/resources/connection.go index 3c647e02..a6fc9302 100644 --- a/pkg/sdkv2/resources/connection.go +++ b/pkg/sdkv2/resources/connection.go @@ -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{ diff --git a/pkg/sdkv2/resources/environment.go b/pkg/sdkv2/resources/environment.go index 8ea04630..3ce31e88 100644 --- a/pkg/sdkv2/resources/environment.go +++ b/pkg/sdkv2/resources/environment.go @@ -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,