Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spot price optional for SIR, SFR #4424

Merged
merged 1 commit into from
May 7, 2018

Conversation

YakDriver
Copy link
Member

@YakDriver YakDriver commented May 2, 2018

Code + tests + docs
Fixes #3548, formerly #3549 (closed)

@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label May 2, 2018
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. labels May 4, 2018
@bflad bflad added this to the v1.18.0 milestone May 4, 2018
@@ -1511,6 +1511,87 @@ resource "aws_spot_fleet_request" "foo" {
`, rName, rInt, rInt, rName)
}

func testAccAWSSpotFleetRequestConfigWithoutSpotPrice(rName string, rInt int) string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is in great shape -- only item is that this new test configuration does not look like its being called. If you fix that up then we should be able to get this in 👍

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label May 4, 2018
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label May 4, 2018
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label May 4, 2018
@YakDriver
Copy link
Member Author

@bflad I added the call and squashed the commits. (But, I find I get 100% pass on tests that are never called. 👍 )

@bflad
Copy link
Contributor

bflad commented May 4, 2018

I find I get 100% pass on tests that are never called. 👍

You should get this made into a poster, I would buy it! 😄

@bflad bflad removed the waiting-response Maintainers are waiting on response from community or contributor. label May 4, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was good except it was failing the new acceptance test:

=== RUN   TestAccAWSSpotFleetRequest_withoutSpotPrice
--- FAIL: TestAccAWSSpotFleetRequest_withoutSpotPrice (611.19s)
    testing.go:518: Step 0 error: Error applying: 1 error(s) occurred:
        
        * aws_spot_fleet_request.foo: 1 error(s) occurred:
        
        * aws_spot_fleet_request.foo: Error requesting spot fleet: [WARN] Error creating Spot fleet request, retrying: InvalidSpotFleetRequestConfig: Parameter: SpotFleetRequestConfig.SpotPrice is invalid.
            status code: 400, request id: 92438345-84ab-4f69-8c94-e3e33f3bc778

I added a very simple commit after yours to fix this logic: 1775af4

Now passes all acceptance testing:

28 tests passed (all tests)
=== RUN   TestAccAWSSpotFleetRequest_placementTenancy
--- PASS: TestAccAWSSpotFleetRequest_placementTenancy (65.83s)
=== RUN   TestAccAWSSpotInstanceRequest_basic
--- PASS: TestAccAWSSpotInstanceRequest_basic (97.40s)
=== RUN   TestAccAWSSpotInstanceRequest_withBlockDuration
--- PASS: TestAccAWSSpotInstanceRequest_withBlockDuration (117.69s)
=== RUN   TestAccAWSSpotInstanceRequest_withLaunchGroup
--- PASS: TestAccAWSSpotInstanceRequest_withLaunchGroup (159.11s)
=== RUN   TestAccAWSSpotInstanceRequest_vpc
--- PASS: TestAccAWSSpotInstanceRequest_vpc (105.19s)
=== RUN   TestAccAWSSpotInstanceRequest_validUntil
--- PASS: TestAccAWSSpotInstanceRequest_validUntil (120.20s)
=== RUN   TestAccAWSSpotFleetRequest_diversifiedAllocation
--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (277.25s)
=== RUN   TestAccAWSSpotFleetRequest_withoutSpotPrice
--- PASS: TestAccAWSSpotFleetRequest_withoutSpotPrice (277.86s)
=== RUN   TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz
--- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (283.10s)
=== RUN   TestAccAWSSpotFleetRequest_withTags
--- PASS: TestAccAWSSpotFleetRequest_withTags (291.90s)
=== RUN   TestAccAWSSpotFleetRequest_overriddingSpotPrice
--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (345.10s)
=== RUN   TestAccAWSSpotFleetRequest_withEBSDisk
--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (346.76s)
=== RUN   TestAccAWSSpotFleetRequest_instanceInterruptionBehavior
--- PASS: TestAccAWSSpotFleetRequest_instanceInterruptionBehavior (350.67s)
=== RUN   TestAccAWSSpotFleetRequest_withWeightedCapacity
--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (350.88s)
=== RUN   TestAccAWSSpotFleetRequest_associatePublicIpAddress
--- PASS: TestAccAWSSpotFleetRequest_associatePublicIpAddress (351.47s)
=== RUN   TestAccAWSSpotInstanceRequestInterruptStop
--- PASS: TestAccAWSSpotInstanceRequestInterruptStop (74.21s)
=== RUN   TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList
--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (352.55s)
=== RUN   TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet
--- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (353.52s)
=== RUN   TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion
--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (357.92s)
=== RUN   TestAccAWSSpotInstanceRequestInterruptHibernate
--- PASS: TestAccAWSSpotInstanceRequestInterruptHibernate (93.35s)
=== RUN   TestAccAWSSpotFleetRequest_WithELBs
--- PASS: TestAccAWSSpotFleetRequest_WithELBs (371.63s)
=== RUN   TestAccAWSSpotInstanceRequest_withoutSpotPrice
--- PASS: TestAccAWSSpotInstanceRequest_withoutSpotPrice (255.71s)
=== RUN   TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList
--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (400.98s)
=== RUN   TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes
--- PASS: TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes (269.25s)
=== RUN   TestAccAWSSpotFleetRequest_WithTargetGroups
--- PASS: TestAccAWSSpotFleetRequest_WithTargetGroups (450.56s)
=== RUN   TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress
--- PASS: TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress (298.71s)
=== RUN   TestAccAWSSpotInstanceRequest_getPasswordData
--- PASS: TestAccAWSSpotInstanceRequest_getPasswordData (339.58s)
=== RUN   TestAccAWSSpotFleetRequest_changePriceForcesNewRequest
--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (608.02s)

@bflad bflad merged commit 1588469 into hashicorp:master May 7, 2018
bflad added a commit that referenced this pull request May 7, 2018
@YakDriver
Copy link
Member Author

@bflad This is phenomenal! Thanks for your help and merge. When I get those t-shirts made, you'll get the first.

@bflad
Copy link
Contributor

bflad commented May 10, 2018

This has been released in version 1.18.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 6, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. size/L Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spot price should be optional in aws_spot_instance_request resource
2 participants