Skip to content

Commit

Permalink
resource/aws_launch_configuration: Remove DescribeLaunchConfiguration…
Browse files Browse the repository at this point in the history
…s retries on all errors

Reference: hashicorp/terraform#302
Reference: #13409

Does not seem to be occurring anymore, but could require additional load to manifest. Can re-add explicit retries as necessary.

Output from acceptance testing:

```
--- PASS: TestAccAWSLaunchConfiguration_withSpotPrice (11.31s)
--- PASS: TestAccAWSLaunchConfiguration_ebs_noDevice (13.17s)
--- PASS: TestAccAWSLaunchConfiguration_withBlockDevices (13.44s)
--- PASS: TestAccAWSLaunchConfiguration_withInstanceStoreAMI (13.67s)
--- PASS: TestAccAWSLaunchConfiguration_withEncryption (14.02s)
--- PASS: TestAccAWSLaunchConfiguration_basic (22.34s)
--- PASS: TestAccAWSLaunchConfiguration_withIAMProfile (24.19s)
--- PASS: TestAccAWSLaunchConfiguration_encryptedRootBlockDevice (25.59s)
--- PASS: TestAccAWSLaunchConfiguration_userData (28.60s)
--- PASS: TestAccAWSLaunchConfiguration_RootBlockDevice_VolumeSize (28.91s)
--- PASS: TestAccAWSLaunchConfiguration_updateEbsBlockDevices (30.96s)
--- PASS: TestAccAWSLaunchConfiguration_withVpcClassicLink (32.72s)
--- PASS: TestAccAWSLaunchConfiguration_RootBlockDevice_AmiDisappears (353.93s)
```
  • Loading branch information
bflad committed Jul 21, 2020
1 parent 2228798 commit 5ac0e07
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions aws/resource_aws_launch_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,24 +503,8 @@ func resourceAwsLaunchConfigurationCreate(d *schema.ResourceData, meta interface
}

d.SetId(lcName)
log.Printf("[INFO] launch configuration ID: %s", d.Id())

// We put a Retry here since sometimes eventual consistency bites
// us and we need to retry a few times to get the LC to load properly
err = resource.Retry(30*time.Second, func() *resource.RetryError {
err := resourceAwsLaunchConfigurationRead(d, meta)
if err != nil {
return resource.RetryableError(err)
}
return nil
})
if isResourceTimeoutError(err) {
err = resourceAwsLaunchConfigurationRead(d, meta)
}
if err != nil {
return fmt.Errorf("Error reading launch configuration: %s", err)
}
return nil
return resourceAwsLaunchConfigurationRead(d, meta)
}

func resourceAwsLaunchConfigurationRead(d *schema.ResourceData, meta interface{}) error {
Expand Down

0 comments on commit 5ac0e07

Please sign in to comment.