Reputation: 469
Is there a way to create event pattern
rule on EventBridge to submit Batch job with specific name pattern? Name should depends on some s3 file name. For example: if fileName == "some pattern" then -> parse file name and get prefix, concat prefix + constant name else use constant name
. Or maybe there is another way to define name dynamically?
Upvotes: 0
Views: 522
Reputation: 1161
This doesn't seem possible, because you have to enter a job name when you create the Rule.
There are 2 workarounds that you can try:
Change your target to be a lambda function. In the lambda you can create the logic that you explained and start the Batch job.
Depending on the amount of patterns that you have. You can create multiple Rules and each is filtering by a specific object name. There you can set different job names. Like this:
{
"source": [
"aws.s3"
],
"detail-type": [
"Object Created"
],
"detail": {
"bucket": {
"name": [
"bucket-name"
]
},
"object": {
"key": [
"example-key"
]
}
}
}
Upvotes: 1