Skip to content

MongoExpUser/AWS-Redshift-Serverless-with-AWS-SDK-JS-V3

Repository files navigation

CI - AWS-SDK-JS-V3 Deploy RSSL

AWS-Redshift-Serverless-with-AWS-SDK-JS-V3

Deployment and Modeling of AWS Redshift Serverless (A cloud data warehouse).

  1. The NodeJS script (index.js) creates and deletes the following resources:

    • Redshift Serverless Namespace
    • Redshift Serverless Workgroup
    • Redshift Serverless Usage Limit
  2. Additional SQL scripts in the repo for modeling include:

    • DDL script (ddl.sql) for data objects (TABLES) creation. Run via Redshift Query Editor 2
    • DML script (dml-v1.sql) for inserting data. Run via either:
      • Redshift Query Editor 2
      • NodeJS module - @aws-sdk/client-redshift-data (AWS-SDK-JS-V3)
    • DQL script (dql.sql). Run via Redshift Query Editor 2

DEPLOYING AWS Redshift Serverless with the NodeJS script

Option 1: Clone to Local Computer

To deploy the stack on AWS, follow these steps:

  1. Install NodeJS and relevant NodeJS AWS-SDK V3 modules, assuming Ubuntu or Debian Linux OS

    • curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash -
    • sudo apt-get install -y nodejs
    • sudo npm install @aws-sdk/client-redshift-serverless
    • sudo npm install @aws-sdk/client-redshift-data
  2. Download or clone the following files, from this repo, into the current working directory (CWD):

    • NodeJS script: index.js
    • JSON files: credentials.json and inputConfig.json
  3. Fill in relevant values in the inputConfig.json file.

  4. Then run the code, assuming sudo access:

    • sudo node index.js

OPTION 2: Through GitHub Actions

To deploy on AWS, follow these steps:

  1. Check and fill relevant values in the GitHub Actions YML deployment file.

  2. Also fill relevant values in the inputConfig.json file.

  3. Add the actual values for credentials to the GitHub Secrets.

    • These include: accessKeyId, secretAccessKey and region.
    • This prevents exposure of the credentials.
  4. Then enable GitHub Actions Workflow and run the YML file.

License

Copyright © 2023. MongoExpUser

Licensed under the MIT license.

About

Deployment and Modeling of AWS Redshift Serverless

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published