terraform/builtin/providers/aws/resource_aws_spot_fleet_req...

1254 lines
37 KiB
Go
Raw Normal View History

2016-06-22 02:16:02 +02:00
package aws
import (
"errors"
2016-06-22 02:16:02 +02:00
"fmt"
"log"
2016-06-22 02:16:02 +02:00
"testing"
"time"
2016-06-22 02:16:02 +02:00
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/terraform/helper/acctest"
2016-06-22 02:16:02 +02:00
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
)
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
func TestAccAWSSpotFleetRequest_changePriceForcesNewRequest(t *testing.T) {
var before, after ec2.SpotFleetRequestConfig
rName := acctest.RandString(10)
rInt := acctest.RandInt()
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSSpotFleetRequestConfig(rName, rInt),
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckAWSSpotFleetRequestExists(
"aws_spot_fleet_request.foo", &before),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "spot_request_state", "active"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "spot_price", "0.005"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.#", "1"),
),
},
{
Config: testAccAWSSpotFleetRequestConfigChangeSpotBidPrice(rName, rInt),
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckAWSSpotFleetRequestExists(
"aws_spot_fleet_request.foo", &after),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "spot_request_state", "active"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.#", "1"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "spot_price", "0.01"),
testAccCheckAWSSpotFleetRequestConfigRecreated(t, &before, &after),
),
},
},
})
}
func TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion(t *testing.T) {
2016-06-22 02:16:02 +02:00
var sfr ec2.SpotFleetRequestConfig
rName := acctest.RandString(10)
rInt := acctest.RandInt()
2016-06-22 02:16:02 +02:00
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSSpotFleetRequestConfig(rName, rInt),
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckAWSSpotFleetRequestExists(
"aws_spot_fleet_request.foo", &sfr),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "spot_request_state", "active"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.#", "1"),
),
},
},
})
}
func TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList(t *testing.T) {
var sfr ec2.SpotFleetRequestConfig
rName := acctest.RandString(10)
rInt := acctest.RandInt()
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSSpotFleetRequestConfigWithAzs(rName, rInt),
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckAWSSpotFleetRequestExists(
"aws_spot_fleet_request.foo", &sfr),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "spot_request_state", "active"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.#", "2"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.1590006269.availability_zone", "us-west-2a"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.3809475891.availability_zone", "us-west-2b"),
),
},
},
})
}
func TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList(t *testing.T) {
var sfr ec2.SpotFleetRequestConfig
rName := acctest.RandString(10)
rInt := acctest.RandInt()
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSSpotFleetRequestConfigWithSubnet(rName, rInt),
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckAWSSpotFleetRequestExists(
"aws_spot_fleet_request.foo", &sfr),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "spot_request_state", "active"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.#", "2"),
),
},
},
})
}
func TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz(t *testing.T) {
var sfr ec2.SpotFleetRequestConfig
rName := acctest.RandString(10)
rInt := acctest.RandInt()
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSSpotFleetRequestConfigMultipleInstanceTypesinSameAz(rName, rInt),
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckAWSSpotFleetRequestExists(
"aws_spot_fleet_request.foo", &sfr),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "spot_request_state", "active"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.#", "2"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.1590006269.instance_type", "m1.small"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.1590006269.availability_zone", "us-west-2a"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.3079734941.instance_type", "m3.large"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.3079734941.availability_zone", "us-west-2a"),
),
},
},
})
}
func TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet(t *testing.T) {
var sfr ec2.SpotFleetRequestConfig
rName := acctest.RandString(10)
rInt := acctest.RandInt()
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSSpotFleetRequestConfigMultipleInstanceTypesinSameSubnet(rName, rInt),
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckAWSSpotFleetRequestExists(
"aws_spot_fleet_request.foo", &sfr),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "spot_request_state", "active"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.#", "2"),
),
},
},
})
}
func TestAccAWSSpotFleetRequest_overriddingSpotPrice(t *testing.T) {
var sfr ec2.SpotFleetRequestConfig
rName := acctest.RandString(10)
rInt := acctest.RandInt()
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSSpotFleetRequestConfigOverridingSpotPrice(rName, rInt),
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
Check: resource.ComposeAggregateTestCheckFunc(
2016-06-22 02:16:02 +02:00
testAccCheckAWSSpotFleetRequestExists(
"aws_spot_fleet_request.foo", &sfr),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "spot_request_state", "active"),
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "spot_price", "0.005"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.#", "2"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.522395050.spot_price", "0.01"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.522395050.instance_type", "m3.large"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.1590006269.spot_price", ""), //there will not be a value here since it's not overriding
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.1590006269.instance_type", "m1.small"),
2016-06-22 02:16:02 +02:00
),
},
},
})
}
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
func TestAccAWSSpotFleetRequest_diversifiedAllocation(t *testing.T) {
var sfr ec2.SpotFleetRequestConfig
rName := acctest.RandString(10)
rInt := acctest.RandInt()
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
provider/aws: `aws_spot_fleet_request` throws panic on missing subnet_id (#8217) or availability_zone Fixes #8000 There was a hard coded panic in the code!!! ``` panic( fmt.Sprintf( "Must set one of:\navailability_zone %#v\nsubnet_id: %#v", m["availability_zone"], m["subnet_id"]) ) ``` This was causing issues when we set neither an availability zone or a subnet id. This has been removed and is now handled with an error rather than a panic. This was what happened with the new test before the fix: ``` === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification panic: Must set one of: availability_zone "" subnet_id: "" goroutine 129 [running]: panic(0x11377a0, 0xc8202abfc0) /opt/boxen/homebrew/Cellar/go/1.6.2/libexec/src/runtime/panic.go:481 +0x3e6 github.com/hashicorp/terraform/builtin/providers/aws.hashLaunchSpecification(0x11361a0, 0xc8202e07e0, 0xc800000001) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_fleet_request.go:953 +0x685 github.com/hashicorp/terraform/helper/schema.(*Set).hash(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0x0, 0x0) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/helper/schema/set.go:180 +0x40 github.com/hashicorp/terraform/helper/schema.(*Set).add(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0xc820276900, 0x0, 0x0) ``` The test then ran fine after the fix: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification' ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:03:18 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification -timeout 120m === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (32.37s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 32.384s ``` Full test run looks as follows: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_' ✹ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:04:34 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_basic --- PASS: TestAccAWSSpotFleetRequest_basic (33.78s) === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (33.59s) === RUN TestAccAWSSpotFleetRequest_launchConfiguration --- PASS: TestAccAWSSpotFleetRequest_launchConfiguration (35.26s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 102.648s ```
2016-08-16 18:55:06 +02:00
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSSpotFleetRequestConfigDiversifiedAllocation(rName, rInt),
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckAWSSpotFleetRequestExists(
"aws_spot_fleet_request.foo", &sfr),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "spot_request_state", "active"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.#", "3"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "allocation_strategy", "diversified"),
),
provider/aws: `aws_spot_fleet_request` throws panic on missing subnet_id (#8217) or availability_zone Fixes #8000 There was a hard coded panic in the code!!! ``` panic( fmt.Sprintf( "Must set one of:\navailability_zone %#v\nsubnet_id: %#v", m["availability_zone"], m["subnet_id"]) ) ``` This was causing issues when we set neither an availability zone or a subnet id. This has been removed and is now handled with an error rather than a panic. This was what happened with the new test before the fix: ``` === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification panic: Must set one of: availability_zone "" subnet_id: "" goroutine 129 [running]: panic(0x11377a0, 0xc8202abfc0) /opt/boxen/homebrew/Cellar/go/1.6.2/libexec/src/runtime/panic.go:481 +0x3e6 github.com/hashicorp/terraform/builtin/providers/aws.hashLaunchSpecification(0x11361a0, 0xc8202e07e0, 0xc800000001) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_fleet_request.go:953 +0x685 github.com/hashicorp/terraform/helper/schema.(*Set).hash(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0x0, 0x0) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/helper/schema/set.go:180 +0x40 github.com/hashicorp/terraform/helper/schema.(*Set).add(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0xc820276900, 0x0, 0x0) ``` The test then ran fine after the fix: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification' ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:03:18 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification -timeout 120m === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (32.37s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 32.384s ``` Full test run looks as follows: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_' ✹ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:04:34 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_basic --- PASS: TestAccAWSSpotFleetRequest_basic (33.78s) === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (33.59s) === RUN TestAccAWSSpotFleetRequest_launchConfiguration --- PASS: TestAccAWSSpotFleetRequest_launchConfiguration (35.26s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 102.648s ```
2016-08-16 18:55:06 +02:00
},
},
})
}
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
func TestAccAWSSpotFleetRequest_withWeightedCapacity(t *testing.T) {
2016-06-22 02:16:02 +02:00
var sfr ec2.SpotFleetRequestConfig
rName := acctest.RandString(10)
rInt := acctest.RandInt()
2016-06-22 02:16:02 +02:00
fulfillSleep := func() resource.TestCheckFunc {
// sleep so that EC2 can fuflill the request. We do this to guard against a
// regression and possible leak where we'll destroy the request and the
// associated IAM role before anything is actually provisioned and running,
// thus leaking when those newly started instances are attempted to be
// destroyed
// See https://github.com/hashicorp/terraform/pull/8938
return func(s *terraform.State) error {
log.Print("[DEBUG] Test: Sleep to allow EC2 to actually begin fulfilling TestAccAWSSpotFleetRequest_withWeightedCapacity request")
time.Sleep(1 * time.Minute)
return nil
}
}
2016-06-22 02:16:02 +02:00
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSSpotFleetRequestConfigWithWeightedCapacity(rName, rInt),
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
Check: resource.ComposeAggregateTestCheckFunc(
fulfillSleep(),
2016-06-22 02:16:02 +02:00
testAccCheckAWSSpotFleetRequestExists(
"aws_spot_fleet_request.foo", &sfr),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "spot_request_state", "active"),
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.#", "2"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.2325690000.weighted_capacity", "3"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.2325690000.instance_type", "r3.large"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.3079734941.weighted_capacity", "6"),
resource.TestCheckResourceAttr(
"aws_spot_fleet_request.foo", "launch_specification.3079734941.instance_type", "m3.large"),
2016-06-22 02:16:02 +02:00
),
},
},
})
}
func TestAccAWSSpotFleetRequest_withEBSDisk(t *testing.T) {
var config ec2.SpotFleetRequestConfig
rName := acctest.RandString(10)
rInt := acctest.RandInt()
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSSpotFleetRequestEBSConfig(rName, rInt),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckAWSSpotFleetRequestExists(
"aws_spot_fleet_request.foo", &config),
testAccCheckAWSSpotFleetRequest_EBSAttributes(
&config),
),
},
},
})
}
2016-06-22 02:16:02 +02:00
func TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName(t *testing.T) {
_, errs := validateSpotFleetRequestKeyName("", "key_name")
if len(errs) == 0 {
t.Fatal("Expected the key name to trigger a validation error")
2016-06-22 02:16:02 +02:00
}
}
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
func testAccCheckAWSSpotFleetRequestConfigRecreated(t *testing.T,
before, after *ec2.SpotFleetRequestConfig) resource.TestCheckFunc {
return func(s *terraform.State) error {
if before.SpotFleetRequestId == after.SpotFleetRequestId {
t.Fatalf("Expected change of Spot Fleet Request IDs, but both were %v", before.SpotFleetRequestId)
}
return nil
}
}
2016-06-22 02:16:02 +02:00
func testAccCheckAWSSpotFleetRequestExists(
n string, sfr *ec2.SpotFleetRequestConfig) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]
if !ok {
return fmt.Errorf("Not found: %s", n)
}
if rs.Primary.ID == "" {
return errors.New("No Spot fleet request with that id exists")
2016-06-22 02:16:02 +02:00
}
conn := testAccProvider.Meta().(*AWSClient).ec2conn
params := &ec2.DescribeSpotFleetRequestsInput{
SpotFleetRequestIds: []*string{&rs.Primary.ID},
}
resp, err := conn.DescribeSpotFleetRequests(params)
if err != nil {
return err
}
if v := len(resp.SpotFleetRequestConfigs); v != 1 {
return fmt.Errorf("Expected 1 request returned, got %d", v)
}
*sfr = *resp.SpotFleetRequestConfigs[0]
return nil
}
}
func testAccCheckAWSSpotFleetRequest_EBSAttributes(
sfr *ec2.SpotFleetRequestConfig) resource.TestCheckFunc {
return func(s *terraform.State) error {
if len(sfr.SpotFleetRequestConfig.LaunchSpecifications) == 0 {
return errors.New("Missing launch specification")
}
spec := *sfr.SpotFleetRequestConfig.LaunchSpecifications[0]
ebs := spec.BlockDeviceMappings
if len(ebs) < 2 {
return fmt.Errorf("Expected %d block device mappings, got %d", 2, len(ebs))
}
if *ebs[0].DeviceName != "/dev/xvda" {
return fmt.Errorf("Expected device 0's name to be %s, got %s", "/dev/xvda", *ebs[0].DeviceName)
}
if *ebs[1].DeviceName != "/dev/xvdcz" {
return fmt.Errorf("Expected device 1's name to be %s, got %s", "/dev/xvdcz", *ebs[1].DeviceName)
}
return nil
}
}
2016-06-22 02:16:02 +02:00
func testAccCheckAWSSpotFleetRequestDestroy(s *terraform.State) error {
conn := testAccProvider.Meta().(*AWSClient).ec2conn
for _, rs := range s.RootModule().Resources {
if rs.Type != "aws_spot_fleet_request" {
continue
}
_, err := conn.CancelSpotFleetRequests(&ec2.CancelSpotFleetRequestsInput{
SpotFleetRequestIds: []*string{aws.String(rs.Primary.ID)},
TerminateInstances: aws.Bool(true),
})
if err != nil {
return fmt.Errorf("Error cancelling spot request (%s): %s", rs.Primary.ID, err)
}
}
return nil
}
func testAccAWSSpotFleetRequestConfig(rName string, rInt int) string {
return fmt.Sprintf(`
2016-06-22 02:16:02 +02:00
resource "aws_key_pair" "debugging" {
key_name = "tmp-key-%s"
2016-06-22 02:16:02 +02:00
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com"
}
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
resource "aws_iam_policy" "test-policy" {
name = "test-policy-%d"
path = "/"
description = "Spot Fleet Request ACCTest Policy"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ec2:DescribeImages",
"ec2:DescribeSubnets",
"ec2:RequestSpotInstances",
"ec2:TerminateInstances",
"ec2:DescribeInstanceStatus",
"iam:PassRole"
],
"Resource": ["*"]
}]
}
EOF
}
2016-06-22 02:16:02 +02:00
resource "aws_iam_policy_attachment" "test-attach" {
name = "test-attachment-%d"
2016-06-22 02:16:02 +02:00
roles = ["${aws_iam_role.test-role.name}"]
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
policy_arn = "${aws_iam_policy.test-policy.arn}"
2016-06-22 02:16:02 +02:00
}
resource "aws_iam_role" "test-role" {
name = "test-role-%s"
2016-06-22 02:16:02 +02:00
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": [
"spotfleet.amazonaws.com",
"ec2.amazonaws.com"
]
2016-06-22 02:16:02 +02:00
},
"Action": "sts:AssumeRole"
}
]
}
EOF
}
resource "aws_spot_fleet_request" "foo" {
iam_fleet_role = "${aws_iam_role.test-role.arn}"
spot_price = "0.005"
target_capacity = 2
valid_until = "2019-11-04T20:44:20Z"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
terminate_instances_with_expiration = true
2016-06-22 02:16:02 +02:00
launch_specification {
instance_type = "m1.small"
ami = "ami-d06a90b0"
2016-06-22 02:16:02 +02:00
key_name = "${aws_key_pair.debugging.key_name}"
}
depends_on = ["aws_iam_policy_attachment.test-attach"]
}
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
`, rName, rInt, rInt, rName)
}
2016-06-22 02:16:02 +02:00
func testAccAWSSpotFleetRequestConfigChangeSpotBidPrice(rName string, rInt int) string {
return fmt.Sprintf(`
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource "aws_key_pair" "debugging" {
key_name = "tmp-key-%s"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com"
}
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
resource "aws_iam_policy" "test-policy" {
name = "test-policy-%d"
path = "/"
description = "Spot Fleet Request ACCTest Policy"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ec2:DescribeImages",
"ec2:DescribeSubnets",
"ec2:RequestSpotInstances",
"ec2:TerminateInstances",
"ec2:DescribeInstanceStatus",
"iam:PassRole"
],
"Resource": ["*"]
}]
}
EOF
}
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource "aws_iam_policy_attachment" "test-attach" {
name = "test-attachment-%d"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
roles = ["${aws_iam_role.test-role.name}"]
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
policy_arn = "${aws_iam_policy.test-policy.arn}"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
}
resource "aws_iam_role" "test-role" {
name = "test-role-%s"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": [
"spotfleet.amazonaws.com",
"ec2.amazonaws.com"
]
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
},
"Action": "sts:AssumeRole"
}
]
}
EOF
}
resource "aws_spot_fleet_request" "foo" {
iam_fleet_role = "${aws_iam_role.test-role.arn}"
spot_price = "0.01"
target_capacity = 2
valid_until = "2019-11-04T20:44:20Z"
terminate_instances_with_expiration = true
launch_specification {
instance_type = "m1.small"
ami = "ami-d06a90b0"
key_name = "${aws_key_pair.debugging.key_name}"
}
depends_on = ["aws_iam_policy_attachment.test-attach"]
}
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
`, rName, rInt, rInt, rName)
}
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
func testAccAWSSpotFleetRequestConfigWithAzs(rName string, rInt int) string {
return fmt.Sprintf(`
provider/aws: `aws_spot_fleet_request` throws panic on missing subnet_id (#8217) or availability_zone Fixes #8000 There was a hard coded panic in the code!!! ``` panic( fmt.Sprintf( "Must set one of:\navailability_zone %#v\nsubnet_id: %#v", m["availability_zone"], m["subnet_id"]) ) ``` This was causing issues when we set neither an availability zone or a subnet id. This has been removed and is now handled with an error rather than a panic. This was what happened with the new test before the fix: ``` === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification panic: Must set one of: availability_zone "" subnet_id: "" goroutine 129 [running]: panic(0x11377a0, 0xc8202abfc0) /opt/boxen/homebrew/Cellar/go/1.6.2/libexec/src/runtime/panic.go:481 +0x3e6 github.com/hashicorp/terraform/builtin/providers/aws.hashLaunchSpecification(0x11361a0, 0xc8202e07e0, 0xc800000001) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_fleet_request.go:953 +0x685 github.com/hashicorp/terraform/helper/schema.(*Set).hash(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0x0, 0x0) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/helper/schema/set.go:180 +0x40 github.com/hashicorp/terraform/helper/schema.(*Set).add(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0xc820276900, 0x0, 0x0) ``` The test then ran fine after the fix: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification' ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:03:18 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification -timeout 120m === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (32.37s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 32.384s ``` Full test run looks as follows: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_' ✹ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:04:34 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_basic --- PASS: TestAccAWSSpotFleetRequest_basic (33.78s) === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (33.59s) === RUN TestAccAWSSpotFleetRequest_launchConfiguration --- PASS: TestAccAWSSpotFleetRequest_launchConfiguration (35.26s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 102.648s ```
2016-08-16 18:55:06 +02:00
resource "aws_key_pair" "debugging" {
key_name = "tmp-key-%s"
provider/aws: `aws_spot_fleet_request` throws panic on missing subnet_id (#8217) or availability_zone Fixes #8000 There was a hard coded panic in the code!!! ``` panic( fmt.Sprintf( "Must set one of:\navailability_zone %#v\nsubnet_id: %#v", m["availability_zone"], m["subnet_id"]) ) ``` This was causing issues when we set neither an availability zone or a subnet id. This has been removed and is now handled with an error rather than a panic. This was what happened with the new test before the fix: ``` === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification panic: Must set one of: availability_zone "" subnet_id: "" goroutine 129 [running]: panic(0x11377a0, 0xc8202abfc0) /opt/boxen/homebrew/Cellar/go/1.6.2/libexec/src/runtime/panic.go:481 +0x3e6 github.com/hashicorp/terraform/builtin/providers/aws.hashLaunchSpecification(0x11361a0, 0xc8202e07e0, 0xc800000001) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_fleet_request.go:953 +0x685 github.com/hashicorp/terraform/helper/schema.(*Set).hash(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0x0, 0x0) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/helper/schema/set.go:180 +0x40 github.com/hashicorp/terraform/helper/schema.(*Set).add(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0xc820276900, 0x0, 0x0) ``` The test then ran fine after the fix: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification' ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:03:18 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification -timeout 120m === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (32.37s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 32.384s ``` Full test run looks as follows: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_' ✹ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:04:34 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_basic --- PASS: TestAccAWSSpotFleetRequest_basic (33.78s) === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (33.59s) === RUN TestAccAWSSpotFleetRequest_launchConfiguration --- PASS: TestAccAWSSpotFleetRequest_launchConfiguration (35.26s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 102.648s ```
2016-08-16 18:55:06 +02:00
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com"
}
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
resource "aws_iam_policy" "test-policy" {
name = "test-policy-%d"
path = "/"
description = "Spot Fleet Request ACCTest Policy"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ec2:DescribeImages",
"ec2:DescribeSubnets",
"ec2:RequestSpotInstances",
"ec2:TerminateInstances",
"ec2:DescribeInstanceStatus",
"iam:PassRole"
],
"Resource": ["*"]
}]
}
EOF
}
provider/aws: `aws_spot_fleet_request` throws panic on missing subnet_id (#8217) or availability_zone Fixes #8000 There was a hard coded panic in the code!!! ``` panic( fmt.Sprintf( "Must set one of:\navailability_zone %#v\nsubnet_id: %#v", m["availability_zone"], m["subnet_id"]) ) ``` This was causing issues when we set neither an availability zone or a subnet id. This has been removed and is now handled with an error rather than a panic. This was what happened with the new test before the fix: ``` === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification panic: Must set one of: availability_zone "" subnet_id: "" goroutine 129 [running]: panic(0x11377a0, 0xc8202abfc0) /opt/boxen/homebrew/Cellar/go/1.6.2/libexec/src/runtime/panic.go:481 +0x3e6 github.com/hashicorp/terraform/builtin/providers/aws.hashLaunchSpecification(0x11361a0, 0xc8202e07e0, 0xc800000001) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_fleet_request.go:953 +0x685 github.com/hashicorp/terraform/helper/schema.(*Set).hash(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0x0, 0x0) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/helper/schema/set.go:180 +0x40 github.com/hashicorp/terraform/helper/schema.(*Set).add(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0xc820276900, 0x0, 0x0) ``` The test then ran fine after the fix: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification' ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:03:18 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification -timeout 120m === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (32.37s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 32.384s ``` Full test run looks as follows: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_' ✹ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:04:34 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_basic --- PASS: TestAccAWSSpotFleetRequest_basic (33.78s) === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (33.59s) === RUN TestAccAWSSpotFleetRequest_launchConfiguration --- PASS: TestAccAWSSpotFleetRequest_launchConfiguration (35.26s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 102.648s ```
2016-08-16 18:55:06 +02:00
resource "aws_iam_policy_attachment" "test-attach" {
name = "test-attachment-%d"
provider/aws: `aws_spot_fleet_request` throws panic on missing subnet_id (#8217) or availability_zone Fixes #8000 There was a hard coded panic in the code!!! ``` panic( fmt.Sprintf( "Must set one of:\navailability_zone %#v\nsubnet_id: %#v", m["availability_zone"], m["subnet_id"]) ) ``` This was causing issues when we set neither an availability zone or a subnet id. This has been removed and is now handled with an error rather than a panic. This was what happened with the new test before the fix: ``` === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification panic: Must set one of: availability_zone "" subnet_id: "" goroutine 129 [running]: panic(0x11377a0, 0xc8202abfc0) /opt/boxen/homebrew/Cellar/go/1.6.2/libexec/src/runtime/panic.go:481 +0x3e6 github.com/hashicorp/terraform/builtin/providers/aws.hashLaunchSpecification(0x11361a0, 0xc8202e07e0, 0xc800000001) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_fleet_request.go:953 +0x685 github.com/hashicorp/terraform/helper/schema.(*Set).hash(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0x0, 0x0) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/helper/schema/set.go:180 +0x40 github.com/hashicorp/terraform/helper/schema.(*Set).add(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0xc820276900, 0x0, 0x0) ``` The test then ran fine after the fix: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification' ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:03:18 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification -timeout 120m === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (32.37s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 32.384s ``` Full test run looks as follows: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_' ✹ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:04:34 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_basic --- PASS: TestAccAWSSpotFleetRequest_basic (33.78s) === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (33.59s) === RUN TestAccAWSSpotFleetRequest_launchConfiguration --- PASS: TestAccAWSSpotFleetRequest_launchConfiguration (35.26s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 102.648s ```
2016-08-16 18:55:06 +02:00
roles = ["${aws_iam_role.test-role.name}"]
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
policy_arn = "${aws_iam_policy.test-policy.arn}"
provider/aws: `aws_spot_fleet_request` throws panic on missing subnet_id (#8217) or availability_zone Fixes #8000 There was a hard coded panic in the code!!! ``` panic( fmt.Sprintf( "Must set one of:\navailability_zone %#v\nsubnet_id: %#v", m["availability_zone"], m["subnet_id"]) ) ``` This was causing issues when we set neither an availability zone or a subnet id. This has been removed and is now handled with an error rather than a panic. This was what happened with the new test before the fix: ``` === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification panic: Must set one of: availability_zone "" subnet_id: "" goroutine 129 [running]: panic(0x11377a0, 0xc8202abfc0) /opt/boxen/homebrew/Cellar/go/1.6.2/libexec/src/runtime/panic.go:481 +0x3e6 github.com/hashicorp/terraform/builtin/providers/aws.hashLaunchSpecification(0x11361a0, 0xc8202e07e0, 0xc800000001) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_fleet_request.go:953 +0x685 github.com/hashicorp/terraform/helper/schema.(*Set).hash(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0x0, 0x0) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/helper/schema/set.go:180 +0x40 github.com/hashicorp/terraform/helper/schema.(*Set).add(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0xc820276900, 0x0, 0x0) ``` The test then ran fine after the fix: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification' ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:03:18 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification -timeout 120m === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (32.37s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 32.384s ``` Full test run looks as follows: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_' ✹ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:04:34 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_basic --- PASS: TestAccAWSSpotFleetRequest_basic (33.78s) === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (33.59s) === RUN TestAccAWSSpotFleetRequest_launchConfiguration --- PASS: TestAccAWSSpotFleetRequest_launchConfiguration (35.26s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 102.648s ```
2016-08-16 18:55:06 +02:00
}
resource "aws_iam_role" "test-role" {
name = "test-role-%s"
provider/aws: `aws_spot_fleet_request` throws panic on missing subnet_id (#8217) or availability_zone Fixes #8000 There was a hard coded panic in the code!!! ``` panic( fmt.Sprintf( "Must set one of:\navailability_zone %#v\nsubnet_id: %#v", m["availability_zone"], m["subnet_id"]) ) ``` This was causing issues when we set neither an availability zone or a subnet id. This has been removed and is now handled with an error rather than a panic. This was what happened with the new test before the fix: ``` === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification panic: Must set one of: availability_zone "" subnet_id: "" goroutine 129 [running]: panic(0x11377a0, 0xc8202abfc0) /opt/boxen/homebrew/Cellar/go/1.6.2/libexec/src/runtime/panic.go:481 +0x3e6 github.com/hashicorp/terraform/builtin/providers/aws.hashLaunchSpecification(0x11361a0, 0xc8202e07e0, 0xc800000001) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_fleet_request.go:953 +0x685 github.com/hashicorp/terraform/helper/schema.(*Set).hash(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0x0, 0x0) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/helper/schema/set.go:180 +0x40 github.com/hashicorp/terraform/helper/schema.(*Set).add(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0xc820276900, 0x0, 0x0) ``` The test then ran fine after the fix: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification' ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:03:18 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification -timeout 120m === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (32.37s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 32.384s ``` Full test run looks as follows: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_' ✹ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:04:34 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_basic --- PASS: TestAccAWSSpotFleetRequest_basic (33.78s) === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (33.59s) === RUN TestAccAWSSpotFleetRequest_launchConfiguration --- PASS: TestAccAWSSpotFleetRequest_launchConfiguration (35.26s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 102.648s ```
2016-08-16 18:55:06 +02:00
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": [
"spotfleet.amazonaws.com",
"ec2.amazonaws.com"
]
provider/aws: `aws_spot_fleet_request` throws panic on missing subnet_id (#8217) or availability_zone Fixes #8000 There was a hard coded panic in the code!!! ``` panic( fmt.Sprintf( "Must set one of:\navailability_zone %#v\nsubnet_id: %#v", m["availability_zone"], m["subnet_id"]) ) ``` This was causing issues when we set neither an availability zone or a subnet id. This has been removed and is now handled with an error rather than a panic. This was what happened with the new test before the fix: ``` === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification panic: Must set one of: availability_zone "" subnet_id: "" goroutine 129 [running]: panic(0x11377a0, 0xc8202abfc0) /opt/boxen/homebrew/Cellar/go/1.6.2/libexec/src/runtime/panic.go:481 +0x3e6 github.com/hashicorp/terraform/builtin/providers/aws.hashLaunchSpecification(0x11361a0, 0xc8202e07e0, 0xc800000001) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_fleet_request.go:953 +0x685 github.com/hashicorp/terraform/helper/schema.(*Set).hash(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0x0, 0x0) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/helper/schema/set.go:180 +0x40 github.com/hashicorp/terraform/helper/schema.(*Set).add(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0xc820276900, 0x0, 0x0) ``` The test then ran fine after the fix: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification' ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:03:18 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification -timeout 120m === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (32.37s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 32.384s ``` Full test run looks as follows: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_' ✹ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:04:34 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_basic --- PASS: TestAccAWSSpotFleetRequest_basic (33.78s) === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (33.59s) === RUN TestAccAWSSpotFleetRequest_launchConfiguration --- PASS: TestAccAWSSpotFleetRequest_launchConfiguration (35.26s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 102.648s ```
2016-08-16 18:55:06 +02:00
},
"Action": "sts:AssumeRole"
}
]
}
EOF
}
resource "aws_spot_fleet_request" "foo" {
iam_fleet_role = "${aws_iam_role.test-role.arn}"
spot_price = "0.005"
target_capacity = 2
valid_until = "2019-11-04T20:44:20Z"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
terminate_instances_with_expiration = true
launch_specification {
instance_type = "m1.small"
ami = "ami-d06a90b0"
key_name = "${aws_key_pair.debugging.key_name}"
availability_zone = "us-west-2a"
}
provider/aws: `aws_spot_fleet_request` throws panic on missing subnet_id (#8217) or availability_zone Fixes #8000 There was a hard coded panic in the code!!! ``` panic( fmt.Sprintf( "Must set one of:\navailability_zone %#v\nsubnet_id: %#v", m["availability_zone"], m["subnet_id"]) ) ``` This was causing issues when we set neither an availability zone or a subnet id. This has been removed and is now handled with an error rather than a panic. This was what happened with the new test before the fix: ``` === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification panic: Must set one of: availability_zone "" subnet_id: "" goroutine 129 [running]: panic(0x11377a0, 0xc8202abfc0) /opt/boxen/homebrew/Cellar/go/1.6.2/libexec/src/runtime/panic.go:481 +0x3e6 github.com/hashicorp/terraform/builtin/providers/aws.hashLaunchSpecification(0x11361a0, 0xc8202e07e0, 0xc800000001) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_fleet_request.go:953 +0x685 github.com/hashicorp/terraform/helper/schema.(*Set).hash(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0x0, 0x0) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/helper/schema/set.go:180 +0x40 github.com/hashicorp/terraform/helper/schema.(*Set).add(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0xc820276900, 0x0, 0x0) ``` The test then ran fine after the fix: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification' ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:03:18 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification -timeout 120m === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (32.37s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 32.384s ``` Full test run looks as follows: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_' ✹ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:04:34 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_basic --- PASS: TestAccAWSSpotFleetRequest_basic (33.78s) === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (33.59s) === RUN TestAccAWSSpotFleetRequest_launchConfiguration --- PASS: TestAccAWSSpotFleetRequest_launchConfiguration (35.26s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 102.648s ```
2016-08-16 18:55:06 +02:00
launch_specification {
instance_type = "m1.small"
ami = "ami-d06a90b0"
key_name = "${aws_key_pair.debugging.key_name}"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
availability_zone = "us-west-2b"
provider/aws: `aws_spot_fleet_request` throws panic on missing subnet_id (#8217) or availability_zone Fixes #8000 There was a hard coded panic in the code!!! ``` panic( fmt.Sprintf( "Must set one of:\navailability_zone %#v\nsubnet_id: %#v", m["availability_zone"], m["subnet_id"]) ) ``` This was causing issues when we set neither an availability zone or a subnet id. This has been removed and is now handled with an error rather than a panic. This was what happened with the new test before the fix: ``` === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification panic: Must set one of: availability_zone "" subnet_id: "" goroutine 129 [running]: panic(0x11377a0, 0xc8202abfc0) /opt/boxen/homebrew/Cellar/go/1.6.2/libexec/src/runtime/panic.go:481 +0x3e6 github.com/hashicorp/terraform/builtin/providers/aws.hashLaunchSpecification(0x11361a0, 0xc8202e07e0, 0xc800000001) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_fleet_request.go:953 +0x685 github.com/hashicorp/terraform/helper/schema.(*Set).hash(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0x0, 0x0) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/helper/schema/set.go:180 +0x40 github.com/hashicorp/terraform/helper/schema.(*Set).add(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0xc820276900, 0x0, 0x0) ``` The test then ran fine after the fix: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification' ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:03:18 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification -timeout 120m === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (32.37s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 32.384s ``` Full test run looks as follows: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_' ✹ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:04:34 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_basic --- PASS: TestAccAWSSpotFleetRequest_basic (33.78s) === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (33.59s) === RUN TestAccAWSSpotFleetRequest_launchConfiguration --- PASS: TestAccAWSSpotFleetRequest_launchConfiguration (35.26s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 102.648s ```
2016-08-16 18:55:06 +02:00
}
depends_on = ["aws_iam_policy_attachment.test-attach"]
}
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
`, rName, rInt, rInt, rName)
}
provider/aws: `aws_spot_fleet_request` throws panic on missing subnet_id (#8217) or availability_zone Fixes #8000 There was a hard coded panic in the code!!! ``` panic( fmt.Sprintf( "Must set one of:\navailability_zone %#v\nsubnet_id: %#v", m["availability_zone"], m["subnet_id"]) ) ``` This was causing issues when we set neither an availability zone or a subnet id. This has been removed and is now handled with an error rather than a panic. This was what happened with the new test before the fix: ``` === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification panic: Must set one of: availability_zone "" subnet_id: "" goroutine 129 [running]: panic(0x11377a0, 0xc8202abfc0) /opt/boxen/homebrew/Cellar/go/1.6.2/libexec/src/runtime/panic.go:481 +0x3e6 github.com/hashicorp/terraform/builtin/providers/aws.hashLaunchSpecification(0x11361a0, 0xc8202e07e0, 0xc800000001) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_spot_fleet_request.go:953 +0x685 github.com/hashicorp/terraform/helper/schema.(*Set).hash(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0x0, 0x0) /Users/stacko/Code/go/src/github.com/hashicorp/terraform/helper/schema/set.go:180 +0x40 github.com/hashicorp/terraform/helper/schema.(*Set).add(0xc82005ae00, 0x11361a0, 0xc8202e07e0, 0xc820276900, 0x0, 0x0) ``` The test then ran fine after the fix: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification' ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:03:18 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_brokenLaunchSpecification -timeout 120m === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (32.37s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 32.384s ``` Full test run looks as follows: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSpotFleetRequest_' ✹ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/16 08:04:34 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_basic --- PASS: TestAccAWSSpotFleetRequest_basic (33.78s) === RUN TestAccAWSSpotFleetRequest_brokenLaunchSpecification --- PASS: TestAccAWSSpotFleetRequest_brokenLaunchSpecification (33.59s) === RUN TestAccAWSSpotFleetRequest_launchConfiguration --- PASS: TestAccAWSSpotFleetRequest_launchConfiguration (35.26s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 102.648s ```
2016-08-16 18:55:06 +02:00
func testAccAWSSpotFleetRequestConfigWithSubnet(rName string, rInt int) string {
return fmt.Sprintf(`
2016-06-22 02:16:02 +02:00
resource "aws_key_pair" "debugging" {
key_name = "tmp-key-%s"
2016-06-22 02:16:02 +02:00
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com"
}
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
resource "aws_iam_policy" "test-policy" {
name = "test-policy-%d"
path = "/"
description = "Spot Fleet Request ACCTest Policy"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ec2:DescribeImages",
"ec2:DescribeSubnets",
"ec2:RequestSpotInstances",
"ec2:TerminateInstances",
"ec2:DescribeInstanceStatus",
"iam:PassRole"
],
"Resource": ["*"]
}]
}
EOF
}
2016-06-22 02:16:02 +02:00
resource "aws_iam_policy_attachment" "test-attach" {
name = "test-attachment-%d"
2016-06-22 02:16:02 +02:00
roles = ["${aws_iam_role.test-role.name}"]
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
policy_arn = "${aws_iam_policy.test-policy.arn}"
2016-06-22 02:16:02 +02:00
}
resource "aws_iam_role" "test-role" {
name = "test-role-%s"
2016-06-22 02:16:02 +02:00
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": [
"spotfleet.amazonaws.com",
"ec2.amazonaws.com"
]
2016-06-22 02:16:02 +02:00
},
"Action": "sts:AssumeRole"
}
]
}
EOF
}
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource "aws_vpc" "foo" {
cidr_block = "10.1.0.0/16"
}
resource "aws_subnet" "foo" {
cidr_block = "10.1.1.0/24"
vpc_id = "${aws_vpc.foo.id}"
availability_zone = "us-west-2a"
}
resource "aws_subnet" "bar" {
cidr_block = "10.1.20.0/24"
vpc_id = "${aws_vpc.foo.id}"
availability_zone = "us-west-2b"
}
2016-06-22 02:16:02 +02:00
resource "aws_spot_fleet_request" "foo" {
iam_fleet_role = "${aws_iam_role.test-role.arn}"
spot_price = "0.005"
target_capacity = 4
valid_until = "2019-11-04T20:44:20Z"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
terminate_instances_with_expiration = true
launch_specification {
instance_type = "m3.large"
ami = "ami-d0f506b0"
key_name = "${aws_key_pair.debugging.key_name}"
subnet_id = "${aws_subnet.foo.id}"
}
launch_specification {
instance_type = "m3.large"
ami = "ami-d0f506b0"
key_name = "${aws_key_pair.debugging.key_name}"
subnet_id = "${aws_subnet.bar.id}"
}
depends_on = ["aws_iam_policy_attachment.test-attach"]
}
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
`, rName, rInt, rInt, rName)
}
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
func testAccAWSSpotFleetRequestConfigMultipleInstanceTypesinSameAz(rName string, rInt int) string {
return fmt.Sprintf(`
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource "aws_key_pair" "debugging" {
key_name = "tmp-key-%s"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com"
}
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
resource "aws_iam_policy" "test-policy" {
name = "test-policy-%d"
path = "/"
description = "Spot Fleet Request ACCTest Policy"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ec2:DescribeImages",
"ec2:DescribeSubnets",
"ec2:RequestSpotInstances",
"ec2:TerminateInstances",
"ec2:DescribeInstanceStatus",
"iam:PassRole"
],
"Resource": ["*"]
}]
}
EOF
}
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource "aws_iam_policy_attachment" "test-attach" {
name = "test-attachment-%d"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
roles = ["${aws_iam_role.test-role.name}"]
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
policy_arn = "${aws_iam_policy.test-policy.arn}"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
}
resource "aws_iam_role" "test-role" {
name = "test-role-%s"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": [
"spotfleet.amazonaws.com",
"ec2.amazonaws.com"
]
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
},
"Action": "sts:AssumeRole"
}
]
}
EOF
}
resource "aws_spot_fleet_request" "foo" {
iam_fleet_role = "${aws_iam_role.test-role.arn}"
spot_price = "0.005"
target_capacity = 2
valid_until = "2019-11-04T20:44:20Z"
terminate_instances_with_expiration = true
launch_specification {
instance_type = "m1.small"
ami = "ami-d06a90b0"
key_name = "${aws_key_pair.debugging.key_name}"
availability_zone = "us-west-2a"
}
launch_specification {
instance_type = "m3.large"
ami = "ami-d06a90b0"
key_name = "${aws_key_pair.debugging.key_name}"
availability_zone = "us-west-2a"
}
depends_on = ["aws_iam_policy_attachment.test-attach"]
}
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
`, rName, rInt, rInt, rName)
}
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
func testAccAWSSpotFleetRequestConfigMultipleInstanceTypesinSameSubnet(rName string, rInt int) string {
return fmt.Sprintf(`
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource "aws_key_pair" "debugging" {
key_name = "tmp-key-%s"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com"
}
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
resource "aws_iam_policy" "test-policy" {
name = "test-policy-%d"
path = "/"
description = "Spot Fleet Request ACCTest Policy"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ec2:DescribeImages",
"ec2:DescribeSubnets",
"ec2:RequestSpotInstances",
"ec2:TerminateInstances",
"ec2:DescribeInstanceStatus",
"iam:PassRole"
],
"Resource": ["*"]
}]
}
EOF
}
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource "aws_iam_policy_attachment" "test-attach" {
name = "test-attachment-%d"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
roles = ["${aws_iam_role.test-role.name}"]
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
policy_arn = "${aws_iam_policy.test-policy.arn}"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
}
resource "aws_iam_role" "test-role" {
name = "test-role-%s"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": [
"spotfleet.amazonaws.com",
"ec2.amazonaws.com"
]
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
},
"Action": "sts:AssumeRole"
}
]
}
EOF
}
resource "aws_vpc" "foo" {
cidr_block = "10.1.0.0/16"
}
resource "aws_subnet" "foo" {
cidr_block = "10.1.1.0/24"
vpc_id = "${aws_vpc.foo.id}"
availability_zone = "us-west-2a"
}
resource "aws_spot_fleet_request" "foo" {
iam_fleet_role = "${aws_iam_role.test-role.arn}"
spot_price = "0.005"
target_capacity = 4
valid_until = "2019-11-04T20:44:20Z"
terminate_instances_with_expiration = true
launch_specification {
instance_type = "m3.large"
ami = "ami-d0f506b0"
key_name = "${aws_key_pair.debugging.key_name}"
subnet_id = "${aws_subnet.foo.id}"
}
launch_specification {
instance_type = "r3.large"
ami = "ami-d0f506b0"
key_name = "${aws_key_pair.debugging.key_name}"
subnet_id = "${aws_subnet.foo.id}"
}
depends_on = ["aws_iam_policy_attachment.test-attach"]
}
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
`, rName, rInt, rInt, rName)
}
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
func testAccAWSSpotFleetRequestConfigOverridingSpotPrice(rName string, rInt int) string {
return fmt.Sprintf(`
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource "aws_key_pair" "debugging" {
key_name = "tmp-key-%s"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com"
}
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
resource "aws_iam_policy" "test-policy" {
name = "test-policy-%d"
path = "/"
description = "Spot Fleet Request ACCTest Policy"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ec2:DescribeImages",
"ec2:DescribeSubnets",
"ec2:RequestSpotInstances",
"ec2:TerminateInstances",
"ec2:DescribeInstanceStatus",
"iam:PassRole"
],
"Resource": ["*"]
}]
}
EOF
}
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource "aws_iam_policy_attachment" "test-attach" {
name = "test-attachment-%d"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
roles = ["${aws_iam_role.test-role.name}"]
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
policy_arn = "${aws_iam_policy.test-policy.arn}"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
}
resource "aws_iam_role" "test-role" {
name = "test-role-%s"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": [
"spotfleet.amazonaws.com",
"ec2.amazonaws.com"
]
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
},
"Action": "sts:AssumeRole"
}
]
}
EOF
}
resource "aws_spot_fleet_request" "foo" {
iam_fleet_role = "${aws_iam_role.test-role.arn}"
spot_price = "0.005"
target_capacity = 2
valid_until = "2019-11-04T20:44:20Z"
terminate_instances_with_expiration = true
2016-06-22 02:16:02 +02:00
launch_specification {
instance_type = "m1.small"
ami = "ami-d06a90b0"
2016-06-22 02:16:02 +02:00
key_name = "${aws_key_pair.debugging.key_name}"
availability_zone = "us-west-2a"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
}
launch_specification {
instance_type = "m3.large"
ami = "ami-d06a90b0"
key_name = "${aws_key_pair.debugging.key_name}"
availability_zone = "us-west-2a"
2016-06-22 02:16:02 +02:00
spot_price = "0.01"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
}
depends_on = ["aws_iam_policy_attachment.test-attach"]
}
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
`, rName, rInt, rInt, rName)
}
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
func testAccAWSSpotFleetRequestConfigDiversifiedAllocation(rName string, rInt int) string {
return fmt.Sprintf(`
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource "aws_key_pair" "debugging" {
key_name = "tmp-key-%s"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com"
}
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
resource "aws_iam_policy" "test-policy" {
name = "test-policy-%d"
path = "/"
description = "Spot Fleet Request ACCTest Policy"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ec2:DescribeImages",
"ec2:DescribeSubnets",
"ec2:RequestSpotInstances",
"ec2:TerminateInstances",
"ec2:DescribeInstanceStatus",
"iam:PassRole"
],
"Resource": ["*"]
}]
}
EOF
}
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource "aws_iam_policy_attachment" "test-attach" {
name = "test-attachment-%d"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
roles = ["${aws_iam_role.test-role.name}"]
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
policy_arn = "${aws_iam_policy.test-policy.arn}"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
}
resource "aws_iam_role" "test-role" {
name = "test-role-%s"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": [
"spotfleet.amazonaws.com",
"ec2.amazonaws.com"
]
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
},
"Action": "sts:AssumeRole"
}
]
}
EOF
}
resource "aws_spot_fleet_request" "foo" {
iam_fleet_role = "${aws_iam_role.test-role.arn}"
spot_price = "0.7"
target_capacity = 30
valid_until = "2019-11-04T20:44:20Z"
allocation_strategy = "diversified"
terminate_instances_with_expiration = true
launch_specification {
instance_type = "m1.small"
ami = "ami-d06a90b0"
key_name = "${aws_key_pair.debugging.key_name}"
availability_zone = "us-west-2a"
}
launch_specification {
instance_type = "m3.large"
ami = "ami-d06a90b0"
key_name = "${aws_key_pair.debugging.key_name}"
availability_zone = "us-west-2a"
}
launch_specification {
instance_type = "r3.large"
ami = "ami-d06a90b0"
key_name = "${aws_key_pair.debugging.key_name}"
availability_zone = "us-west-2a"
}
depends_on = ["aws_iam_policy_attachment.test-attach"]
}
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
`, rName, rInt, rInt, rName)
}
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
func testAccAWSSpotFleetRequestConfigWithWeightedCapacity(rName string, rInt int) string {
return fmt.Sprintf(`
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource "aws_key_pair" "debugging" {
key_name = "tmp-key-%s"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com"
}
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
resource "aws_iam_policy" "test-policy" {
name = "test-policy-%d"
path = "/"
description = "Spot Fleet Request ACCTest Policy"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ec2:DescribeImages",
"ec2:DescribeSubnets",
"ec2:RequestSpotInstances",
"ec2:TerminateInstances",
"ec2:DescribeInstanceStatus",
"iam:PassRole"
],
"Resource": ["*"]
}]
}
EOF
}
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
resource "aws_iam_policy_attachment" "test-attach" {
name = "test-attachment-%d"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
roles = ["${aws_iam_role.test-role.name}"]
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
policy_arn = "${aws_iam_policy.test-policy.arn}"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
}
resource "aws_iam_role" "test-role" {
name = "test-role-%s"
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": [
"spotfleet.amazonaws.com",
"ec2.amazonaws.com"
]
provider/aws: AWS SpotFleet Requests now works with Subnets and AZs (#8320) * provider/aws: Change Spot Fleet Request to allow a combination of subnet_id and availability_zone Also added a complete set of tests that reflect all of the use cases that Amazon document http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html It is important to note there that Terraform will be suggesting that users create multiple launch configurations rather than AWS's version of combing values into CSV based parameters. This will ensure that we are able to enforce the correct state Also note that `associate_public_ip_address` now defaults to `false` - a migration has been included in this PR to migration users of this functionality. This needs to be noted in the changelog. The last part of changing functionality here is waiting for the state of the request to become `active`. Before we get to this state, we cannot guarantee that Amazon have accepted the request or it could have failed validation. ``` % make testacc TEST=./builtin/providers/aws % TESTARGS='-run=TestAccAWSSpotFleetRequest_' % 2 ↵ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 15:44:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSpotFleetRequest_ -timeout 120m === RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest --- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (133.90s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (76.67s) === RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (75.22s) === RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList --- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (96.95s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (74.44s) === RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet --- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (97.82s) === RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice --- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (76.22s) === RUN TestAccAWSSpotFleetRequest_diversifiedAllocation --- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (79.81s) === RUN TestAccAWSSpotFleetRequest_withWeightedCapacity --- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (77.15s) === RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName --- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 788.184s ``` * Update resource_aws_spot_fleet_request.go
2016-08-24 12:08:46 +02:00
},
"Action": "sts:AssumeRole"
}
]
}
EOF
}
resource "aws_spot_fleet_request" "foo" {
iam_fleet_role = "${aws_iam_role.test-role.arn}"
spot_price = "0.7"
target_capacity = 10
valid_until = "2019-11-04T20:44:20Z"
terminate_instances_with_expiration = true
launch_specification {
instance_type = "m3.large"
ami = "ami-d06a90b0"
key_name = "${aws_key_pair.debugging.key_name}"
availability_zone = "us-west-2a"
weighted_capacity = "6"
}
launch_specification {
instance_type = "r3.large"
ami = "ami-d06a90b0"
key_name = "${aws_key_pair.debugging.key_name}"
availability_zone = "us-west-2a"
weighted_capacity = "3"
2016-06-22 02:16:02 +02:00
}
depends_on = ["aws_iam_policy_attachment.test-attach"]
}
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
`, rName, rInt, rInt, rName)
}
func testAccAWSSpotFleetRequestEBSConfig(rName string, rInt int) string {
return fmt.Sprintf(`
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
resource "aws_iam_policy" "test-policy" {
name = "test-policy-%d"
path = "/"
description = "Spot Fleet Request ACCTest Policy"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ec2:DescribeImages",
"ec2:DescribeSubnets",
"ec2:RequestSpotInstances",
"ec2:TerminateInstances",
"ec2:DescribeInstanceStatus",
"iam:PassRole"
],
"Resource": ["*"]
}]
}
EOF
}
resource "aws_iam_policy_attachment" "test-attach" {
name = "test-attachment-%d"
roles = ["${aws_iam_role.test-role.name}"]
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
policy_arn = "${aws_iam_policy.test-policy.arn}"
}
resource "aws_iam_role" "test-role" {
name = "test-role-%s"
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": [
"spotfleet.amazonaws.com",
"ec2.amazonaws.com"
]
},
"Action": "sts:AssumeRole"
}
]
}
EOF
}
resource "aws_spot_fleet_request" "foo" {
iam_fleet_role = "${aws_iam_role.test-role.arn}"
spot_price = "0.005"
target_capacity = 1
valid_until = "2019-11-04T20:44:20Z"
terminate_instances_with_expiration = true
launch_specification {
instance_type = "m1.small"
ami = "ami-d06a90b0"
ebs_block_device {
device_name = "/dev/xvda"
volume_type = "gp2"
volume_size = "8"
}
ebs_block_device {
device_name = "/dev/xvdcz"
volume_type = "gp2"
volume_size = "100"
}
}
depends_on = ["aws_iam_policy_attachment.test-attach"]
}
provider/aws: Fix spot_fleet request tests Due to the fact that an iam_policy_attachment can only be used once PER iam_policy, these changes create a specific iam_policy for each test, so that when they are ran in parallel we will no longer get the iam_policy_attachment clobbers that we've gotten previously. ``` ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out='=== RUN TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName|n--- PASS: TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName (0.00s)| nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:11:38.420' name='TestAccAWSSpotFleetRequest_CannotUseEmptyKeyName'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzO rSubnetInRegion (54.59s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.046' name='TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz|n--- PASS: TestAccAWSSpotFleetRequest_multipleInstan ceTypesInSameAz (55.50s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:33.937' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (56.05s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:34.492' name='TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withEBSDisk' out='=== RUN TestAccAWSSpotFleetRequest_withEBSDisk|n--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (58.02s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withEBSDisk' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:36.457' name='TestAccAWSSpotFleetRequest_withEBSDisk'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out='=== RUN TestAccAWSSpotFleetRequest_overriddingSpotPrice|n--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (58.84s)|nP ASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_overriddingSpotPrice' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:37.286' name='TestAccAWSSpotFleetRequest_overriddingSpotPrice'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out='=== RUN TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList|n--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubne tInGivenList (60.75s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:39.206' name='TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.362' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out='=== RUN TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet|n--- PASS: TestAccAWSSpotFleetRequest_multip leInstanceTypesInSameSubnet (61.80s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:12:40.241' name='TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out='=== RUN TestAccAWSSpotFleetRequest_changePriceForcesNewRequest|n--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesN ewRequest (98.70s)|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:13:17.142' name='TestAccAWSSpotFleetRequest_changePriceForcesNewRequest'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out='=== RUN TestAccAWSSpotFleetRequest_withWeightedCapacity|n--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (269.12s)|n PASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_withWeightedCapacity' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:16:07.554' name='TestAccAWSSpotFleetRequest_withWeightedCapacity'] ##teamcity[testStarted timestamp='2017-02-08T09:11:38.361' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ##teamcity[testStdOut name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out='=== RUN TestAccAWSSpotFleetRequest_diversifiedAllocation|n--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (348.36s )|nPASS|n'] ##teamcity[testStdErr name='TestAccAWSSpotFleetRequest_diversifiedAllocation' out=''] ##teamcity[testFinished timestamp='2017-02-08T09:17:26.802' name='TestAccAWSSpotFleetRequest_diversifiedAllocation'] ```
2017-02-08 15:20:19 +01:00
`, rInt, rInt, rName)
}