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_fleet_request: Increase default delete timeout to 15 minutes #13922

Merged
merged 1 commit into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aws/resource_aws_spot_fleet_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func resourceAwsSpotFleetRequest() *schema.Resource {
},
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(10 * time.Minute),
Delete: schema.DefaultTimeout(5 * time.Minute),
Delete: schema.DefaultTimeout(15 * time.Minute),
},

SchemaVersion: 1,
Expand Down
18 changes: 4 additions & 14 deletions aws/resource_aws_spot_fleet_request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func testSweepSpotFleetRequests(region string) error {
id := aws.StringValue(config.SpotFleetRequestId)

log.Printf("[INFO] Deleting Spot Fleet Request: %s", id)
err := deleteSpotFleetRequest(id, true, 5*time.Minute, conn)
err := deleteSpotFleetRequest(id, true, 15*time.Minute, conn)
if err != nil {
log.Printf("[ERROR] Failed to delete Spot Fleet Request (%s): %s", id, err)
}
Expand Down Expand Up @@ -261,7 +261,7 @@ func TestAccAWSSpotFleetRequest_launchTemplateToLaunchSpec(t *testing.T) {
validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339)
resourceName := "aws_spot_fleet_request.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy,
Expand Down Expand Up @@ -302,7 +302,7 @@ func TestAccAWSSpotFleetRequest_launchSpecToLaunchTemplate(t *testing.T) {
validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339)
resourceName := "aws_spot_fleet_request.test"

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy,
Expand Down Expand Up @@ -1146,7 +1146,7 @@ func TestAccAWSSpotFleetRequest_disappears(t *testing.T) {
Config: testAccAWSSpotFleetRequestConfig(rName, rInt, validUntil),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckAWSSpotFleetRequestExists(resourceName, &sfr),
testAccCheckAWSSpotFleetRequestDisappears(&sfr),
testAccCheckResourceDisappears(testAccProvider, resourceAwsSpotFleetRequest(), resourceName),
),
ExpectNonEmptyPlan: true,
},
Expand Down Expand Up @@ -1197,16 +1197,6 @@ func testAccCheckAWSSpotFleetRequestExists(
}
}

func testAccCheckAWSSpotFleetRequestDisappears(sfr *ec2.SpotFleetRequestConfig) resource.TestCheckFunc {
return func(s *terraform.State) error {
conn := testAccProvider.Meta().(*AWSClient).ec2conn
sfrId := aws.StringValue(sfr.SpotFleetRequestId)
err := deleteSpotFleetRequest(sfrId, true, 5*time.Minute, conn)

return err
}
}

func testAccCheckAWSSpotFleetRequestDestroy(s *terraform.State) error {
conn := testAccProvider.Meta().(*AWSClient).ec2conn

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/spot_fleet_request.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ The `launch_template_config` block supports the following:
The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions:

* `create` - (Defaults to 10 mins) Used when requesting the spot instance (only valid if `wait_for_fulfillment = true`)
* `delete` - (Defaults to 5 mins) Used when destroying the spot instance
* `delete` - (Defaults to 15 mins) Used when destroying the spot instance

## Attributes Reference

Expand Down