Skip to content

etvincen/Serverless-API-FRG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serverless-API-FRG

AMI: EC2 - t2.medium eu-west-1c

Setup

Make sure to have an .aws credentials directory and awscli installed.

Clone the repository and navigate to its root:
git clone https://github.com/etvincen/Serverless-API-FRG.git
cd Serverless-API-FRG.git
Install required plugins:
sls plugin install -n serverless-wsgi
sls plugin install -n serverless-python-requirements
Create a new virtual environnement with virtualenv:
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

Modify the bucket name in code to store the JSON objects:
In app.py (at line 25), set the variable "bucket_name" to the name of one of your created bucket.

Notes

Chosen test format: csv
Ideal test file: test_file/datagouv.csv

Launch app and Submit a test file

run sls deploy
Once the application is deployed,
run cd test_file
run curl -F file=@./datagouv.csv https://ny3q4ymis8.execute-api.eu-west-1.amazonaws.com/dev/json (The domain name delivered by the serverless app might change)

Config deletion of uploaded ressources after 1 year

  • Select the S3 bucket of your choice
  • Go to Management > Life Cycle
  • Click on Add a life cyle rule
  • Type a name for the rule
  • Tick Apply to all objects of the container
  • Click next
  • Leave the Transition fields blank
  • Click next
  • Tick Actual Version
  • Tick Make the object actual versions expires
  • Type 365 in the input field
  • Click next
  • Tick the confirmation box and click Save

The rule is now active and all objects already stored in the bucket will expire in 365 days (included).

About

A simple metadata extraction API hosted on Amazon, deployable with Serverless

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages