Skip to content

Commit

Permalink
vultr: allow auto_backups for instances
Browse files Browse the repository at this point in the history
This commit enables using the `auto_backups` feature on new Vultr
instances.

Addresses: #45
  • Loading branch information
squat committed Sep 24, 2018
1 parent f9f30cf commit c4d4280
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions vultr/resource_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ func resourceInstance() *schema.Resource {
Optional: true,
},

"auto_backups": {
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
},

"cost_per_month": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -198,6 +204,7 @@ func resourceInstanceCreate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*Client)
options := &lib.ServerOptions{
AppID: d.Get("application_id").(string),
AutoBackups: d.Get("auto_backups").(bool),
FirewallGroupID: d.Get("firewall_group_id").(string),
Hostname: d.Get("hostname").(string),
IPV6: d.Get("ipv6").(bool),
Expand Down Expand Up @@ -297,6 +304,7 @@ func resourceInstanceRead(d *schema.ResourceData, meta interface{}) error {
}

d.Set("application_id", instance.AppID)
d.Set("auto_backups", instance.AutoBackups)
d.Set("cost_per_month", instance.Cost)
d.Set("default_password", instance.DefaultPassword)
d.Set("disk", instance.Disk)
Expand Down

0 comments on commit c4d4280

Please sign in to comment.