Skip to content

Commit

Permalink
Merge pull request #237 from epam/fix/ignored_request_parameters_in_a…
Browse files Browse the repository at this point in the history
…pi_lambda_integration

fix ignored request parameters
  • Loading branch information
bohdan-onsha authored Sep 20, 2023
2 parents c888d78 + 108144c commit 1ce1b50
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ 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

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand Down
8 changes: 7 additions & 1 deletion syndicate/connection/api_gateway_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion syndicate/core/resources/api_gateway_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 1ce1b50

Please sign in to comment.