-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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_rest_api: Add support for content encoding #3642
Conversation
Generally speaking we always tend to stick to API structure and naming conventions if possible and avoid building any abstractions above it as we burnt our fingers by doing so in the past where AWS changes API in a way that it broke our assumptions about such abstractions. We should be able to implement this without having to introduce a new field. Before
Let me know if you need any help in debugging this. |
@radeksimko When I switch my acceptance test to wait a few seconds and manually read the api, the data is validated (suspected eventual consistency) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this is looking good now 👍
Besides my inline comment I have two reservations:
- I tried removing the Sleep and ran the acceptance test a couple of times - couldn't reproduce the issue with eventual consistency. Maybe the API is eventually consistent but don't remember ever experiencing the problem in API Gateway. More importantly if we are really affected by this it should be solved in the CRUD, not just in the test.
- Do you mind also documenting this new field?
(1) I'd be ok with just leaving the sleep out initially and see if anything emerges either as a bug report or in our nightly acceptance tests. If you're able to reproduce it then I'd be keen to see the debug log. 😉
@@ -74,6 +82,10 @@ func resourceAwsApiGatewayRestApiCreate(d *schema.ResourceData, meta interface{} | |||
params.BinaryMediaTypes = expandStringList(binaryMediaTypes.([]interface{})) | |||
} | |||
|
|||
if minimumCompressionSize := d.Get("minimum_compression_size").(int); minimumCompressionSize > -1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Do you mind putting the assignment on a separate line above as we're not checking result of casting? (which is AFAIK the common and often only reasonable use-case for these if one-liners)
- implemented with special -1 value to disable - implement tests - update docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM,
It's totally not a big deal, but for the future we tend to create separate tests for new fields and functionality like this and keep _basic
tests basic 😉
This has been released in version 1.12.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Fix #3144
It appears there is a bug with the method
GetOkExists
which prevents it from being useful in this situation (can't detect set --> unset/disable in config). Regardless it was decided using a special value of-1
keeps the code to 1 variable, and makes the implementation quite clean.The tests finally pass by manually waiting and then reading the apigw. I imagine there might be a more "official" way of getting around the eventual consistency.No eventual consistency issues