Skip to content

Commit ae6d421

Browse files
committed
Add support for restoring volumes from a volume backup. Closes #294
1 parent 2d95f85 commit ae6d421

File tree

3 files changed

+9
-28
lines changed

3 files changed

+9
-28
lines changed

core/volume_resource.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ func VolumeResource() *schema.Resource {
4343
Type: schema.TypeString,
4444
Computed: true,
4545
},
46+
"volume_backup_id": {
47+
Type: schema.TypeString,
48+
Optional: true,
49+
ForceNew: true,
50+
},
4651
"time_created": {
4752
Type: schema.TypeString,
4853
Computed: true,

core/volume_resource_crud.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ func (s *VolumeResourceCrud) Create() (e error) {
5050
if ok {
5151
opts.SizeInMBs = sizeInMBs.(int)
5252
}
53+
volumeBackupID, ok := s.D.GetOk("volume_backup_id")
54+
if ok {
55+
opts.VolumeBackupID = volumeBackupID.(string)
56+
}
5357

5458
s.Res, e = s.Client.CreateVolume(availabilityDomain, compartmentID, opts)
5559

docs/resources/core/group.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)