From f8731c0a20cc76949122ba175f87e57b5616d22a Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Wed, 29 Jul 2020 08:11:46 -0400 Subject: [PATCH] resource/aws_spot_fleet_request: Capture additional IAM eventual consistency error during RequestSpotFleet (#14358) Reference: https://github.com/terraform-providers/terraform-provider-aws/pull/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) ``` --- aws/resource_aws_spot_fleet_request.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_spot_fleet_request.go b/aws/resource_aws_spot_fleet_request.go index a3b5cabe689..a2d3d23c89e 100644 --- a/aws/resource_aws_spot_fleet_request.go +++ b/aws/resource_aws_spot_fleet_request.go @@ -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) }