Core version
The Core package contains the open-source modules of the CARTO Analytics Toolbox for Redshift. This guide walks you through installing the Core package in your Redshift database.
Prerequisites
Python: 3.10+ (tested with 3.10-3.13)
AWS: Account with Lambda and IAM permissions
Redshift: Cluster with admin access
Quick Start
# 1. Download and extract the Core package
curl -L -o carto-at-core-redshift-latest.zip \
https://storage.googleapis.com/carto-analytics-toolbox-core/redshift/carto-analytics-toolbox-core-redshift-latest.zip
unzip carto-at-core-redshift-latest.zip
# 2. Navigate to package directory
cd carto-at-core-redshift-*
# 3. Setup Python environment
python3 -m venv .venv && source .venv/bin/activate
pip install -r scripts/requirements.txt
# 4. Run interactive installer
python scripts/install.pyInstallation Methods
Option 1: Interactive Installation (Recommended)
The installer guides you through configuration with prompts:
Deployment Phases:
Phase 0 (if needed): Auto-creates IAM roles (Lambda execution + Redshift invoke)
Phase 1: Deploys Lambda functions to AWS
Phase 2: Creates external functions in Redshift
Phase 3: Deploys native SQL UDFs
Option 2: Non-Interactive Installation
For automated deployments (CI/CD, scripts), use the --non-interactive flag:
The --non-interactive (or -y) flag is required to skip prompts. Without it, the installer will always prompt interactively, even if all parameters are provided via command line.
Get Help
See all available options:
CLI Parameters Reference
AWS Authentication (Choose one method)
Method 1: AWS Profile (Recommended)
Method 2: Explicit Credentials
Method 3: IAM Role (No parameters needed - automatic on EC2/ECS)
Method 4: Assume Role (Cross-account)
AWS Configuration
--aws-region TEXT
AWS region (default: us-east-1)
Lambda Configuration
--rs-lambda-prefix TEXT
Lambda name prefix (default: carto-at-). Example: mycompany- creates functions named mycompany-function_name
--rs-lambda-execution-role TEXT
Existing Lambda execution role ARN (optional). If not provided, will auto-create during Phase 0
--rs-lambda-override / --no-rs-lambda-override
Override existing Lambdas (default: yes)
Redshift Configuration
--rs-host TEXT
Redshift host endpoint (required). Example: cluster.abc123.us-east-1.redshift.amazonaws.com
--rs-database TEXT
Redshift database name (required)
--rs-user TEXT
Redshift username (required)
--rs-password TEXT
Redshift password (required)
--rs-schema TEXT
Schema for Analytics Toolbox functions (default: carto)
--rs-lambda-invoke-role TEXT
Existing Redshift IAM role ARN (optional). If not provided, will auto-create and attach to cluster during Phase 0
IAM Roles
When IAM role ARNs are not provided, the installer will automatically create them during Phase 0.
Lambda Execution Role
Purpose: Allows Lambda functions to execute and log
Name:
<Prefix>LambdaExecutionRole(e.g.,CartoATLambdaExecutionRole)Trust Policy: Trusts
lambda.amazonaws.comPermissions:
AWSLambdaBasicExecutionRole(CloudWatch Logs)
Redshift Invoke Role
Purpose: Allows Redshift to invoke Lambda functions
Name:
<Prefix>RedshiftInvokeRole(e.g.,CartoATRedshiftInvokeRole)Trust Policy: Trusts
redshift.amazonaws.comPermissions:
lambda:InvokeFunctionon all Lambda functionsAuto-attached: To Redshift cluster (if permissions available)
Using Existing Roles
To use pre-created roles instead of auto-creation:
Required AWS Permissions
For Auto-Creation (Full Install):
lambda:CreateFunction,lambda:UpdateFunctionCode,lambda:UpdateFunctionConfigurationlambda:GetFunction,lambda:AddPermissioniam:CreateRole,iam:GetRole,iam:PutRolePolicy,iam:AttachRolePolicyredshift:DescribeClusters,redshift:ModifyClusterIamRoles
For Existing Roles (Minimal):
lambda:CreateFunction,lambda:UpdateFunctionCode,lambda:UpdateFunctionConfigurationlambda:GetFunction,lambda:AddPermission
Congratulations!
You have successfully installed the CARTO Analytics Toolbox Core in your Redshift database.
Now you can start using the functions from the Core modules in the SQL reference.
Upgrade
To upgrade your Analytics Toolbox Core installation, download the latest package and run the installer again with the same configuration. The new functions and procedures will replace their previous versions.
Last updated
Was this helpful?
