title: S3 TopicConfiguration- Unable to validate the following destination configurations
body: <p>I'm trying to get an S3 event notification to trigger multiple Lambda functions in parallel. </p>
  
  <p>Need to go via SNS as you can't define multiple S3 <code>LambdaConfigurations</code> which have the same S3 <code>Prefix</code> - Cloudformation complains of "overlap" :-(</p>
  
  <p>So I am following this pattern here -</p>
  
  <p><a href="https://aws.amazon.com/blogs/compute/fanout-s3-event-notifications-to-multiple-endpoints/" rel="nofollow noreferrer">https://aws.amazon.com/blogs/compute/fanout-s3-event-notifications-to-multiple-endpoints/</a></p>
  
  <p>however I keep falling foul of <code>Unable to validate the following destination configurations</code> when deploying. This <em>seems</em> to be related to a missing <code>SNS::TopicPolicy</code>, as well documented here -</p>
  
  <p><a href="https://aws.amazon.com/premiumsupport/knowledge-center/unable-validate-destination-s3/" rel="nofollow noreferrer">https://aws.amazon.com/premiumsupport/knowledge-center/unable-validate-destination-s3/</a></p>
  
  <p>however I have a <code>TopicPolicy</code> defined (see below), and have made the <code>Bucket</code> creation dependent on it. What am I doing wrong here ? TIA.</p>
  
  <pre><code>---
  AWSTemplateFormatVersion: 2010-09-09
  Parameters:
    AppName:
      Type: String
  Resources:
    Topic:
      Properties:
        TopicName: !Sub "${AppName}-topic"
      Type: AWS::SNS::Topic
    TopicPolicy:
      Properties:
        PolicyDocument:
          Id: !Sub "${AppName}-topic-policy"
          Statement:
            - Action: "sns:Publish"
              Effect: Allow
              Principal:
                Service: 's3.amazonaws.com'
              Resource: Ref! Topic
              Sid: !Sub "${AppName}-topic-policy-statement"
          Version: '2012-10-17'
        Topics:
          - !Ref Topic
      Type: AWS::SNS::TopicPolicy
    Bucket:
      DependsOn:
        - TopicPolicy
      Properties:
        BucketName: !Sub "${AppName}-bucket"
        NotificationConfiguration:
          TopicConfigurations:
            - Event: "s3:ObjectCreated:*"
              Topic: !Ref Topic
      Type: AWS::S3::Bucket
  </code></pre>