amazon-cloudwatch - CloudWatch 事件模式匹配中的正则表达式
问题描述
如何在正则表达式上匹配 CloudWatch 事件。我只需要在特定的作业名称上调用特定的 SNS 目标。例如,如下所示,我想对 TranscriptionJobName 进行正则表达式匹配。谢谢。
{
"source": [
"aws.transcribe"
],
"detail-type": [
"Transcribe Job State Change"
],
"detail": {
"TranscriptionJobStatus": [
"COMPLETED",
"FAILED"
],
"TranscriptionJobName": [
"transcription-localhost-*"
]
}
}
解决方案
这现在可以通过 EventBridge 及其进行前缀匹配的能力来实现。这对我有用。我将 Lambda 函数设置为目标,该函数仅在 Transcribe 作业达到COMPLETED
状态且作业名称以voicemail-
.
{
"source": [
"aws.transcribe"
],
"detail": {
"TranscriptionJobName": [
{
"prefix": "voicemail-"
}
],
"TranscriptionJobStatus": [
"COMPLETED"
]
}
}
推荐阅读
- angular - 如何绑定到其他组件中的属性
- android - 使用 Android OpenCV 在图像中检测到图案时拍照
- javascript - 在我的 phpmyadmin 共享服务器中更改时区
- python-2.7 - 尝试使用 NDB 将 Google App Engine Python 2 应用程序迁移到 Cloud NDB Python 3 库时出现导入错误
- docker - 构建docker镜像时如何在gitlab runner中缓存spacy模型
- go - 如何在 gRPC Protobuf 中为接口创建类型?
- javascript - 如果 HTML5 形式的文本框值是 x,那么 y: 这可能吗?
- html - 当父级的 z-index 与另一个 div 相等时,子级的 z-index 较高会隐藏绝对子级
- android - 在我的 react native 项目中哪里可以找到 tsconfig.json 文件
- kubernetes - dask.distributed 集群可以独立地自动缩放不同的工作人员吗?