Skip to content

Commit

Permalink
lambda handlers explicit in definition.yml #139
Browse files Browse the repository at this point in the history
  • Loading branch information
jkeifer committed Aug 24, 2022
1 parent 9796e77 commit 234cad0
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/cirrus/builtins/feeders/feed-rerun/definition.yml
Expand Up @@ -2,6 +2,7 @@ description: Rerun items in the database
lambda:
memorySize: 128
timeout: 900
handler: lambda_function.lambda_handler
iamRoleStatements:
- Effect: "Allow"
Action:
Expand Down
1 change: 1 addition & 0 deletions src/cirrus/builtins/functions/api/definition.yml
Expand Up @@ -2,6 +2,7 @@ description: Cirrus API
lambda:
memorySize: 128
timeout: 10
handler: lambda_function.lambda_handler
events:
- http: GET /
- http: GET /{proxy+}
Expand Down
1 change: 1 addition & 0 deletions src/cirrus/builtins/functions/process/definition.yml
Expand Up @@ -5,6 +5,7 @@ environment:
lambda:
memorySize: 128
timeout: 900
handler: lambda_function.lambda_handler
events:
- sqs:
arn: !GetAtt ProcessQueue.Arn
Expand Down
1 change: 1 addition & 0 deletions src/cirrus/builtins/functions/update-state/definition.yml
Expand Up @@ -2,6 +2,7 @@ description: update the cirrus database with the execution state
lambda:
memorySize: 128
timeout: 15
handler: lambda_function.lambda_handler
events:
- eventBridge:
pattern:
Expand Down
1 change: 1 addition & 0 deletions src/cirrus/builtins/tasks/post-batch/definition.yml
Expand Up @@ -2,6 +2,7 @@ description: Post process batch job by copying input from S3
lambda:
memorySize: 128
timeout: 15
handler: lambda_function.lambda_handler
iamRoleStatements:
- Effect: "Allow"
Action:
Expand Down
1 change: 1 addition & 0 deletions src/cirrus/builtins/tasks/pre-batch/definition.yml
Expand Up @@ -2,6 +2,7 @@ description: Pre process batch job by copying input to S3
lambda:
memorySize: 128
timeout: 15
handler: lambda_function.lambda_handler
iamRoleStatements:
- Effect: "Allow"
Action:
Expand Down
1 change: 1 addition & 0 deletions src/cirrus/builtins/tasks/publish/definition.yml
Expand Up @@ -2,6 +2,7 @@ description: Publish resulting STAC Collections and Items to catalog, and option
lambda:
memorySize: 128
timeout: 30
handler: lambda_function.lambda_handler
iamRoleStatements:
- Effect: "Allow"
Action:
Expand Down
7 changes: 4 additions & 3 deletions src/cirrus/core/components/base/_lambda.py
Expand Up @@ -63,10 +63,11 @@ def load_config(self):
+ project_reqs
}))

if not hasattr(self.lambda_config, 'module'):
# if this is a non-container lambda that needs to be packaged
# by serverless, then we need to ensure the module points to the
# place in the build dir where we'll copy all the code
if hasattr(self.lambda_config, 'handler'):
self.lambda_config.module = f'lambdas/{self.name}'
if not hasattr(self.lambda_config, 'handler'):
self.lambda_config.handler = 'lambda_function.lambda_handler'

@property
def enabled(self):
Expand Down
1 change: 1 addition & 0 deletions src/cirrus/core/components/files/definitions.py
Expand Up @@ -33,6 +33,7 @@
lambda_lambda = '''lambda:
memorySize: 128
timeout: 60
handler: lambda_function.lambda_handler
pythonRequirements:
include: []
'''.format
Expand Down

0 comments on commit 234cad0

Please sign in to comment.