Resources:
  textractdemobucket1D185E28:
    Type: AWS::S3::Bucket
    UpdateReplacePolicy: Delete
    DeletionPolicy: Delete
    Metadata:
      aws:cdk:path: textract-example-s3-sns-sqs/textract-demo-bucket/Resource
  textractdemobucketPolicy53C19A77:
    Type: AWS::S3::BucketPolicy
    Properties:
      Bucket:
        Ref: textractdemobucket1D185E28
      PolicyDocument:
        Statement:
          - Action: s3:*
            Condition:
              Bool:
                aws:SecureTransport: "false"
            Effect: Deny
            Principal:
              AWS: "*"
            Resource:
              - Fn::GetAtt:
                  - textractdemobucket1D185E28
                  - Arn
              - Fn::Join:
                  - ""
                  - - Fn::GetAtt:
                        - textractdemobucket1D185E28
                        - Arn
                    - /*
          - Action:
              - s3:GetObject*
              - s3:GetBucket*
              - s3:List*
              - s3:DeleteObject*
              - s3:PutObject*
              - s3:Abort*
            Effect: Allow
            Principal:
              Service: textract.amazonaws.com
            Resource:
              - Fn::GetAtt:
                  - textractdemobucket1D185E28
                  - Arn
              - Fn::Join:
                  - ""
                  - - Fn::GetAtt:
                        - textractdemobucket1D185E28
                        - Arn
                    - /*
        Version: "2012-10-17"
    Metadata:
      aws:cdk:path: textract-example-s3-sns-sqs/textract-demo-bucket/Policy/Resource
  textractdemoqueue11986365:
    Type: AWS::SQS::Queue
    UpdateReplacePolicy: Delete
    DeletionPolicy: Delete
    Metadata:
      aws:cdk:path: textract-example-s3-sns-sqs/textract-demo-queue/Resource
  textractdemoqueuePolicy924EF29F:
    Type: AWS::SQS::QueuePolicy
    Properties:
      PolicyDocument:
        Statement:
          - Action: sqs:SendMessage
            Condition:
              ArnEquals:
                aws:SourceArn:
                  Ref: textractdemotopicC34F570A
            Effect: Allow
            Principal:
              Service: sns.amazonaws.com
            Resource:
              Fn::GetAtt:
                - textractdemoqueue11986365
                - Arn
        Version: "2012-10-17"
      Queues:
        - Ref: textractdemoqueue11986365
    Metadata:
      aws:cdk:path: textract-example-s3-sns-sqs/textract-demo-queue/Policy/Resource
  textractdemoqueuetextractexamples3snssqstextractdemotopic223AEA52DD46031F:
    Type: AWS::SNS::Subscription
    Properties:
      Protocol: sqs
      TopicArn:
        Ref: textractdemotopicC34F570A
      Endpoint:
        Fn::GetAtt:
          - textractdemoqueue11986365
          - Arn
    Metadata:
      aws:cdk:path: textract-example-s3-sns-sqs/textract-demo-queue/textractexamples3snssqstextractdemotopic223AEA52/Resource
  textractdemotopicC34F570A:
    Type: AWS::SNS::Topic
    Properties:
      KmsMasterKeyId:
        Fn::Join:
          - ""
          - - "arn:"
            - Ref: AWS::Partition
            - ":kms:"
            - Ref: AWS::Region
            - ":"
            - Ref: AWS::AccountId
            - :alias/aws/sns
    Metadata:
      aws:cdk:path: textract-example-s3-sns-sqs/textract-demo-topic/Resource
  textractdemorole5485C22B:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Statement:
          - Action: sts:AssumeRole
            Effect: Allow
            Principal:
              Service: textract.amazonaws.com
        Version: "2012-10-17"
    Metadata:
      aws:cdk:path: textract-example-s3-sns-sqs/textract-demo-role/Resource
  textractdemoroleDefaultPolicy1DCC20E3:
    Type: AWS::IAM::Policy
    Properties:
      PolicyDocument:
        Statement:
          - Action: sns:Publish
            Effect: Allow
            Resource:
              Ref: textractdemotopicC34F570A
        Version: "2012-10-17"
      PolicyName: textractdemoroleDefaultPolicy1DCC20E3
      Roles:
        - Ref: textractdemorole5485C22B
    Metadata:
      aws:cdk:path: textract-example-s3-sns-sqs/textract-demo-role/DefaultPolicy/Resource
  CDKMetadata:
    Type: AWS::CDK::Metadata
    Properties:
      Modules: aws-cdk=1.88.0,@aws-cdk/aws-cloudwatch=1.91.0,@aws-cdk/aws-events=1.91.0,@aws-cdk/aws-iam=1.91.0,@aws-cdk/aws-kms=1.91.0,@aws-cdk/aws-s3=1.91.0,@aws-cdk/aws-sns=1.91.0,@aws-cdk/aws-sns-subscriptions=1.91.0,@aws-cdk/aws-sqs=1.91.0,@aws-cdk/cloud-assembly-schema=1.91.0,@aws-cdk/core=1.91.0,@aws-cdk/cx-api=1.91.0,@aws-cdk/region-info=1.91.0,jsii-runtime=node.js/v14.15.2
    Metadata:
      aws:cdk:path: textract-example-s3-sns-sqs/CDKMetadata/Default
    Condition: CDKMetadataAvailable
Outputs:
  BucketName:
    Value:
      Ref: textractdemobucket1D185E28
  TopicArn:
    Value:
      Ref: textractdemotopicC34F570A
  RoleArn:
    Value:
      Fn::GetAtt:
        - textractdemorole5485C22B
        - Arn
  QueueUrl:
    Value:
      Ref: textractdemoqueue11986365
Conditions:
  CDKMetadataAvailable:
    Fn::Or:
      - Fn::Or:
          - Fn::Equals:
              - Ref: AWS::Region
              - ap-east-1
          - Fn::Equals:
              - Ref: AWS::Region
              - ap-northeast-1
          - Fn::Equals:
              - Ref: AWS::Region
              - ap-northeast-2
          - Fn::Equals:
              - Ref: AWS::Region
              - ap-south-1
          - Fn::Equals:
              - Ref: AWS::Region
              - ap-southeast-1
          - Fn::Equals:
              - Ref: AWS::Region
              - ap-southeast-2
          - Fn::Equals:
              - Ref: AWS::Region
              - ca-central-1
          - Fn::Equals:
              - Ref: AWS::Region
              - cn-north-1
          - Fn::Equals:
              - Ref: AWS::Region
              - cn-northwest-1
          - Fn::Equals:
              - Ref: AWS::Region
              - eu-central-1
      - Fn::Or:
          - Fn::Equals:
              - Ref: AWS::Region
              - eu-north-1
          - Fn::Equals:
              - Ref: AWS::Region
              - eu-west-1
          - Fn::Equals:
              - Ref: AWS::Region
              - eu-west-2
          - Fn::Equals:
              - Ref: AWS::Region
              - eu-west-3
          - Fn::Equals:
              - Ref: AWS::Region
              - me-south-1
          - Fn::Equals:
              - Ref: AWS::Region
              - sa-east-1
          - Fn::Equals:
              - Ref: AWS::Region
              - us-east-1
          - Fn::Equals:
              - Ref: AWS::Region
              - us-east-2
          - Fn::Equals:
              - Ref: AWS::Region
              - us-west-1
          - Fn::Equals:
              - Ref: AWS::Region
              - us-west-2

