Skip to content

Commit 9f0f23a

Browse files
author
Adam Bowen
committed
added option to snapshot source before provisioning
1 parent 42d6353 commit 9f0f23a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

resource_delphix_oracle_si_vdb.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type VDB struct {
1818
dbName string
1919
oracleHome string
2020
mountBase string
21+
snapSource bool
2122
}
2223

2324
func resourceDelphixOracleSIVDB() *schema.Resource {
@@ -63,6 +64,10 @@ func resourceDelphixOracleSIVDB() *schema.Resource {
6364
Required: true,
6465
ForceNew: true,
6566
},
67+
"snap_source": &schema.Schema{
68+
Type: schema.TypeBool,
69+
Optional: true,
70+
},
6671
},
6772
}
6873
}
@@ -92,6 +97,7 @@ func resourceDelphixOracleSIVDBCreate(d *schema.ResourceData, meta interface{})
9297
groupName: d.Get("group_name").(string),
9398
oracleHome: d.Get("oracle_home").(string),
9499
mountBase: d.Get("mount_base").(string),
100+
snapSource: d.Get("snap_source").(bool),
95101
}
96102

97103
vdbExists, err := client.FindDatabaseByName(vdb.name)
@@ -160,6 +166,13 @@ func resourceDelphixOracleSIVDBCreate(d *schema.ResourceData, meta interface{})
160166
Location: "LATEST_SNAPSHOT",
161167
},
162168
}
169+
170+
if vdb.snapSource == true {
171+
if err = client.SyncDatabase(vdb.source); err != nil {
172+
return err
173+
}
174+
}
175+
163176
reference, err = client.CreateDatabase(&oracleProvisionParameters)
164177
if err != nil {
165178
return err

0 commit comments

Comments
 (0)