Skip to content

Instantly share code, notes, and snippets.

@rjozefowicz
Last active October 31, 2020 07:50
Show Gist options
  • Save rjozefowicz/38c412f22ec8c53fa5d699d0649a788a to your computer and use it in GitHub Desktop.
Save rjozefowicz/38c412f22ec8c53fa5d699d0649a788a to your computer and use it in GitHub Desktop.
stacja.it - Wprowadzenie do serverless framework - 31.10.2020

Wprowadzenie do serverless framework workshop Stacja.IT - 31.10.2020

Aplikacja my-notes

{
  "labels": [
    "Building",
    "Cottage",
    "Countryside",
    "House",
    "Housing",
    "Nature",
    "Outdoors",
    "Person",
    "Roof",
    "Shelter"
  ],
  "noteId": "e7466188-c0e9-4cd4-b9fc-533561c25498",
  "s3Location": "fd3be9de-bd0d-44c9-85e5-bf24a4c5503d/e7466188-c0e9-4cd4-b9fc-533561c25498/krzykowdom.jpg",
  "size": "123165",
  "timestamp": "1563820937739",
  "title": "krzykowdom.jpg",
  "text": "my note text",
  "type": "IMAGE",
  "userId": "fd3be9de-bd0d-44c9-85e5-bf24a4c5503d"
}

Architektura

alt text

File upload

alt text

File download

alt text

@rjozefowicz
Copy link
Author

rjozefowicz commented Apr 24, 2020

Static website hosting - S3 Bucket Policy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::my-notes-website-<PREFIX>/*"
        }
    ]
}

Upload my-notes to your bucket

aws s3 rm s3://YOUR_BUCKET --recursive && aws s3 sync . s3://YOUR_BUCKET

@rjozefowicz
Copy link
Author

rjozefowicz commented Apr 24, 2020

my-notes-attachments CORS Policy

[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "PUT"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": [],
        "MaxAgeSeconds": 3000
    }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment