Skip to content

Commit

Permalink
Merge pull request #156 from nevill/set-hostname
Browse files Browse the repository at this point in the history
Feature request: Set hostname as well when creating an instance
  • Loading branch information
runzexia authored Sep 17, 2018
2 parents 6776ec1 + ccf4bf1 commit a614d45
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions qingcloud/resource_qingcloud_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package qingcloud

import (
"fmt"

"github.com/hashicorp/terraform/helper/schema"
qc "github.com/yunify/qingcloud-sdk-go/service"
)
Expand Down Expand Up @@ -136,6 +137,7 @@ func resourceQingcloudInstanceCreate(d *schema.ResourceData, meta interface{}) e
clt := meta.(*QingCloudClient).instance
input := new(qc.RunInstancesInput)
input.Count = qc.Int(1)
input.Hostname, _ = getNamePointer(d)
input.InstanceName, _ = getNamePointer(d)
input.ImageID = getSetStringPointer(d, resourceInstanceImageID)
input.CPU = qc.Int(d.Get(resourceInstanceCPU).(int))
Expand Down

0 comments on commit a614d45

Please sign in to comment.