I am using Chalice with CDK to create a REST API and a scheduled lambda function (for a batch job).
I want to specify the configuration for the scheduled lambda function.
@app.schedule(Cron(0, 16, "L", "*", "?", "*"))
def foo(event, context):
print("hello world")
In the CDK file, the following configuration is used.
class ChaliceApp(cdk.Stack):
def __init__(self, scope, id, **kwargs):
super().__init__(scope, id, **kwargs)
self.dynamodb_table = self._create_ddb_table()
self.chalice = Chalice(
self,
"ChaliceApp",
source_dir=RUNTIME_SOURCE_DIR,
stage_config={
"environment_variables": {
"APP_TABLE_NAME": self.dynamodb_table.table_name
},
"lambda_functions": {
"foo": {
"lambda_timeout": 600,
"lambda_memory_size": 256,
"environment_variables": {"HELLO": "world"},
}
},
},
)
self.dynamodb_table.grant_read_write_data(self.chalice.get_role("DefaultRole"))
However, after deploying the application with cdk deploy, the scheduled lambda function is created with the default timeout (60 sec) and memory size (128 MB).
I think the Lambda Specific Configuration does not work with CDK.
I am using Chalice with CDK to create a REST API and a scheduled lambda function (for a batch job).
I want to specify the configuration for the scheduled lambda function.
In the CDK file, the following configuration is used.
However, after deploying the application with
cdk deploy, the scheduled lambda function is created with the default timeout (60 sec) and memory size (128 MB).I think the Lambda Specific Configuration does not work with CDK.