Skip to content

Commit 679ad7d

Browse files
committed
feat: add masked flag to VDB provisioning
1 parent f464351 commit 679ad7d

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

GNUmakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ build:
1313

1414
release:
1515
GOOS=darwin GOARCH=amd64 go build -o ./bin/${BINARY}_${VERSION}_darwin_amd64
16+
GOOS=darwin GOARCH=arm64 go build -o ./bin/${BINARY}_${VERSION}_darwin_arm64
1617
GOOS=freebsd GOARCH=386 go build -o ./bin/${BINARY}_${VERSION}_freebsd_386
1718
GOOS=freebsd GOARCH=amd64 go build -o ./bin/${BINARY}_${VERSION}_freebsd_amd64
1819
GOOS=freebsd GOARCH=arm go build -o ./bin/${BINARY}_${VERSION}_freebsd_arm

internal/provider/resource_vdb.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ package provider
33
import (
44
"context"
55
"encoding/json"
6-
"github.com/hashicorp/terraform-plugin-log/tflog"
76
"net/http"
87
"time"
98

109
dctapi "github.com/delphix/dct-sdk-go/v14"
10+
"github.com/hashicorp/terraform-plugin-log/tflog"
1111
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
1212
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1313
)
@@ -519,6 +519,10 @@ func resourceVdb() *schema.Resource {
519519
Type: schema.TypeBool,
520520
Optional: true,
521521
},
522+
"masked": {
523+
Type: schema.TypeBool,
524+
Optional: true,
525+
},
522526
"listener_ids": {
523527
Type: schema.TypeList,
524528
Optional: true,
@@ -861,6 +865,9 @@ func helper_provision_by_snapshot(ctx context.Context, d *schema.ResourceData, m
861865
if v, has_v := d.GetOkExists("new_dbid"); has_v {
862866
provisionVDBBySnapshotParameters.SetNewDbid(v.(bool))
863867
}
868+
if v, has_v := d.GetOkExists("masked"); has_v {
869+
provisionVDBBySnapshotParameters.SetMasked(v.(bool))
870+
}
864871
if v, has_v := d.GetOkExists("listener_ids"); has_v {
865872
provisionVDBBySnapshotParameters.SetListenerIds(toStringArray(v))
866873
}
@@ -1099,6 +1106,9 @@ func helper_provision_by_timestamp(ctx context.Context, d *schema.ResourceData,
10991106
if v, has_v := d.GetOkExists("new_dbid"); has_v {
11001107
provisionVDBByTimestampParameters.SetNewDbid(v.(bool))
11011108
}
1109+
if v, has_v := d.GetOkExists("masked"); has_v {
1110+
provisionVDBByTimestampParameters.SetMasked(v.(bool))
1111+
}
11021112
if v, has_v := d.GetOk("listener_ids"); has_v {
11031113
provisionVDBByTimestampParameters.SetListenerIds(toStringArray(v))
11041114
}
@@ -1340,6 +1350,9 @@ func helper_provision_by_bookmark(ctx context.Context, d *schema.ResourceData, m
13401350
if v, has_v := d.GetOkExists("new_dbid"); has_v {
13411351
provisionVDBFromBookmarkParameters.SetNewDbid(v.(bool))
13421352
}
1353+
if v, has_v := d.GetOkExists("masked"); has_v {
1354+
provisionVDBFromBookmarkParameters.SetMasked(v.(bool))
1355+
}
13431356
if v, has_v := d.GetOk("listener_ids"); has_v {
13441357
provisionVDBFromBookmarkParameters.SetListenerIds(toStringArray(v))
13451358
}
@@ -1549,7 +1562,6 @@ func resourceVdbRead(ctx context.Context, d *schema.ResourceData, meta interface
15491562
config_params, _ := json.Marshal(result.GetConfigParams())
15501563
d.Set("config_params", string(config_params))
15511564
d.Set("additional_mount_points", flattenAdditionalMountPoints(result.GetAdditionalMountPoints()))
1552-
15531565
d.Set("id", vdbId)
15541566

15551567
return diags

0 commit comments

Comments
 (0)