From d84081cc6d274d6dc9b065511b10a13cb0c69c8e Mon Sep 17 00:00:00 2001 From: Vladyslav Hunko Date: Wed, 20 Sep 2023 14:12:54 +0300 Subject: [PATCH 1/2] fix ignored request parameters --- CHANGELOG.md | 1 + syndicate/connection/api_gateway_connection.py | 8 +++++++- syndicate/core/resources/api_gateway_resource.py | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f318c180..71deeb27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # [1.3.1] - 2023-09-20 - Add support Python 3.10 and Python 3.11 +- Fixed ignored request parameters when creating api gateway's resource method using lambda integration # [1.3.0] - 2023-09-14 - Added ability to use SSO credentials diff --git a/syndicate/connection/api_gateway_connection.py b/syndicate/connection/api_gateway_connection.py index b1f9130a..4f123b78 100644 --- a/syndicate/connection/api_gateway_connection.py +++ b/syndicate/connection/api_gateway_connection.py @@ -323,7 +323,8 @@ def create_lambda_integration(self, lambda_arn, api_id, resource_id, passthrough_behavior=None, credentials=None, enable_proxy=False, - cache_key_parameters=None): + cache_key_parameters=None, + request_parameters=None): """ Create API Gateway integration with lambda by name. :type lambda_arn: str @@ -336,6 +337,9 @@ def create_lambda_integration(self, lambda_arn, api_id, resource_id, :type lambda_region: str :type credentials: str :param credentials: role arn + :type request_parameters: dict + :param request_parameters: A key-value map specifying request parameters + (path, query string, header) """ uri = ('arn:aws:apigateway:{0}:lambda:path/2015-03-31/functions/{1}' '/invocations').format(self.region, lambda_arn) @@ -353,6 +357,8 @@ def create_lambda_integration(self, lambda_arn, api_id, resource_id, params['request_templates'] = request_templates if cache_key_parameters: params['cache_key_parameters'] = cache_key_parameters + if request_parameters: + params['request_parameters'] = request_parameters self.create_integration(**params) def create_service_integration(self, acc_id, api_id, resource_id, diff --git a/syndicate/core/resources/api_gateway_resource.py b/syndicate/core/resources/api_gateway_resource.py index 049ab32f..bfb4e682 100644 --- a/syndicate/core/resources/api_gateway_resource.py +++ b/syndicate/core/resources/api_gateway_resource.py @@ -599,7 +599,8 @@ def _create_method_from_metadata( lambda_arn, api_id, resource_id, method, body_template, passthrough_behavior, method_meta.get('lambda_region'), enable_proxy=enable_proxy, - cache_key_parameters=cache_key_parameters) + cache_key_parameters=cache_key_parameters, + request_parameters=request_parameters) # add permissions to invoke # Allows to apply method or resource singleton of a policy # statement, setting wildcard on the respective scope. From 108144c62bca06d298cb0fe1c2d7c9c358210e6f Mon Sep 17 00:00:00 2001 From: Vladyslav Hunko Date: Wed, 20 Sep 2023 15:45:42 +0300 Subject: [PATCH 2/2] update version --- CHANGELOG.md | 4 +++- setup.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71deeb27..6a197916 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +# [1.3.2] - 2023-09-20 +- Fixed ignored request parameters when creating api gateway's resource method using lambda integration + # [1.3.1] - 2023-09-20 - Add support Python 3.10 and Python 3.11 -- Fixed ignored request parameters when creating api gateway's resource method using lambda integration # [1.3.0] - 2023-09-14 - Added ability to use SSO credentials diff --git a/setup.py b/setup.py index 3d0e553f..98ee04af 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ setup( name='aws-syndicate', - version='1.3.1', + version='1.3.2', packages=find_packages(), include_package_data=True, install_requires=[