From c5d660d994fee6f0c8f03d1e69f477dc5a58dc96 Mon Sep 17 00:00:00 2001 From: Daniel Sotirhos Date: Wed, 7 Aug 2024 11:57:26 -0700 Subject: [PATCH] fixup! Fix: Service responses are not compressed (#6360) --- src/azul/terraform.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/azul/terraform.py b/src/azul/terraform.py index 13cf5c070..012054593 100644 --- a/src/azul/terraform.py +++ b/src/azul/terraform.py @@ -793,13 +793,15 @@ def tf_config(self, app_name): del deployment['lifecycle'] deployment['triggers'] = {'redeployment': deployment.pop('stage_description')} - # Instead of specifying this property in the related Terraform - # resource, using an AWS API Gateway extension to the OpenAPI - # specification lets us avoid maintaining a complicated trigger - # dependency between Terraform resources. + # Using Terraform to specify the REST API minimum compression size + # proved to be problematic as first an UpdateRestApi call would be made + # to set the property, followed by a PutRestApi call with mode=overwrite + # which would reset the property back to its default value of disabled. + # Using AWS API Gateway extensions to the OpenAPI specification to set + # this property instead works around this issue. # rest_api = resources['aws_api_gateway_rest_api'][app_name] - assert 'minimum_compression_size' not in rest_api, rest_api.keys() + assert 'minimum_compression_size' not in rest_api, rest_api openapi_spec = json.loads(locals[app_name]) key = 'x-amazon-apigateway-minimum-compression-size' openapi_spec[key] = config.minimum_compression_size