From 5ac0e0724a2fcaf5932ebb651c29f398183291c6 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Tue, 21 Jul 2020 00:15:26 -0400 Subject: [PATCH] resource/aws_launch_configuration: Remove DescribeLaunchConfigurations retries on all errors Reference: https://github.com/hashicorp/terraform/issues/302 Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/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) ``` --- aws/resource_aws_launch_configuration.go | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/aws/resource_aws_launch_configuration.go b/aws/resource_aws_launch_configuration.go index d15ca4e3115..0ee9ca65c37 100644 --- a/aws/resource_aws_launch_configuration.go +++ b/aws/resource_aws_launch_configuration.go @@ -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 {