Skip to content

Commit

Permalink
resource/aws_spot_fleet_request: Capture additional IAM eventual cons…
Browse files Browse the repository at this point in the history
…istency error during RequestSpotFleet

Reference: #14265

Previously (inconsistently!):

```
TestAccAWSSpotFleetRequest_iamInstanceProfileArn: testing.go:684: Step 0 error: errors during apply:
Error: Error requesting spot fleet: InvalidSpotFleetRequestConfig: The provided SpotFleetRequestConfig.IamFleetRole does not have permission to call DescribeSubnet.
```

Output from acceptance testing:

```
--- PASS: TestAccAWSSpotFleetRequest_associatePublicIpAddress (357.30s)
--- PASS: TestAccAWSSpotFleetRequest_basic (345.77s)
--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (624.59s)
--- PASS: TestAccAWSSpotFleetRequest_disappears (282.46s)
--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (862.86s)
--- PASS: TestAccAWSSpotFleetRequest_fleetType (347.01s)
--- PASS: TestAccAWSSpotFleetRequest_iamInstanceProfileArn (345.46s)
--- PASS: TestAccAWSSpotFleetRequest_instanceInterruptionBehavior (292.74s)
--- PASS: TestAccAWSSpotFleetRequest_LaunchSpecification_EbsBlockDevice_KmsKeyId (140.49s)
--- PASS: TestAccAWSSpotFleetRequest_LaunchSpecification_RootBlockDevice_KmsKeyId (142.89s)
--- PASS: TestAccAWSSpotFleetRequest_launchSpecToLaunchTemplate (552.78s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplate (212.21s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplate_multiple (203.07s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplateToLaunchSpec (624.12s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplateWithOverrides (273.68s)
--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (253.37s)
--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (347.63s)
--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (253.01s)
--- PASS: TestAccAWSSpotFleetRequest_multipleInstancePools (548.08s)
--- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (253.77s)
--- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (262.55s)
--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (535.56s)
--- PASS: TestAccAWSSpotFleetRequest_placementTenancyAndGroup (60.24s)
--- PASS: TestAccAWSSpotFleetRequest_tags (282.26s)
--- PASS: TestAccAWSSpotFleetRequest_updateExcessCapacityTerminationPolicy (624.59s)
--- PASS: TestAccAWSSpotFleetRequest_updateTargetCapacity (970.38s)
--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (230.13s)
--- PASS: TestAccAWSSpotFleetRequest_WithELBs (284.19s)
--- PASS: TestAccAWSSpotFleetRequest_withoutSpotPrice (525.74s)
--- PASS: TestAccAWSSpotFleetRequest_withTags (270.52s)
--- PASS: TestAccAWSSpotFleetRequest_WithTargetGroups (432.60s)
--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (252.23s)
```
  • Loading branch information
bflad committed Jul 27, 2020
1 parent e0dd196 commit d70a6ff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions aws/resource_aws_spot_fleet_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,10 @@ func resourceAwsSpotFleetRequestCreate(d *schema.ResourceData, meta interface{})
return resource.RetryableError(err)
}

if isAWSErr(err, "InvalidSpotFleetRequestConfig", "The provided SpotFleetRequestConfig.IamFleetRole does not have permission to call") {
return resource.RetryableError(err)
}

if err != nil {
return resource.NonRetryableError(err)
}
Expand Down

0 comments on commit d70a6ff

Please sign in to comment.