Merge pull request #2574 from hashicorp/b-aws-spot-request-touchup
provider/aws: Code cleanups for Spot Requests
This commit is contained in:
commit
4f2f9546c3
|
@ -95,6 +95,7 @@ func resourceAwsSpotInstanceRequestCreate(d *schema.ResourceData, meta interface
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make the spot instance request
|
// Make the spot instance request
|
||||||
|
log.Printf("[DEBUG] Requesting spot bid opts: %s", awsutil.StringValue(spotOpts))
|
||||||
resp, err := conn.RequestSpotInstances(spotOpts)
|
resp, err := conn.RequestSpotInstances(spotOpts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error requesting spot instances: %s", err)
|
return fmt.Errorf("Error requesting spot instances: %s", err)
|
||||||
|
@ -184,7 +185,7 @@ func resourceAwsSpotInstanceRequestUpdate(d *schema.ResourceData, meta interface
|
||||||
|
|
||||||
d.Partial(false)
|
d.Partial(false)
|
||||||
|
|
||||||
return resourceAwsInstanceRead(d, meta)
|
return resourceAwsSpotInstanceRequestRead(d, meta)
|
||||||
}
|
}
|
||||||
|
|
||||||
func resourceAwsSpotInstanceRequestDelete(d *schema.ResourceData, meta interface{}) error {
|
func resourceAwsSpotInstanceRequestDelete(d *schema.ResourceData, meta interface{}) error {
|
||||||
|
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
|
"github.com/aws/aws-sdk-go/aws/awsutil"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/hashicorp/terraform/helper/schema"
|
"github.com/hashicorp/terraform/helper/schema"
|
||||||
)
|
)
|
||||||
|
@ -38,7 +39,7 @@ func setTags(conn *ec2.EC2, d *schema.ResourceData) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(create) > 0 {
|
if len(create) > 0 {
|
||||||
log.Printf("[DEBUG] Creating tags: %#v for %s", create, d.Id())
|
log.Printf("[DEBUG] Creating tags: %s for %s", awsutil.StringValue(create), d.Id())
|
||||||
_, err := conn.CreateTags(&ec2.CreateTagsInput{
|
_, err := conn.CreateTags(&ec2.CreateTagsInput{
|
||||||
Resources: []*string{aws.String(d.Id())},
|
Resources: []*string{aws.String(d.Id())},
|
||||||
Tags: create,
|
Tags: create,
|
||||||
|
|
Loading…
Reference in New Issue