Skip to content

Commit

Permalink
use time.RFC3339 reference
Browse files Browse the repository at this point in the history
  • Loading branch information
kl4w committed Apr 24, 2018
1 parent 370e907 commit 23e92f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aws/resource_aws_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,7 @@ func buildAwsInstanceOpts(
spotOptions.SpotInstanceType = aws.String(so["spot_instance_type"].(string))

if so["valid_until"] != "" {
t, err := time.Parse(awsSpotInstanceTimeLayout, so["valid_until"].(string))
t, err := time.Parse(time.RFC3339, so["valid_until"].(string))
if err != nil {
return nil, fmt.Errorf("Error Parsing Launch Template Spot Options valid until: %s", err.Error())
}
Expand Down Expand Up @@ -2022,9 +2022,9 @@ func readSpotRequestFromInstance(instance *ec2.Instance, conn *ec2.EC2) ([]inter
spotRequest["instance_interruption_behavior"] = *sr.InstanceInterruptionBehavior
spotRequest["max_price"] = *sr.SpotPrice
spotRequest["spot_instance_type"] = *sr.Type
spotRequest["valid_until"] = aws.TimeValue(sr.ValidUntil).Format(awsSpotInstanceTimeLayout)
spotRequest["valid_until"] = aws.TimeValue(sr.ValidUntil).Format(time.RFC3339)
spotRequests = append(spotRequests, spotRequest)
}
}
return spotRequests, nil
}
}

0 comments on commit 23e92f0

Please sign in to comment.