# Error when trying to deploy S3 bucket with SNS event

**URL:** <https://forum.serverless.com/t/error-when-trying-to-deploy-s3-bucket-with-sns-event/3928>\
**Category:** Serverless Framework\
**Created:** [March 3, 2018, 6:03pm UTC](https://forum.serverless.com/t/error-when-trying-to-deploy-s3-bucket-with-sns-event/3928 "2018-03-03T18:03:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ffxsam](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/ffxsam/32/1655_2.png) [@ffxsam](https://forum.serverless.com/u/ffxsam)\
**Post date:** [March 3, 2018, 6:03pm UTC](https://forum.serverless.com/t/error-when-trying-to-deploy-s3-bucket-with-sns-event/3928/1 "2018-03-03T18:03:51Z")

</div>

I’m having trouble figuring out how to set up an S3 event to trigger an SNS topic. When I deploy, I get the following output:

```auto
  Serverless Error ---------------------------------------

  An error occurred: TestBucket - Unable to validate the following destination configurations.

```

Below is my `serverless.yml` file:

```auto
service:
  name: TestStack

# Add the serverless-webpack plugin
plugins:
  - serverless-webpack

provider:
  name: aws
  runtime: nodejs6.10
  variableSyntax: '\$\(([\s\S]+?)\)'

custom:
  stage: $(opt:stage, self:provider.stage)
  topicName: kerpow
  topic: $(self:service)-$(self:custom.topicName)-$(self:custom.stage)
  topicArn:
    Fn::Sub: arn:aws:sns:$(self:provider.region):${AWS::AccountId}:$(self:custom.topic)

functions:
  first:
    handler: first.hello
    events:
      - sns: $(self:custom.topic)

resources:
  Resources:
    TestBucket:
      Type: AWS::S3::Bucket
      Properties:
        BucketName: test-bucket-ab8e0782
        NotificationConfiguration:
          TopicConfigurations:
            - Event: s3:ObjectCreated:Put
              Filter:
                S3Key:
                  Rules:
                    - Name: prefix
                      Value: staging/
              Topic: $(self:custom.topicArn)

```

---

<div class="post-metadata">

**Author:** ![ffxsam](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/ffxsam/32/1655_2.png) [@ffxsam](https://forum.serverless.com/u/ffxsam)\
**Post date:** [March 3, 2018, 6:18pm UTC](https://forum.serverless.com/t/error-when-trying-to-deploy-s3-bucket-with-sns-event/3928/2 "2018-03-03T18:18:42Z")

</div>

This could be a bug in Serverless. It’s not creating an `AWS::SNS::TopicPolicy` according to this document:

[https://aws.amazon.com/premiumsupport/knowledge-center/unable-validate-destination-s3/](https://aws.amazon.com/premiumsupport/knowledge-center/unable-validate-destination-s3/)
