examples/rgw/golang/put-bucket-notification-creation/README.md
This directory contains Golang code examples on how to create a put bucket notification to a topic and S3 bucket running on a Ceph RGW cluster.
Linux machine running an RGW Ceph cluster. Preferrably started with the OSD=1 MON=1 MDS=0 MGR=0 RGW=1 ../src/vstart.sh --debug --new command.
Go installed on the Linux machine.
aws --region default --endpoint-url http://localhost:8000 sns create-topic --name=sample-topic --attributes='{"push-endpoint": "http://localhost:10900"}'
aws --endpoint-url http://localhost:8000 s3 mb s3://sample-bucket
go mod init examples/put-bucket-notification-creation/v2
go get github.com/aws/aws-sdk-go
go mod tidy
go run put-bucket-notification-creation.go -b sample-bucket -t arn:aws:sns:default::sample-topic on the terminal window to create the put bucket notification with the suffix filter rule.aws --endpoint-url http://localhost:8000 s3 cp your-jpg-file.jpg s3://sample-bucket