diff --git a/builtin/providers/aws/resource_aws_api_gateway_integration.go b/builtin/providers/aws/resource_aws_api_gateway_integration.go index b9bbae20d..01e90968f 100644 --- a/builtin/providers/aws/resource_aws_api_gateway_integration.go +++ b/builtin/providers/aws/resource_aws_api_gateway_integration.go @@ -161,25 +161,11 @@ func resourceAwsApiGatewayIntegrationDelete(d *schema.ResourceData, meta interfa conn := meta.(*AWSClient).apigateway log.Printf("[DEBUG] Deleting API Gateway Integration: %s", d.Id()) - resourceId := d.Get("resource_id").(string) - if o, n := d.GetChange("resource_id"); o.(string) != n.(string) { - resourceId = o.(string) - } - httpMethod := d.Get("http_method").(string) - if o, n := d.GetChange("http_method"); o.(string) != n.(string) { - httpMethod = o.(string) - } - restApiID := d.Get("rest_api_id").(string) - if o, n := d.GetChange("rest_api_id"); o.(string) != n.(string) { - restApiID = o.(string) - } - return resource.Retry(5*time.Minute, func() error { - log.Printf("[DEBUG] schema is %#v", d) _, err := conn.DeleteIntegration(&apigateway.DeleteIntegrationInput{ - HttpMethod: aws.String(httpMethod), - ResourceId: aws.String(resourceId), - RestApiId: aws.String(restApiID), + HttpMethod: aws.String(d.Get("http_method").(string)), + ResourceId: aws.String(d.Get("resource_id").(string)), + RestApiId: aws.String(d.Get("rest_api_id").(string)), }) if err == nil { return nil diff --git a/builtin/providers/aws/resource_aws_api_gateway_integration_response.go b/builtin/providers/aws/resource_aws_api_gateway_integration_response.go index 48500ab44..c8b629a69 100644 --- a/builtin/providers/aws/resource_aws_api_gateway_integration_response.go +++ b/builtin/providers/aws/resource_aws_api_gateway_integration_response.go @@ -116,30 +116,12 @@ func resourceAwsApiGatewayIntegrationResponseDelete(d *schema.ResourceData, meta conn := meta.(*AWSClient).apigateway log.Printf("[DEBUG] Deleting API Gateway Integration Response: %s", d.Id()) - resourceId := d.Get("resource_id").(string) - if o, n := d.GetChange("resource_id"); o.(string) != n.(string) { - resourceId = o.(string) - } - httpMethod := d.Get("http_method").(string) - if o, n := d.GetChange("http_method"); o.(string) != n.(string) { - httpMethod = o.(string) - } - restApiID := d.Get("rest_api_id").(string) - if o, n := d.GetChange("rest_api_id"); o.(string) != n.(string) { - restApiID = o.(string) - } - statusCode := d.Get("status_code").(string) - if o, n := d.GetChange("status_code"); o.(string) != n.(string) { - statusCode = o.(string) - } - return resource.Retry(5*time.Minute, func() error { - log.Printf("[DEBUG] schema is %#v", d) _, err := conn.DeleteIntegrationResponse(&apigateway.DeleteIntegrationResponseInput{ - HttpMethod: aws.String(httpMethod), - ResourceId: aws.String(resourceId), - RestApiId: aws.String(restApiID), - StatusCode: aws.String(statusCode), + HttpMethod: aws.String(d.Get("http_method").(string)), + ResourceId: aws.String(d.Get("resource_id").(string)), + RestApiId: aws.String(d.Get("rest_api_id").(string)), + StatusCode: aws.String(d.Get("status_code").(string)), }) if err == nil { return nil diff --git a/builtin/providers/aws/resource_aws_api_gateway_method.go b/builtin/providers/aws/resource_aws_api_gateway_method.go index 36e123657..c5c1da391 100644 --- a/builtin/providers/aws/resource_aws_api_gateway_method.go +++ b/builtin/providers/aws/resource_aws_api_gateway_method.go @@ -154,25 +154,11 @@ func resourceAwsApiGatewayMethodDelete(d *schema.ResourceData, meta interface{}) conn := meta.(*AWSClient).apigateway log.Printf("[DEBUG] Deleting API Gateway Method: %s", d.Id()) - resourceId := d.Get("resource_id").(string) - if o, n := d.GetChange("resource_id"); o.(string) != n.(string) { - resourceId = o.(string) - } - httpMethod := d.Get("http_method").(string) - if o, n := d.GetChange("http_method"); o.(string) != n.(string) { - httpMethod = o.(string) - } - restApiID := d.Get("rest_api_id").(string) - if o, n := d.GetChange("rest_api_id"); o.(string) != n.(string) { - restApiID = o.(string) - } - return resource.Retry(5*time.Minute, func() error { - log.Printf("[DEBUG] schema is %#v", d) _, err := conn.DeleteMethod(&apigateway.DeleteMethodInput{ - HttpMethod: aws.String(httpMethod), - ResourceId: aws.String(resourceId), - RestApiId: aws.String(restApiID), + HttpMethod: aws.String(d.Get("http_method").(string)), + ResourceId: aws.String(d.Get("resource_id").(string)), + RestApiId: aws.String(d.Get("rest_api_id").(string)), }) if err == nil { return nil diff --git a/builtin/providers/aws/resource_aws_api_gateway_method_response.go b/builtin/providers/aws/resource_aws_api_gateway_method_response.go index 41b35159a..3d77b2ea7 100644 --- a/builtin/providers/aws/resource_aws_api_gateway_method_response.go +++ b/builtin/providers/aws/resource_aws_api_gateway_method_response.go @@ -136,30 +136,12 @@ func resourceAwsApiGatewayMethodResponseDelete(d *schema.ResourceData, meta inte conn := meta.(*AWSClient).apigateway log.Printf("[DEBUG] Deleting API Gateway Method Response: %s", d.Id()) - resourceId := d.Get("resource_id").(string) - if o, n := d.GetChange("resource_id"); o.(string) != n.(string) { - resourceId = o.(string) - } - httpMethod := d.Get("http_method").(string) - if o, n := d.GetChange("http_method"); o.(string) != n.(string) { - httpMethod = o.(string) - } - restApiID := d.Get("rest_api_id").(string) - if o, n := d.GetChange("rest_api_id"); o.(string) != n.(string) { - restApiID = o.(string) - } - statusCode := d.Get("status_code").(string) - if o, n := d.GetChange("status_code"); o.(string) != n.(string) { - statusCode = o.(string) - } - return resource.Retry(5*time.Minute, func() error { - log.Printf("[DEBUG] schema is %#v", d) _, err := conn.DeleteMethodResponse(&apigateway.DeleteMethodResponseInput{ - HttpMethod: aws.String(httpMethod), - ResourceId: aws.String(resourceId), - RestApiId: aws.String(restApiID), - StatusCode: aws.String(statusCode), + HttpMethod: aws.String(d.Get("http_method").(string)), + ResourceId: aws.String(d.Get("resource_id").(string)), + RestApiId: aws.String(d.Get("rest_api_id").(string)), + StatusCode: aws.String(d.Get("status_code").(string)), }) if err == nil { return nil