Skip to content

Commit

Permalink
invoke_lambda_async accepts dict, moves to bytes payload
Browse files Browse the repository at this point in the history
  • Loading branch information
cschneider-vertical-relevance committed May 5, 2022
1 parent bf1e4b8 commit b29aacb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions stacks/handlers_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ def endpoint(self):
)
)

# self.api.add_api_handler(
# "CloudFormation", lambda_invoked_by_apigw_cloudformation, "/CloudFormation"
# )
self.api.add_api_handler(
"CloudFormation", lambda_invoked_by_apigw_cloudformation, "/CloudFormation"
)

def eval_engine(self):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ def generate_uuid():

return s3_uri

def invoke_lambda_async(*,function_name,payload):
def invoke_lambda_async(*,function_name,payload:dict):

try:
r = lambda_.invoke(
FunctionName=function_name,
InvocationType='Event',
# LogType='None'|'Tail',
# ClientContext='string',
Payload=payload,
Payload=bytes(payload),
)
except ClientError as e:
print(f'ClientError:\n{e}')
Expand Down

0 comments on commit b29aacb

Please sign in to comment.