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

Change to aws_api_gateway_integration destroys all aws_api_gateway_integration_response resources #9877

Closed
irnc opened this issue Nov 4, 2016 · 5 comments

Comments

@irnc
Copy link

irnc commented Nov 4, 2016

Terraform Version

v0.7.8

Affected Resource(s)

  • aws_api_gateway_integration
  • aws_api_gateway_integration_response

Expected Behavior

Change to aws_api_gateway_integration request_templates does not destroy aws_api_gateway_integration_response resources on the same method.

Actual Behavior

Change to aws_api_gateway_integration request_templates destroys all aws_api_gateway_integration_response resources on the same method.

Steps to Reproduce

  1. terraform apply
@highlyunavailable
Copy link

We just ran into this behavior while deploying to production. Fortunately it can be worked around by running terraform apply twice before creating a deployment but it's still annoying and unexpected.

@Jeiwan
Copy link

Jeiwan commented Feb 13, 2017

Terraform v0.8.5
I came across this bug today. Modifying aws_api_gateway_integration.request_templates results in the related api_integration_response being deleted. The deletion is not shown in a plan though:

➜  terraform git:(master) ✗ terraform apply plan
module.clickstream_api.aws_api_gateway_integration.api_integration: Modifying...
  request_templates.application/json: ...omitted...
module.clickstream_api.aws_api_gateway_integration.api_integration: Modifications complete

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

Right after that command I don't see the integration response in AWS web-interface; related endpoints start to fail. Rerunning terraform plan and terraform apply solves the problem:

+ module.clickstream_api.aws_api_gateway_integration_response.api_integration_response
    http_method:                                                            "POST"
    resource_id:                                                            "4o74kk"
    response_parameters.%:                                                  "1"
    response_parameters.method.response.header.Access-Control-Allow-Origin: "'*'"
    response_templates.%:                                                   "1"
    response_templates.application/json:                                    "{\n  \"response\": $input.body\n}\n"
    rest_api_id:                                                            "9i8sauxw3k"
    status_code:                                                            "200"


Plan: 1 to add, 0 to change, 0 to destroy.

@sebolabs
Copy link

sebolabs commented Feb 24, 2017

same problem here :(
terraform 0.8.7

@naikajah
Copy link

Terraform v8.7
I accidently got into this problem with api_gateway_integration_response configuration getting destroyed everytime terraform sees a change in api_gateway_integration configuration.

The other issue which got me into the above bug is a bit odd and relates to using MOCK endpoint. The URI parameter used for api_gateway_integration even though the value is same in every plan/apply, terraform sees it as a change. The tfstate file is getting updated with the same value everytime.

@ghost
Copy link

ghost commented Apr 10, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants