AWS - Notify SQS with S3

Hi,

I’m trying to notify an SQS Queue when an object is created in an S3 bucket.
This is my serverless.json:

{
    "service": "my-service",
    "provider": {
        "name": "aws",
        "runtime": "python3.8",
        "lambdaHashingVersion": 20201221
    },
    "resources":{
        "Resources":{
            "InputQueue":{
                "Type": "AWS::SQS::Queue",
                "Properties": {
                    "QueueName": "InputQueue"
                }
            },
            "InputBucket":{
                "Type": "AWS::S3::Bucket",
                "Properties": {
                    "BucketName": "my-input-bucket-${self:provider.stage}",
                    "NotificationConfiguration": {
                        "QueueConfigurations": [
                            {
                                "Event": "s3:ObjectCreated:*",
                                "Queue": {
                                    "Fn::GetAtt": [
                                      "InputQueue",
                                      "Arn"
                                    ]
                                }
                            }
                        ]
                    }
                    
                }
            }
        }
    }
}

I’m getting the following error: An error occurred: InputBucket - Unable to validate the following destination configurations (Service: Amazon S3; Status Code: 400; Error Code: InvalidArgument;

What am I missing?

I figured it out.
I was missing the QueuePolicy resource.

After adding the code bellow to resources, it’s working.

"SqsQueuePolicy" : {
    "Type" : "AWS::SQS::QueuePolicy",
    "Properties" : {
    "Queues" :  [
        {
            "Ref": "InputQueue2"
        }
    ],
    "PolicyDocument": {
        "Version": "2012-10-17",
        "Statement":[{
        "Action":["sqs:SendMessage"],
        "Effect":"Allow",
        "Resource": "*",
        "Principal": "*"
        }]
    }
    }
} 

In your solution, you are creating a new s3 bucket, is there any way of using an existing bucket?