Giter Club home page Giter Club logo

aws-lambda-python-postgresql's Introduction

AWS Lambda Integration with PostgreSQL

This repository will help in creating the AWS Lambda Function in Python, which will connect to PostgreSQL DB over SSL.

Tech Stack

  Python 3.6
  AWS Lambda 
  PostgreSQL
  Psycopg2(Postgres connector)
  SSL

Assumption

  DB is already created with some table and access on AWS cloud. 

Steps Required for Project Setup

  1- Install Python3.6 or 3.8
  2- Create a lambda project in python
  3- Add psycopg2 dependency in your project root. (Add Image) (Reference)
  3- Get SSL certificate from AWS (), add this SSL Certificate to your project directory. (Add Image)
  4- Access this certificate in your code and use it in your psycopg2.connect() as sslMode and ssl_ca.(Add Image)
  5- Zip it and upload it in AWS lambda (Note: Zip name and lambda name should be same, and lambda_funcation.py should be on root of zip)

Steps Required for Project Deployment

1- Create Lambda furcation (Image) with same name as project zip.
2- Create Lambda a Role, which should have RDSAccess Permission. 
3- Lambda should be in same VPC and subnets as PostgreSQL
4- Lambda should have a Security Group, this security group should have permission in PostgreSQL. So there should be a inbound rule in PostgreSQL Security Group for Lambda Security Group 

Step Run

Steps to upload ZIP file to AWS Lambda

References

SSL

SSL MODE

postgresql-and-python

awslambda-psycopg2

SSL Issue

aws-lambda-python-postgresql's People

Contributors

bharatsdev avatar

Watchers

 avatar  avatar

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.