当特定文件上传到s3时发送sns主题警报

时间:2018-01-04 17:11:09

标签: amazon-web-services amazon-s3 amazon-sns amazon-cloudwatch

我想创建一个cloudwatch事件,当一个以SampleSheet开头的文件上传到s3存储桶时,该事件将发送一个sns主题警报。

下面的配置为上传到s3的每个对象创建警报:

 {
          "source": [
            "aws.s3"
          ],
          "detail": {
            "eventSource": [
              "s3.amazonaws.com"
            ],
            "eventName": [
              "PutObject"
            ],

            "requestParameters": {
              "bucketName": [
                "Mys3bucktet"
              ]
            }
          }
        }

我想仅在文件' samplesheet.csv'上传到s3 bucktet,我尝试了下面的东西,这是行不通的:

      {
          "source": [
            "aws.s3"
          ],
          "detail": {
            "eventSource": [
              "s3.amazonaws.com"
            ],
            "eventName": [
              "PutObject"
            ],
            "Prefix": [
              "SampleSheet"
            ],
            "requestParameters": {
              "bucketName": [
                "Mys3bucktet"
              ]
            }
          }
        }

0 个答案:

没有答案