diff --git a/lambdas/indexer/.chalice/config.json.template.py b/lambdas/indexer/.chalice/config.json.template.py index 6751ef223..dd77ae946 100644 --- a/lambdas/indexer/.chalice/config.json.template.py +++ b/lambdas/indexer/.chalice/config.json.template.py @@ -25,7 +25,6 @@ "manage_iam_role": False, "iam_role_arn": "${aws_iam_role.%s.arn}" % app_name, "environment_variables": config.lambda_env, - "minimum_compression_size": config.minimum_compression_size, "lambda_timeout": config.api_gateway_lambda_timeout, "lambda_memory_size": 128, **chalice.vpc_lambda_config(app_name), diff --git a/lambdas/service/.chalice/config.json.template.py b/lambdas/service/.chalice/config.json.template.py index 46747fb3d..c40dff944 100644 --- a/lambdas/service/.chalice/config.json.template.py +++ b/lambdas/service/.chalice/config.json.template.py @@ -25,7 +25,6 @@ "manage_iam_role": False, "iam_role_arn": "${aws_iam_role.%s.arn}" % app_name, "environment_variables": config.lambda_env, - "minimum_compression_size": config.minimum_compression_size, "lambda_timeout": config.api_gateway_lambda_timeout, "lambda_memory_size": 2048, **chalice.vpc_lambda_config(app_name), diff --git a/src/azul/terraform.py b/src/azul/terraform.py index 84b5fffad..13cf5c070 100644 --- a/src/azul/terraform.py +++ b/src/azul/terraform.py @@ -793,6 +793,18 @@ 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. + # + rest_api = resources['aws_api_gateway_rest_api'][app_name] + assert 'minimum_compression_size' not in rest_api, rest_api.keys() + openapi_spec = json.loads(locals[app_name]) + key = 'x-amazon-apigateway-minimum-compression-size' + openapi_spec[key] = config.minimum_compression_size + locals[app_name] = json.dumps(openapi_spec) + return { 'resource': resources, 'data': data,