- start vstart cluster:
MON=1 OSD=1 MDS=0 MGR=0 RGW=1 ../src/vstart.sh -n -d
- run elasticserach in a container:
podman run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.13.2
- create a topic pointing to the desired index in elasticserach:
aws --endpoint-url http://localhost:8000 sns create-topic --name=cattopic \
--attributes='{"push-endpoint": "http://localhost:9200/cattopic/_doc/"}'
in the above example, we used the same name for the RGW bucket notifications topic and the elasticsearch index, but they can be different.
- create a bucket:
aws --endpoint-url http://localhost:8000 s3 mb s3://cat
- create a notification for the above topic and bucket:
aws --region=default --endpoint-url http://localhost:8000 s3api put-bucket-notification-configuration --bucket cat \
--notification-configuration='{"TopicConfigurations": [{"Id": "notif", "TopicArn": "arn:aws:sns:default::cattopic", "Events": []}]}'
- upload an object to the bucket:
aws --endpoint-url http://localhost:8000 s3 cp myfile s3://cat
- verify that the notification is in elasticsearch:
curl -XGET localhost:9200/cattopic/_search