async-lambda-unstable 0.3.10__tar.gz → 0.3.12__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. {async-lambda-unstable-0.3.10/async_lambda_unstable.egg-info → async-lambda-unstable-0.3.12}/PKG-INFO +14 -1
  2. async-lambda-unstable-0.3.10/PKG-INFO → async-lambda-unstable-0.3.12/README.md +13 -8
  3. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/__init__.py +1 -1
  4. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/build_config.py +3 -0
  5. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/controller.py +15 -2
  6. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/models/task.py +5 -0
  7. async-lambda-unstable-0.3.10/README.md → async-lambda-unstable-0.3.12/async_lambda_unstable.egg-info/PKG-INFO +21 -0
  8. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/cli.py +0 -0
  9. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/client.py +0 -0
  10. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/config.py +0 -0
  11. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/defer.py +0 -0
  12. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/env.py +0 -0
  13. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/models/__init__.py +0 -0
  14. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/models/case_insensitive_dict.py +0 -0
  15. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/models/events/__init__.py +0 -0
  16. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/models/events/api_event.py +0 -0
  17. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/models/events/base_event.py +0 -0
  18. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/models/events/dynamodb_event.py +0 -0
  19. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/models/events/managed_sqs_event.py +0 -0
  20. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/models/events/scheduled_event.py +0 -0
  21. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/models/events/unmanaged_sqs_event.py +0 -0
  22. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/models/mock/mock_context.py +0 -0
  23. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/models/mock/mock_event.py +0 -0
  24. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/py.typed +0 -0
  25. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda/util.py +0 -0
  26. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda_unstable.egg-info/SOURCES.txt +0 -0
  27. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda_unstable.egg-info/dependency_links.txt +0 -0
  28. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda_unstable.egg-info/entry_points.txt +0 -0
  29. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda_unstable.egg-info/requires.txt +0 -0
  30. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/async_lambda_unstable.egg-info/top_level.txt +0 -0
  31. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/pyproject.toml +0 -0
  32. {async-lambda-unstable-0.3.10 → async-lambda-unstable-0.3.12}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: async-lambda-unstable
3
- Version: 0.3.10
3
+ Version: 0.3.12
4
4
  Summary: A framework for creating AWS Lambda Async Workflows. - Unstable Branch
5
5
  Author-email: "Nuclei, Inc" <engineering@nuclei.ai>
6
6
  Description-Content-Type: text/markdown
@@ -372,6 +372,19 @@ For managed queues the tags `async-lambda-queue-type` will be set to `dlq`, `dlq
372
372
 
373
373
  For `async_task` queues (non dlq-task) the `async-lambda-lane` will be set.
374
374
 
375
+ ## `logging_config`
376
+
377
+ ```
378
+ {
379
+ "ApplicationLogLevel": "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR" | "FATAL",
380
+ "LogFormat": "Text" | "JSON",
381
+ "LogGroup": "",
382
+ "SystemLogLevel": "DEBUG" | "INFO" | "WARN"
383
+ }
384
+ ```
385
+
386
+ The value is passed directly to the [`LoggingConfig`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-loggingconfig) Cloudformation parameter for lambda function/s.
387
+
375
388
  # Building an `async-lambda` app
376
389
 
377
390
  **When the app is packaged for lambda, only the main module, and the `vendor` and `src` directories are included.**
@@ -1,11 +1,3 @@
1
- Metadata-Version: 2.1
2
- Name: async-lambda-unstable
3
- Version: 0.3.10
4
- Summary: A framework for creating AWS Lambda Async Workflows. - Unstable Branch
5
- Author-email: "Nuclei, Inc" <engineering@nuclei.ai>
6
- Description-Content-Type: text/markdown
7
- Provides-Extra: local
8
-
9
1
  # async-lambda
10
2
 
11
3
  `async-lambda` is a framework for creating `AWS Lambda` applications with built
@@ -372,6 +364,19 @@ For managed queues the tags `async-lambda-queue-type` will be set to `dlq`, `dlq
372
364
 
373
365
  For `async_task` queues (non dlq-task) the `async-lambda-lane` will be set.
374
366
 
367
+ ## `logging_config`
368
+
369
+ ```
370
+ {
371
+ "ApplicationLogLevel": "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR" | "FATAL",
372
+ "LogFormat": "Text" | "JSON",
373
+ "LogGroup": "",
374
+ "SystemLogLevel": "DEBUG" | "INFO" | "WARN"
375
+ }
376
+ ```
377
+
378
+ The value is passed directly to the [`LoggingConfig`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-loggingconfig) Cloudformation parameter for lambda function/s.
379
+
375
380
  # Building an `async-lambda` app
376
381
 
377
382
  **When the app is packaged for lambda, only the main module, and the `vendor` and `src` directories are included.**
@@ -12,4 +12,4 @@ from .models.events.managed_sqs_event import ManagedSQSEvent as ManagedSQSEvent
12
12
  from .models.events.scheduled_event import ScheduledEvent as ScheduledEvent
13
13
  from .models.events.unmanaged_sqs_event import UnmanagedSQSEvent as UnmanagedSQSEvent
