From 70242c2e6dcc8370ff7ad34b44eb51e68c98275a Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Tue, 29 Mar 2016 07:47:06 +0100 Subject: [PATCH] provider/aws: Respect 'selection_pattern' in api_gateway_integration_response - Fixes https://github.com/hashicorp/terraform/issues/5891 --- .../aws/resource_aws_api_gateway_integration_response.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 0f2a9af005..ca85ba0e09 100644 --- a/builtin/providers/aws/resource_aws_api_gateway_integration_response.go +++ b/builtin/providers/aws/resource_aws_api_gateway_integration_response.go @@ -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) }