Inside Cognito User Pool create web app client and Configure redirect URL
Create Lambda Function for signup will fetch user image from google/fb
It may seem obvious but lambda has to have permission to s3/dynamodb
Create API Gateway REST API with Lambda as handler
donât forget to enable CORS, attach custom domain
Create Usage plan
Create Stage
To enable logging you must create IAM role
After processing of the track is finished successfully we send message to dedicated fifo queue.
Outdated tracks(nowâââcreated_at < [reasonable time delta] AND status == âpreparingâ) deleted.
Create ES domain. Attach policy to access Kibana(in our case from ext acc lambda and from local ip):
Using AWS to create Sound sharing platform
Prerequisite: registered domain name
Create Route 53 AÂ record
Configure ACM certificate in N. Virginia region .example.com
Create s3 bucket with website feature to host static files
Create s3 bucket for avatars/artworks
Create Cloudfront distribution and attach ACM cert to it
Create Cognito User Pool
Attach own domain to Cognito User Pool
Inside Cognito User Pool create web app client and Configure redirect URL
Create Lambda  signup post confirmation trigger Function it will fetch user image from google/fb
It may seem obvious but lambda has to have permission to s3/dynamodb
Create API Gateway REST API with Lambda as handler
donât forget to enable CORS, attach custom domain
Create dynamodb users table with sub as partition key
export type User = { username: string date_joined: Date first_name: string last_name: string city: string country: string description: string email: string track_count: number avatar_url: string permalink: string}
Create API Gateway Authorizer
Create Usage plan
Create Stage
To enable logging you must create IAMÂ role
why did I choose DynamoDB: for example facebook users tend to read but not to post. Keep data ready to read = writing could be more complex
API GWâââUse id_token, assign api key, usage plan, custom domain path mapping
Attach authorizer to appropriate endpoints
Create user pool trigger on Post confirmation event to store user in db !!!
Build FFmpeg with dumpwave-filter patch applied or use prepared lambda package humeniukd/ffmpeg-lambda.
Create two s3 buckets first for incoming audio and second for storing processed mp3 along with json.
For incoming bucket setup trigger for PUT event to execute wf-lambda function.
Upload policy endpoint for generating presigned s3 url to PUT/POST new uploads
After processing of the track is finished successfully we send message to dedicated fifo queue. Outdated tracks(nowâââcreated_at < [reasonable time delta] AND status == âpreparingâ) deleted.
Create ES domain. Attach policy to access Kibana(in our case from ext acc lambda and from local ip):
{ "Version": "2012â10â17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::HIDDEN:role/yes" }, "Action": "es:", "Resource": "arn:aws:es:eu-central-1: HIDDEN:domain/ohyo/" }, { "Effect": "Allow", "Principal": { "AWS": "" }, "Action": "es:", "Resource": "arn:aws:es:eu-central-1: HIDDEN:domain/ohyo/*", "Condition": { "IpAddress": { "aws:SourceIp": "AA.BB.CC.DD" } } } ]}
Create mapping for tags autocomplete suggested
Put tags to new index
Create endpoint to retrieve tags for autocompletion
Create endpoint to save track metadata
Create endpoint to resolve track/user by permalink
To respond with status 404 lambda should throw Error with message text recognised by API Gateway:
-Put item to dynamodb(update user)
Export API as swagger JSON
Generate types on the FE side using yarn generate:types
-Refresh ES index for search
Configure api gateway template mapping for skipping empty fields
Create user stream pagination using user_id as partition key and created_at as sort key
If LastEvaluatedKey is present use it for next url query params
Set up dynamodb stream to process newly created comments
To POST artwork img configure api to accept encodings such as
Go to the API Gateway settings tab for your API and add multipart/form-data, image/jpeg to the binary media typessection.
Add Content-Type and Accept to the request headers for your proxy method
Add Access-Control-Allow-Methods to Method Response headers
Re-deploy the API