14
14
 
15
- __version__ = "0.3.10"
15
+ __version__ = "0.3.12"
@@ -18,6 +18,7 @@ class AsyncLambdaBuildConfig:
18
18
  managed_queue_extras: List[dict]
19
19
  method_settings: List[dict]
20
20
  tags: Dict[str, str]
21
+ logging_config: Dict[str, str]
21
22
  domain_name: Optional[str] = None
22
23
  tls_version: Optional[str] = None
23
24
  certificate_arn: Optional[str] = None
@@ -33,6 +34,7 @@ class AsyncLambdaBuildConfig:
33
34
  managed_queue_extras=list(config.get("managed_queue_extras", list())),
34
35
  method_settings=list(config.get("method_settings", list())),
35
36
  tags=config.get("tags", dict()),
37
+ logging_config=config.get("logging_config", dict()),
36
38
  domain_name=config.get("domain_name"),
37
39
  tls_version=config.get("tls_version"),
38
40
  certificate_arn=config.get("certificate_arn"),
@@ -46,6 +48,7 @@ class AsyncLambdaBuildConfig:
46
48
  self.security_group_ids.update(other.security_group_ids)
47
49
  self.managed_queue_extras += other.managed_queue_extras
48
50
  self.tags.update(other.tags)
51
+ self.logging_config.update(other.logging_config)
49
52
  if other.domain_name is not None:
50
53
  self.domain_name = other.domain_name
51
54
  if other.tls_version is not None:
@@ -529,7 +529,15 @@ class AsyncLambdaController:
529
529
 
530
530
  return _task
531
531
 
532
- def dynamodb_task(self, task_id: str, *, stream_arn: str, batch_size: int):
532
+ def dynamodb_task(
533
+ self,
534
+ task_id: str,
535
+ *,
536
+ stream_arn: str,
537
+ batch_size: int,
538
+ max_batching_window: int = 0,
539
+ **kwargs,
540
+ ):
533
541
  """
534
542
  Decorate a function to register it as a DynamoDB task.
535
543
  These tasks will be triggered by the given DynamoDB stream.
@@ -550,7 +558,12 @@ class AsyncLambdaController:
550
558
  executable=inner,
551
559
  task_id=task_id,
552
560
  trigger_type=TaskTriggerType.DYNAMODB_EVENT,
553
- trigger_config={"stream_arn": stream_arn, "batch_size": batch_size},
561
+ trigger_config={
562
+ "stream_arn": stream_arn,
563
+ "batch_size": batch_size,
564
+ "max_batching_window": max_batching_window,
565
+ },
566
+ **kwargs,
554
567
  )
555
568
  )
556
569
 
@@ -273,6 +273,9 @@ class AsyncLambdaTask(Generic[EventType]):
273
273
  "Stream": self.trigger_config["stream_arn"],
274
274
  "StartingPosition": "TRIM_HORIZON",
275
275
  "BatchSize": self.trigger_config["batch_size"],
276
+ "MaximumBatchingWindowInSeconds": self.trigger_config[
277
+ "max_batching_window"
278
+ ],
276
279
  "Enabled": True,
277
280
  },
278
281
  }
@@ -369,6 +372,8 @@ class AsyncLambdaTask(Generic[EventType]):
369
372
  function_properties["VpcConfig"]["SubnetIds"] = sorted(
370
373
  build_config.subnet_ids
371
374
  )
375
+ if len(build_config.logging_config) > 0:
376
+ function_properties["LoggingConfig"] = build_config.logging_config
372
377
 
373
378
  template = {
374
379
  self.get_function_logical_id(): {
@@ -1,3 +1,11 @@
1
+ Metadata-Version: 2.1
2
+ Name: async-lambda-unstable
3
+ Version: 0.3.12
4
+ Summary: A framework for creating AWS Lambda Async Workflows. - Unstable Branch
5
+ Author-email: "Nuclei, Inc" <engineering@nuclei.ai>
6
+ Description-Content-Type: text/markdown
7
+ Provides-Extra: local
8
+
1
9
  # async-lambda
2
10
 
3
11
  `async-lambda` is a framework for creating `AWS Lambda` applications with built
@@ -364,6 +372,19 @@ For managed queues the tags `async-lambda-queue-type` will be set to `dlq`, `dlq
364
372
 
365
373
  For `async_task` queues (non dlq-task) the `async-lambda-lane` will be set.
366
374
 
375
+ ## `logging_config`
376
+
377
+ ```
378
+ {
379
+ "ApplicationLogLevel": "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR" | "FATAL",
380
+ "LogFormat": "Text" | "JSON",
381
+ "LogGroup": "",
382
+ "SystemLogLevel": "DEBUG" | "INFO" | "WARN"
383
+ }
384
+ ```
385
+
386
+ The value is passed directly to the [`LoggingConfig`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-loggingconfig) Cloudformation parameter for lambda function/s.
387
+
367
388
  # Building an `async-lambda` app
368
389
 
369
390
  **When the app is packaged for lambda, only the main module, and the `vendor` and `src` directories are included.**