Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resource/aws_api_gateway_integration: Allow update of URI attributes #2834

Merged
merged 2 commits into from
Jan 10, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion aws/resource_aws_api_gateway_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ func resourceAwsApiGatewayIntegration() *schema.Resource {
"uri": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
},

"credentials": {
Expand Down Expand Up @@ -370,6 +369,17 @@ func resourceAwsApiGatewayIntegrationUpdate(d *schema.ResourceData, meta interfa
})
}

// The documentation https://docs.aws.amazon.com/apigateway/api-reference/link-relation/integration-update/ says
// that uri changes are only supported for non-mock types. Because the uri value is not used in mock
// resources, it means that the uri can always be updated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a testcase that updates the URI?

if d.HasChange("uri") {
operations = append(operations, &apigateway.PatchOperation{
Op: aws.String("replace"),
Path: aws.String("/uri"),
Value: aws.String(d.Get("uri").(string)),
})
}

params := &apigateway.UpdateIntegrationInput{
HttpMethod: aws.String(d.Get("http_method").(string)),
ResourceId: aws.String(d.Get("resource_id").(string)),
Expand Down