Skip to content

Commit e27dee0

Browse files
authored
fix(warehouse): transactional credentials drift changes (#85)
* fix(warehouse): transactional credentials drift changes * fix(warehouse): transactional - database name updatable
1 parent fd7aad4 commit e27dee0

File tree

5 files changed

+208
-72
lines changed

5 files changed

+208
-72
lines changed

internal/warehouse/bigquery_warehouse.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ type BigQueryWarehouseResource struct {
3838

3939
// BigQueryWarehouseResourceModel describes the resource data model according to its Schema.
4040
type BigQueryWarehouseResourceModel struct {
41-
Uuid types.String `tfsdk:"uuid"`
42-
Credentials Credentials `tfsdk:"credentials"`
43-
Name types.String `tfsdk:"name"`
44-
CollectorUuid types.String `tfsdk:"collector_uuid"`
45-
DeletionProtection types.Bool `tfsdk:"deletion_protection"`
41+
Uuid types.String `tfsdk:"uuid"`
42+
Credentials BqCredentials `tfsdk:"credentials"`
43+
Name types.String `tfsdk:"name"`
44+
CollectorUuid types.String `tfsdk:"collector_uuid"`
45+
DeletionProtection types.Bool `tfsdk:"deletion_protection"`
4646
}
4747

48-
type Credentials struct {
48+
type BqCredentials struct {
4949
ConnectionUuid types.String `tfsdk:"connection_uuid"`
5050
ServiceAccountKey types.String `tfsdk:"service_account_key"`
5151
UpdatedAt types.String `tfsdk:"updated_at"`
@@ -75,7 +75,7 @@ func (r *BigQueryWarehouseResource) Metadata(ctx context.Context, req resource.M
7575

7676
func (r *BigQueryWarehouseResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
7777
resp.Schema = schema.Schema{
78-
Version: 1,
78+
Version: 2,
7979
Attributes: map[string]schema.Attribute{
8080
"uuid": schema.StringAttribute{
8181
Computed: true,
@@ -495,7 +495,7 @@ func (r *BigQueryWarehouseResource) UpgradeState(ctx context.Context) map[int64]
495495
CollectorUuid: priorStateData.CollectorUuid,
496496
Name: priorStateData.Name,
497497
DeletionProtection: priorStateData.DeletionProtection,
498-
Credentials: Credentials{
498+
Credentials: BqCredentials{
499499
ConnectionUuid: priorStateData.ConnectionUuid,
500500
ServiceAccountKey: priorStateData.ServiceAccountKey,
501501
UpdatedAt: types.StringNull(),

internal/warehouse/testdata/TestAccTransactionalWarehouseResource/create.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ resource "montecarlo_transactional_warehouse" "test" {
3939
db_type = "POSTGRES" # POSTGRES | MYSQL | SQL-SERVER
4040
deletion_protection = false
4141

42-
configuration = {
42+
credentials = {
4343
host = var.pg_host
4444
port = var.pg_port
4545
database = var.pg_database

internal/warehouse/testdata/TestAccTransactionalWarehouseResource/update.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ resource "montecarlo_transactional_warehouse" "test" {
3939
db_type = "POSTGRES" # POSTGRES | MYSQL | SQL-SERVER
4040
deletion_protection = false
4141

42-
configuration = {
42+
credentials = {
4343
host = var.pg_host
4444
port = var.pg_port
4545
database = var.pg_database

0 commit comments

Comments
 (0)