Skip to content

Commit

Permalink
Merge pull request #1203 from rebuy-de/fix-spot-fleet-key-name
Browse files Browse the repository at this point in the history
fix empty key_name on aws_spot_fleet_request
  • Loading branch information
radeksimko authored Jul 28, 2017
2 parents 9475bc1 + 552c442 commit d11ece0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion aws/resource_aws_spot_fleet_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ func buildSpotFleetLaunchSpecification(d map[string]interface{}, meta interface{
opts.UserData = aws.String(base64Encode([]byte(v.(string))))
}

if v, ok := d["key_name"]; ok {
if v, ok := d["key_name"]; ok && v != "" {
opts.KeyName = aws.String(v.(string))
}

Expand Down
3 changes: 2 additions & 1 deletion aws/resource_aws_spot_fleet_request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1364,9 +1364,10 @@ resource "aws_spot_fleet_request" "foo" {
target_capacity = 1
valid_until = "2019-11-04T20:44:20Z"
terminate_instances_with_expiration = true
wait_for_fulfillment = true
launch_specification {
instance_type = "m1.small"
ami = "ami-d06a90b0"
ami = "ami-516b9131"
ebs_block_device {
device_name = "/dev/xvda"
Expand Down

0 comments on commit d11ece0

Please sign in to comment.