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

resource/aws_spot_instance_request: Add support for instance_interruption_behaviour #1735

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Sep 23, 2017

Fixes: #1719

terraform-provider-aws [f-aws-spot-instance-instance-interuption-1719●] % acctests aws TestAccAWSSpotInstanceRequest_
=== RUN   TestAccAWSSpotInstanceRequest_basic
--- PASS: TestAccAWSSpotInstanceRequest_basic (87.41s)
=== RUN   TestAccAWSSpotInstanceRequest_withLaunchGroup
--- PASS: TestAccAWSSpotInstanceRequest_withLaunchGroup (86.44s)
=== RUN   TestAccAWSSpotInstanceRequest_withBlockDuration
--- PASS: TestAccAWSSpotInstanceRequest_withBlockDuration (98.23s)
=== RUN   TestAccAWSSpotInstanceRequest_vpc
--- FAIL: TestAccAWSSpotInstanceRequest_vpc (109.52s)
	testing.go:434: Step 0 error: Check failed: Check 4/6 error: SubnetID was not passed, but should have been for this instance to belong to a VPC
=== RUN   TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress
--- PASS: TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress (241.27s)
=== RUN   TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes
--- PASS: TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes (121.28s)
FAIL
exit status 1
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	744.186s

I believe the acceptance test failure above is unrelated

…tion_behaviour

Fixes: hashicorp#1719

This has a dependency on hashicorp#1734 to be merged first due to it using the new SDK behaviour

```
=== RUN   TestAccAWSSpotInstanceRequest_basic
--- PASS: TestAccAWSSpotInstanceRequest_basic (87.41s)
=== RUN   TestAccAWSSpotInstanceRequest_withLaunchGroup
--- PASS: TestAccAWSSpotInstanceRequest_withLaunchGroup (86.44s)
=== RUN   TestAccAWSSpotInstanceRequest_withBlockDuration
--- PASS: TestAccAWSSpotInstanceRequest_withBlockDuration (98.23s)
```
@stack72 stack72 force-pushed the f-aws-spot-instance-instance-interuption-1719 branch from ccf3f81 to 5d6ba9d Compare September 25, 2017 11:37
@radeksimko radeksimko added the enhancement Requests to existing resources that expand the functionality or scope. label Sep 27, 2017
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@tomelliff
Copy link
Contributor

Has anyone tested that this works? I was hoping to see a test for the stopped side as well but don't see one there. Testing it now I'm getting:

Error requesting spot instances: InvalidParameterCombination: The parameter GroupName within placement information cannot be specified when instanceInterruptionBehavior is set to 'stop'

I'm not specifying a placement group but looking at the code at https://github.com/terraform-providers/terraform-provider-aws/blob/aa626d6ac98b2ae0c9a8281209cdbc65900d9e5c/aws/resource_aws_instance.go#L1596-L1599 it looks like it might be being set but passed as an empty string anyway?

@ghost
Copy link

ghost commented Apr 10, 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 10, 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InstanceInterruptionBehavior Support
3 participants