Coder Social home page Coder Social logo

boto3-multiaccount-file-upload's Introduction

Mentum file upload

Note: depending on your system's configuration, you may need to use python3/pip3 instead of python/pip.

About

Mentum's file upload service is responsible for uploading files to s3 buckets distributed in multiple AWS accounts where AssumeRoles cannot be used (e.g. different account owners, privacy laws such as GDPR, etc).

Getting started

Configuration

  1. Before getting started, make sure you have the right python version: python --version should be >=3.10.4,<4.0.
  2. Install the required dependencies: pip install -r requirements.txt
  3. Start the Django application: python manage.py runserver

Environment variables (env vars)

AWS accounts

This service can concurrently upload files to different AWS accounts. Every AWS account credentials secret should follow the following schema for it's env vars.

{
  "access_key_id": "string",
  "secret_access_key": "string",
  "region_name": "string",
  "s3_bucket_name": "string"
}

Code references:

mentumfileupload/.env

file/logic/handleinmultipleaccounts.py

Running locally

# Copy the example environment file and add the required AWS accounts objects
cp mentumfileupload/.env.example mentumfileupload/.env

# Run the test server
python manage.py runserver

Building and running build locally

Docker is required for the following commands

https://www.docker.com/get-started/

# Copy the example environment file and add the required AWS accounts credentials
cp mentumfileupload/.env.example mentumfileupload/.env

# Build container image
docker build -t file-upload .

# Running container with custom env vars
docker run --env-file mentumfileupload/.env -p 8000:8000 file-upload

Tests

You can run the service tests (unit and integration) running the following commands:

# Make sure you have an environment file available
cp mentumfileupload/.env.testing mentumfileupload/.env

# Run the test suite
python manage.py test

Notes

Architectural decisions

TODO:

  • Find alternatives to ProcessPoolExecutor, follow up with asyncio.

boto3-multiaccount-file-upload's People

Contributors

brennedith avatar

Watchers

 avatar

boto3-multiaccount-file-upload's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.