Skip to content

Commit a34ae26

Browse files
vinayaksoodVinayak
andauthored
feature: Support for custom checkpointing (#1883)
Co-authored-by: Vinayak <[email protected]>
1 parent c752104 commit a34ae26

File tree

7 files changed

+20
-6
lines changed

7 files changed

+20
-6
lines changed

samtranslator/model/eventsources/pull.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class PullEventSource(ResourceMacro):
3535
"Queues": PropertyType(False, is_type(list)),
3636
"SourceAccessConfigurations": PropertyType(False, is_type(list)),
3737
"TumblingWindowInSeconds": PropertyType(False, is_type(int)),
38+
"FunctionResponseTypes": PropertyType(False, is_type(list)),
3839
}
3940

4041
def get_policy_arn(self):
@@ -87,6 +88,7 @@ def to_cloudformation(self, **kwargs):
8788
lambda_eventsourcemapping.Queues = self.Queues
8889
lambda_eventsourcemapping.SourceAccessConfigurations = self.SourceAccessConfigurations
8990
lambda_eventsourcemapping.TumblingWindowInSeconds = self.TumblingWindowInSeconds
91+
lambda_eventsourcemapping.FunctionResponseTypes = self.FunctionResponseTypes
9092

9193
destination_config_policy = None
9294
if self.DestinationConfig:

samtranslator/model/lambda_.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class LambdaEventSourceMapping(Resource):
7676
"Queues": PropertyType(False, is_type(list)),
7777
"SourceAccessConfigurations": PropertyType(False, is_type(list)),
7878
"TumblingWindowInSeconds": PropertyType(False, is_type(int)),
79+
"FunctionResponseTypes": PropertyType(False, is_type(list)),
7980
}
8081

8182
runtime_attrs = {"name": lambda self: ref(self.logical_id)}

tests/translator/input/function_with_event_source_mapping.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ Resources:
5353
MaximumRecordAgeInSeconds: 86400
5454
StartingPosition: TRIM_HORIZON
5555
TumblingWindowInSeconds: 60
56+
FunctionResponseTypes:
57+
- ReportBatchItemFailures
5658
DestinationConfig:
5759
OnFailure:
5860
Type: SQS

tests/translator/output/aws-cn/function_with_event_source_mapping.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@
182182
"ParallelizationFactor": 8,
183183
"MaximumRetryAttempts": 100,
184184
"BisectBatchOnFunctionError": true,
185-
"TumblingWindowInSeconds": 60
185+
"TumblingWindowInSeconds": 60,
186+
"FunctionResponseTypes": ["ReportBatchItemFailures"]
186187
}
187188
},
188189
"MyFunctionForBatchingExample": {
@@ -239,4 +240,4 @@
239240
}
240241
}
241242
}
242-
}
243+
}

tests/translator/output/aws-us-gov/function_with_event_source_mapping.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@
182182
"ParallelizationFactor": 8,
183183
"MaximumRetryAttempts": 100,
184184
"BisectBatchOnFunctionError": true,
185-
"TumblingWindowInSeconds": 60
185+
"TumblingWindowInSeconds": 60,
186+
"FunctionResponseTypes": ["ReportBatchItemFailures"]
186187
}
187188
},
188189
"MyFunctionForBatchingExample": {
@@ -239,4 +240,4 @@
239240
}
240241
}
241242
}
242-
}
243+
}

tests/translator/output/function_with_event_source_mapping.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@
182182
"ParallelizationFactor": 8,
183183
"MaximumRetryAttempts": 100,
184184
"BisectBatchOnFunctionError": true,
185-
"TumblingWindowInSeconds": 60
185+
"TumblingWindowInSeconds": 60,
186+
"FunctionResponseTypes": ["ReportBatchItemFailures"]
186187
}
187188
},
188189
"MyFunctionForBatchingExample": {
@@ -239,4 +240,4 @@
239240
}
240241
}
241242
}
242-
}
243+
}

versions/2016-10-31.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ MaximumRecordAgeInSeconds | `integer` | The maximum age of a record that will be
513513
DestinationConfig | [Destination Config Object](#destination-config-object) | Expired record metadata/retries and exhausted metadata is sent to this destination after they have passed the defined limits.
514514
ParallelizationFactor | `integer` | Allocates multiple virtual shards, increasing the Lambda invokes by the given factor and speeding up the stream processing.
515515
TumblingWindowInSeconds | `integer` | Tumbling window (non-overlapping time window) duration to perform aggregations.
516+
FunctionResponseTypes | `list` | Response types enabled for your function.
516517

517518
**NOTE:** `SQSSendMessagePolicy` or `SNSPublishMessagePolicy` needs to be added in `Policies` for publishing messages to the `SQS` or `SNS` resource mentioned in `OnFailure` property
518519

@@ -536,6 +537,8 @@ Properties:
536537
Type: SQS
537538
Destination: !GetAtt MySqsQueue.Arn
538539
TumblingWindowInSeconds: 0
540+
FunctionResponseTypes:
541+
- ReportBatchItemFailures
539542
```
540543

541544

@@ -582,6 +585,7 @@ MaximumRecordAgeInSeconds | `integer` | The maximum age of a record that will be
582585
DestinationConfig | [DestinationConfig Object](#destination-config-object) | Expired record metadata/retries and exhausted metadata is sent to this destination after they have passed the defined limits.
583586
ParallelizationFactor | `integer` | Allocates multiple virtual shards, increasing the Lambda invokes by the given factor and speeding up the stream processing.
584587
TumblingWindowInSeconds | `integer` | Tumbling window (non-overlapping time window) duration to perform aggregations.
588+
FunctionResponseTypes | `list` | Response types enabled for your function.
585589

586590
##### Example: DynamoDB event source object
587591

@@ -602,6 +606,8 @@ Properties:
602606
Type: SQS
603607
Destination: !GetAtt MySqsQueue.Arn
604608
TumblingWindowInSeconds: 0
609+
FunctionResponseTypes
610+
- ReportBatchItemFailures
605611
```
606612

607613
#### SQS

0 commit comments

Comments
 (0)