Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sam support for custom checkpointing #1883

Merged
merged 1 commit into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions samtranslator/model/eventsources/pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class PullEventSource(ResourceMacro):
"Queues": PropertyType(False, is_type(list)),
"SourceAccessConfigurations": PropertyType(False, is_type(list)),
"TumblingWindowInSeconds": PropertyType(False, is_type(int)),
"FunctionResponseTypes": PropertyType(False, is_type(list)),
}

def get_policy_arn(self):
Expand Down Expand Up @@ -87,6 +88,7 @@ def to_cloudformation(self, **kwargs):
lambda_eventsourcemapping.Queues = self.Queues
lambda_eventsourcemapping.SourceAccessConfigurations = self.SourceAccessConfigurations
lambda_eventsourcemapping.TumblingWindowInSeconds = self.TumblingWindowInSeconds
lambda_eventsourcemapping.FunctionResponseTypes = self.FunctionResponseTypes

destination_config_policy = None
if self.DestinationConfig:
Expand Down
1 change: 1 addition & 0 deletions samtranslator/model/lambda_.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class LambdaEventSourceMapping(Resource):
"Queues": PropertyType(False, is_type(list)),
"SourceAccessConfigurations": PropertyType(False, is_type(list)),
"TumblingWindowInSeconds": PropertyType(False, is_type(int)),
"FunctionResponseTypes": PropertyType(False, is_type(list)),
}

runtime_attrs = {"name": lambda self: ref(self.logical_id)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ Resources:
MaximumRecordAgeInSeconds: 86400
StartingPosition: TRIM_HORIZON
TumblingWindowInSeconds: 60
FunctionResponseTypes:
- ReportBatchItemFailures
DestinationConfig:
OnFailure:
Type: SQS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@
"ParallelizationFactor": 8,
"MaximumRetryAttempts": 100,
"BisectBatchOnFunctionError": true,
"TumblingWindowInSeconds": 60
"TumblingWindowInSeconds": 60,
"FunctionResponseTypes": ["ReportBatchItemFailures"]
}
},
"MyFunctionForBatchingExample": {
Expand Down Expand Up @@ -239,4 +240,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@
"ParallelizationFactor": 8,
"MaximumRetryAttempts": 100,
"BisectBatchOnFunctionError": true,
"TumblingWindowInSeconds": 60
"TumblingWindowInSeconds": 60,
"FunctionResponseTypes": ["ReportBatchItemFailures"]
}
},
"MyFunctionForBatchingExample": {
Expand Down Expand Up @@ -239,4 +240,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@
"ParallelizationFactor": 8,
"MaximumRetryAttempts": 100,
"BisectBatchOnFunctionError": true,
"TumblingWindowInSeconds": 60
"TumblingWindowInSeconds": 60,
"FunctionResponseTypes": ["ReportBatchItemFailures"]
}
},
"MyFunctionForBatchingExample": {
Expand Down Expand Up @@ -239,4 +240,4 @@
}
}
}
}
}
6 changes: 6 additions & 0 deletions versions/2016-10-31.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ MaximumRecordAgeInSeconds | `integer` | The maximum age of a record that will be
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.
ParallelizationFactor | `integer` | Allocates multiple virtual shards, increasing the Lambda invokes by the given factor and speeding up the stream processing.
TumblingWindowInSeconds | `integer` | Tumbling window (non-overlapping time window) duration to perform aggregations.
FunctionResponseTypes | `list` | Response types enabled for your function.

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

Expand All @@ -536,6 +537,8 @@ Properties:
Type: SQS
Destination: !GetAtt MySqsQueue.Arn
TumblingWindowInSeconds: 0
FunctionResponseTypes:
- ReportBatchItemFailures
```


Expand Down Expand Up @@ -582,6 +585,7 @@ MaximumRecordAgeInSeconds | `integer` | The maximum age of a record that will be
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.
ParallelizationFactor | `integer` | Allocates multiple virtual shards, increasing the Lambda invokes by the given factor and speeding up the stream processing.
TumblingWindowInSeconds | `integer` | Tumbling window (non-overlapping time window) duration to perform aggregations.
FunctionResponseTypes | `list` | Response types enabled for your function.

##### Example: DynamoDB event source object

Expand All @@ -602,6 +606,8 @@ Properties:
Type: SQS
Destination: !GetAtt MySqsQueue.Arn
TumblingWindowInSeconds: 0
FunctionResponseTypes
- ReportBatchItemFailures
```

#### SQS
Expand Down