HEX
Server: LiteSpeed
System: Linux ip-172-31-76-142.ec2.internal 4.14.158-129.185.amzn2.x86_64 #1 SMP Tue Dec 24 03:15:32 UTC 2019 x86_64
User: 69b4844ae61d4e92bf26ad98af552775 (1065)
PHP: 7.2.27
Disabled: exec,passthru,shell_exec,system,eval
Upload Files
File: //lib/python2.7/site-packages/awscli/examples/s3api/put-bucket-notification-configuration.rst
The applies a notification configuration to a bucket named ``my-bucket``::

  aws s3api put-bucket-notification-configuration --bucket my-bucket --notification-configuration file://notification.json

The file ``notification.json`` is a JSON document in the current folder that specifies an SNS topic and an event type to monitor::

  {
     "TopicConfigurations": [
         {
             "TopicArn": "arn:aws:sns:us-west-2:123456789012:s3-notification-topic",
             "Events": [
                 "s3:ObjectCreated:*"
             ]
         }
     ]
 }

The SNS topic must have an IAM policy attached to it that allows Amazon S3 to publish to it::

  {
   "Version": "2008-10-17",
   "Id": "example-ID",
   "Statement": [
    {
     "Sid": "example-statement-ID",
     "Effect": "Allow",
     "Principal": {
       "Service": "s3.amazonaws.com"  
     },
     "Action": [
      "SNS:Publish"
     ],
     "Resource": "arn:aws:sns:us-west-2:123456789012:my-bucket",
     "Condition": {
        "ArnLike": {          
        "aws:SourceArn": "arn:aws:s3:*:*:my-bucket"    
      }
     }
    }
   ]
  }