Skip to content

AWS Rest API that invokes a lambda that queries a private RDS database

Notifications You must be signed in to change notification settings

mattyboy84/AWS-API-query-RDS

Repository files navigation

API-query-RDS


Setup:

  1. Deploy project to aws
  2. Copy the RDSDBSecretArn output by the stack
  3. Go to RDS & select Query on the database
  4. enter these credentials with the Secrets manager ARN as the RDSDBSecretArn
  5. create the Customers Table
CREATE TABLE Customers (
  CustomerId int,
  FirstName varchar(255)
)
  1. create a few example customers
INSERT INTO Customers (CustomerId, FirstName) VALUES (100, 'Name');
INSERT INTO Customers (CustomerId, FirstName) VALUES (101, 'Name1');
INSERT INTO Customers (CustomerId, FirstName) VALUES (102, 'Name2');
  1. make a GET request to the HttpApiUrl output by the stack. Making a GET request to https://ID.execute-api.region.amazonaws.com/CustomerId/100. You will recieve:
[
    {
        "CustomerId": 100,
        "FirstName": "Name"
    }
]

About

AWS Rest API that invokes a lambda that queries a private RDS database

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages