provider/aws: Respect 'selection_pattern' in api_gateway_integration_response

- Fixes https://github.com/hashicorp/terraform/issues/5891
This commit is contained in:
Radek Simko 2016-03-29 07:47:06 +01:00 committed by Radek Simko
parent 5210e1127e
commit 70242c2e6d

View File

@ -66,7 +66,7 @@ func resourceAwsApiGatewayIntegrationResponseCreate(d *schema.ResourceData, meta
templates[k] = v.(string)
}
_, err := conn.PutIntegrationResponse(&apigateway.PutIntegrationResponseInput{
input := apigateway.PutIntegrationResponseInput{
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)),
@ -74,7 +74,11 @@ func resourceAwsApiGatewayIntegrationResponseCreate(d *schema.ResourceData, meta
ResponseTemplates: aws.StringMap(templates),
// TODO implement once [GH-2143](https://github.com/hashicorp/terraform/issues/2143) has been implemented
ResponseParameters: nil,
})
}
if v, ok := d.GetOk("selection_pattern"); ok {
input.SelectionPattern = aws.String(v.(string))
}
_, err := conn.PutIntegrationResponse(&input)
if err != nil {
return fmt.Errorf("Error creating API Gateway Integration Response: %s", err)
}