Skip to content

Commit

Permalink
fixup! Fix: Service responses are not compressed (#6360)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsotirho-ucsc committed Aug 7, 2024
1 parent a2c7dae commit c5d660d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/azul/terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c5d660d

Please sign in to comment.