File tree Expand file tree Collapse file tree
sds_data_manager/constructs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ def __init__(
105105 handler = "lambda_api_key_authorizer.lambda_handler" ,
106106 code = lambda_ .Code .from_asset ("sds_data_manager/lambda_code/authorization" ),
107107 timeout = Duration .seconds (10 ),
108+ memory_size = 512 , # Increase memory for larger network
108109 )
109110
110111 # Create or reference the API Keys DynamoDB table
@@ -124,6 +125,9 @@ def __init__(
124125 handler = self .api_key_authorizer_lambda ,
125126 response_types = [apigwv2_authorizers .HttpLambdaResponseType .SIMPLE ],
126127 identity_source = ["$request.header.x-api-key" ],
128+ # Cache multiple requests with the same API key so we don't
129+ # invoke the lambda repeatedly for the same key
130+ results_cache_ttl = Duration .hours (12 ),
127131 )
128132
129133 # Add a custom domain to the API if we have one
You can’t perform that action at this time.
0 commit comments