Skip to content

Latest commit

 

History

History
60 lines (48 loc) · 1.83 KB

README.md

File metadata and controls

60 lines (48 loc) · 1.83 KB

Lambda-S3-DB

Simple Key-Value database with HTTP endpoints. Build on AWS Lambda and AWS S3 as storage. Main goal to have ability to store value visit browser link.

API

GET /ADD/folder-key-name?v=value-text - add to S3 folder with timestamp as name
POST /ADD/folder-key-name - value from request body

GET /KEYS/folder-key-name - return ["object-key1", "object-key2"] in JSON format

GET /LIST/folder-key-name - return [{"k": "object-key1", "v": "value-text1"}, ..] in JSON format

GET /GET/object-key - get value
Status code 404 if key not found

GET /SET/object-key?v=value-text - create or update value (Key-Value)
POST /SET/object-key - value from request body

GET /DEL/object-key - delete 

Install

{
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "s3:ListAllMyBuckets",
            "Resource": "arn:aws:s3:::*"
        },
        {
            "Effect": "Allow",
            "Action": "s3:*",
            "Resource": [
                "arn:aws:s3:::MY-BUCKET-NAME",
                "arn:aws:s3:::MY-BUCKET-NAME/*"
            ]
        }
    ]
}
curl -s https://RANDOM.execute-api.us-east-1.amazonaws.com/latest/SET/test?v=hello
# ok
curl -s https://RANDOM.execute-api.us-east-1.amazonaws.com/latest/GET/test
# hello