provider/aws: Remove unnecessary GetChange in Delete funcs
This commit is contained in:
parent
b12d906258
commit
fa0d6af524
|
@ -161,25 +161,11 @@ func resourceAwsApiGatewayIntegrationDelete(d *schema.ResourceData, meta interfa
|
||||||
conn := meta.(*AWSClient).apigateway
|
conn := meta.(*AWSClient).apigateway
|
||||||
log.Printf("[DEBUG] Deleting API Gateway Integration: %s", d.Id())
|
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 {
|
return resource.Retry(5*time.Minute, func() error {
|
||||||
log.Printf("[DEBUG] schema is %#v", d)
|
|
||||||
_, err := conn.DeleteIntegration(&apigateway.DeleteIntegrationInput{
|
_, err := conn.DeleteIntegration(&apigateway.DeleteIntegrationInput{
|
||||||
HttpMethod: aws.String(httpMethod),
|
HttpMethod: aws.String(d.Get("http_method").(string)),
|
||||||
ResourceId: aws.String(resourceId),
|
ResourceId: aws.String(d.Get("resource_id").(string)),
|
||||||
RestApiId: aws.String(restApiID),
|
RestApiId: aws.String(d.Get("rest_api_id").(string)),
|
||||||
})
|
})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -116,30 +116,12 @@ func resourceAwsApiGatewayIntegrationResponseDelete(d *schema.ResourceData, meta
|
||||||
conn := meta.(*AWSClient).apigateway
|
conn := meta.(*AWSClient).apigateway
|
||||||
log.Printf("[DEBUG] Deleting API Gateway Integration Response: %s", d.Id())
|
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 {
|
return resource.Retry(5*time.Minute, func() error {
|
||||||
log.Printf("[DEBUG] schema is %#v", d)
|
|
||||||
_, err := conn.DeleteIntegrationResponse(&apigateway.DeleteIntegrationResponseInput{
|
_, err := conn.DeleteIntegrationResponse(&apigateway.DeleteIntegrationResponseInput{
|
||||||
HttpMethod: aws.String(httpMethod),
|
HttpMethod: aws.String(d.Get("http_method").(string)),
|
||||||
ResourceId: aws.String(resourceId),
|
ResourceId: aws.String(d.Get("resource_id").(string)),
|
||||||
RestApiId: aws.String(restApiID),
|
RestApiId: aws.String(d.Get("rest_api_id").(string)),
|
||||||
StatusCode: aws.String(statusCode),
|
StatusCode: aws.String(d.Get("status_code").(string)),
|
||||||
})
|
})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -154,25 +154,11 @@ func resourceAwsApiGatewayMethodDelete(d *schema.ResourceData, meta interface{})
|
||||||
conn := meta.(*AWSClient).apigateway
|
conn := meta.(*AWSClient).apigateway
|
||||||
log.Printf("[DEBUG] Deleting API Gateway Method: %s", d.Id())
|
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 {
|
return resource.Retry(5*time.Minute, func() error {
|
||||||
log.Printf("[DEBUG] schema is %#v", d)
|
|
||||||
_, err := conn.DeleteMethod(&apigateway.DeleteMethodInput{
|
_, err := conn.DeleteMethod(&apigateway.DeleteMethodInput{
|
||||||
HttpMethod: aws.String(httpMethod),
|
HttpMethod: aws.String(d.Get("http_method").(string)),
|
||||||
ResourceId: aws.String(resourceId),
|
ResourceId: aws.String(d.Get("resource_id").(string)),
|
||||||
RestApiId: aws.String(restApiID),
|
RestApiId: aws.String(d.Get("rest_api_id").(string)),
|
||||||
})
|
})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -136,30 +136,12 @@ func resourceAwsApiGatewayMethodResponseDelete(d *schema.ResourceData, meta inte
|
||||||
conn := meta.(*AWSClient).apigateway
|
conn := meta.(*AWSClient).apigateway
|
||||||
log.Printf("[DEBUG] Deleting API Gateway Method Response: %s", d.Id())
|
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 {
|
return resource.Retry(5*time.Minute, func() error {
|
||||||
log.Printf("[DEBUG] schema is %#v", d)
|
|
||||||
_, err := conn.DeleteMethodResponse(&apigateway.DeleteMethodResponseInput{
|
_, err := conn.DeleteMethodResponse(&apigateway.DeleteMethodResponseInput{
|
||||||
HttpMethod: aws.String(httpMethod),
|
HttpMethod: aws.String(d.Get("http_method").(string)),
|
||||||
ResourceId: aws.String(resourceId),
|
ResourceId: aws.String(d.Get("resource_id").(string)),
|
||||||
RestApiId: aws.String(restApiID),
|
RestApiId: aws.String(d.Get("rest_api_id").(string)),
|
||||||
StatusCode: aws.String(statusCode),
|
StatusCode: aws.String(d.Get("status_code").(string)),
|
||||||
})
|
})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue