[英]AWS EventBridge Rule Ignoring Key Prefix & Suffix Matching
I have an Event Bridge rule created where when I drop a file into an S3 bucket it will trigger a Step function.我创建了一个事件桥规则,当我将文件放入 S3 存储桶时,它将触发步骤 function。
I only want to trigger this rule when:我只想在以下情况下触发此规则:
files/
( prefix: "files/"
)files/
的文件夹中( prefix: "files/"
)suffix: ".csv"
)suffix: ".csv"
) However this rule is being triggered for any files regardless of their suffix and prefix.但是,无论文件的后缀和前缀如何,都会为任何文件触发此规则。 For instance I dropped a.pdf file in and it triggered the step function.
例如,我放入了一个 .pdf 文件,它触发了步骤 function。
{
"detail-type": ["Object Created"],
"source": ["aws.s3"],
"detail": {
"bucket": {
"name": ["my-files-bucket"]
},
"object": {,
"key": [{
"prefix": "files/"
}, {
"suffix": ".csv"
}]
}
}
}
This is the expected behaviour.这是预期的行为。 EventBridge treats multiple values in brackets as an OR condition .
EventBridge 将括号中的多个值视为OR 条件。 Events will match your pattern if the object key begins with
files/
OR ends with .csv
.如果 object 键以
files/
开头或以.csv
结尾,事件将匹配您的模式。
As far as I know, it's not possible to apply an AND condition to a single field.据我所知,不可能将 AND 条件应用于单个字段。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.