Deployment and Modeling of AWS Redshift Serverless (A cloud data warehouse).
-
The NodeJS script (index.js) creates and deletes the following resources:
- Redshift Serverless Namespace
- Redshift Serverless Workgroup
- Redshift Serverless Usage Limit
-
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
-
- 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
- curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash -
-
- NodeJS script: index.js
- JSON files: credentials.json and inputConfig.json
- NodeJS script: index.js
-
- References for inputConfig.json :
- https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-redshift-serverless/classes/createnamespacecommand.html
- https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-redshift-serverless/classes/createworkgroupcommand.html
- https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-redshift-serverless/classes/createusagelimitcommand.html
- https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-redshift-serverless/classes/deleteworkgroupcommand.html
- References for inputConfig.json :
-
- sudo node index.js
- sudo node index.js
-
- Ensure that the environment (dev, stag or prod) and region in the file (inputConfig.json) correspond to the values in the GitHub Actions YML file.
- Add the actual values of the AWS IAM Role(s), AWS VPC Security Group id(s) and AWS VPC subnet ids to the GitHub Secrets instead of specifying them in the config file (inputConfig.json) to avoid exposing their values.
- See the env sections of the YML Deployment File: https://github.com/MongoExpUser/AWS-Redshift-Serverless-with-AWS-SDK-JS-V3/blob/main/.github/workflows/deploy-redshift-sless.yml
- Ensure that the environment (dev, stag or prod) and region in the file (inputConfig.json) correspond to the values in the GitHub Actions YML file.
-
- These include: accessKeyId, secretAccessKey and region.
- This prevents exposure of the credentials.
Copyright © 2023. MongoExpUser
Licensed under the MIT license.