Giter Site home page Giter Site logo

aws-sdk-rds-s3-lambda's Introduction

TypeScript Lambda functions in AWS CDK

How to Use

  1. Clone the repository

  2. Install the dependencies

npm install
  1. ONE TIME ONLY - if it is the First time, then bootstrap the repository config (Only run this the very first time, SKIP after that)
npx aws-cdk bootstrap
  1. CDk Synth
cdk synth
  1. Create the CDK stack
cdk deploy
  1. Open the AWS Console and the stack should be created in your default region

  2. Cleanup

cdk destroy
  1. Also, navigate to RDS and S3 console to delete the RESOURCES created using SDK. You need to manually delete those once you are done with the TESTING otherwise it will incur you the cost.

Lambda Stack Details

Once STACK is deployed, you should see TWO Lambda. Both Lambda has Public URL so open the Lambda URL to trigger Create/Query request.

  • aws-sdk-s3-lambda (To Create and Query S3 )
  • aws-sdk-rds-lambda (To Create and Query RDS (MySql) Instances)

Additional Steps once RDS instance is Created

Note: This needs to be done once the STACK is DEPLOYED (If a RULE for TCP inbound is missing).

Oncs MySql Instance is up and Running, make sure you ADD an INBOUND Rule to make DATABASE publicly accessible.

  • STEPS to Create a rule`
    • Go RDS console
    • Under "Connectivity & Security Section", look for VPC security groups, You will find a hyperlink for example - (sg-***).
    • Clicking on the link, will redirect you to Security Rules.
    • Click on Inbound Rule ==> Edit Inbound Rules
    • Add rules with a Below Settings.
      • Type - MySQL/Aurora
      • Protocol - TCP
      • Port Range - 3306
      • Source - custom 0.0.0.0
    • SAVE the RULE

Testing

  • You can use Lambda TEST function to test the functionality of the Lambdas

References

S3

RDS Documentation

RDS Documentation:

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.