Unfortunately wildcards aren't possible here.
Defining streams as a Lambda input in Serverless result in CloudFormation that looks like this:
"MyLambdaEventSourceMappingDynamodbOrdersTable": {
"Type": "AWS::Lambda::EventSourceMapping",
"DependsOn": "MyLambdaIamRoleLambdaExecution",
"Properties": {
"BatchSize": 10,
"EventSourceArn": {
"Fn::GetAtt": [
"OrdersTable",
"StreamArn"
]
},
"FunctionName": {
"Fn::GetAtt": [
"MyLambdaLambdaFunction",
"Arn"
]
},
"StartingPosition": "TRIM_HORIZON",
"Enabled": "True",
"MaximumBatchingWindowInSeconds": 60
}
},
The resource of type AWS::Lambda::EventSourceMapping
uses the property EventSourceArn
to specify a single source as per the documentation.
You could add new event source mappings programmatically by writing another Lambda Function that takes a CloudWatch event as its input whenever a new Table is created and then adds an EventSourceMapping for that table to your Lambda Function.
This will probably have scaling limits as the number of event source mappings per Lambda is most likely limited (although I couldn't find the number).