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

aws_api_gateway_method_response Concurrency #11395

Closed
steve-gray opened this issue Jan 25, 2017 · 4 comments
Closed

aws_api_gateway_method_response Concurrency #11395

steve-gray opened this issue Jan 25, 2017 · 4 comments

Comments

@steve-gray
Copy link

When creating multiple method response codes that live beneath the same method, Terraform will typically fail due to concurrency/conflict errors on the AWS side. It appears that AWS (whilst not documented anywhere visible) is treating the api_gateway_method as the concurrency boundary.

Terraform Version

0.8.2

Affected Resource(s)

Please list the resources as a list, for example:

  • aws_api_gateway_method_response

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Expected Behavior

Multiple response codes should be created correctly for an API response

Actual Behavior

Fails with error such as

 aws_api_gateway_method_response.dummy_function_response1: Error creating API Gateway Method Response: ConflictException: Response already exists for this resource
	status code: 409, request id: 56acda62-e292-11e6-b56a-85b5b33b47bd
* aws_api_gateway_method_response.dummy_function_response3: Error creating API Gateway Method Response: ConflictException: Response already exists for this resource
	status code: 409, request id: 56ae3a9c-e292-11e6-8218-a9497181c142
* aws_api_gateway_method_response.http409: ConflictException: Unable to complete operation due to concurrent modification. Please try again later.
	status code: 409, request id: 56acb348-e292-11e6-8d8e-77f3e0ae3f54
* aws_api_gateway_method_response.http401: ConflictException: Unable to complete operation due to concurrent modification. Please try again later.
	status code: 409, request id: 56ac6527-e292-11e6-8d8e-77f3e0ae3f54
* aws_api_gateway_method_response.dummy_function_response2: Error creating API Gateway Method Response: ConflictException: Unable to complete operation due to concurrent modification. Please try again later.
	status code: 409, request id: 56ac65c5-e292-11e6-99f9-efaae93431b6

Steps to Reproduce

terraform apply where you have an API gateway operation with multiple (2+) HTTP response codes defined which are new and require creating. Subsequent attempts may work as individual responses get created, but will require many retries before the race conditions are not encountered.

@sebolabs
Copy link

sebolabs commented Mar 6, 2017

terraform 0.8.7
I encountered the problem with ConflictException: Unable to complete operation due to concurrent modification. today, two occurrences in 5 minutes and after that it disappeared.
To be safe in the future I just added dependencies on those responses so that they are being created one by one. Hopefully it will help.

@gustavlasko
Copy link

Using terraform 0.9.4, I get the same issue. I attempted to use @sebolabs' workaround, but it seems that I still get the same error, so it appears that terraform doesn't always honor the depends_on.

@skehlet
Copy link

skehlet commented Nov 9, 2017

I made each method depend on the one before it, and that seemed to get me past the ConflictExceptions. 😕

@ghost
Copy link

ghost commented Apr 6, 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 6, 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

6 participants