
Overview
Use Amazon Redshift as a destination in Mage to export pipeline data into a highly scalable, cloud-based data warehouse. Mage supports both standard username/password authentication and IAM database authentication using AWS access keys. Mage will automatically create and write to the specified table, with support for optional schema management and merge-based updates.Configuration Parameters
You must provide the following credentials when configuring Redshift as a destination:Key | Description | Example Value | Required |
---|---|---|---|
database | Name of the Redshift database where data will be written. | demo | ✅ |
host | Hostname of the Redshift cluster endpoint. | mage-prod.3.us-west-2.redshift.amazonaws.com | ✅ |
port | Redshift port (default is 5439 ). | 5439 | ✅ |
user | Redshift username with access to the database and schema. | awsuser | ✅ (if not using IAM) |
password | Password for the Redshift user. | abc123... | ✅ (if not using IAM) |
schema | Schema within the database where the table will be created or written to. | public | ✅ |
table | Name of the destination table to store data from your pipeline. | dim_users_v1 | ✅ |
region | AWS region where the Redshift cluster is hosted. | us-west-2 | ✅ |
use_merge_load | If true , Mage will attempt to merge incoming data with existing records (UPSERT-like behavior). | false (default) | ❌ |
use_s3_copy | If true , Mage will upload data to S3 and load into Redshift using the COPY command (Pro feature). | false (default) | ❌ |
type_mapping | Custom mapping to override default column type conversions. Useful for specifying custom Redshift data types like SUPER for JSON data (Pro feature). | see below | ❌ (Pro) |
Note:use_s3_copy
andtype_mapping
are Mage Pro-only features.use_s3_copy
enables faster bulk loads via S3 and supports IAM roles or access key authentication.
IAM-Based Authentication (Alternative to User/Password)
If you prefer to use IAM credentials instead of traditional authentication, you can use the following fields:Key | Description | Example Value | Required (if using IAM) |
---|---|---|---|
access_key_id | AWS access key ID for an IAM user or role with Redshift database access. | AKIA... | ✅ |
secret_access_key | AWS secret access key corresponding to the above access key ID. | xyz123... | ✅ |
cluster_identifier | Identifier of the Amazon Redshift cluster. | mage-prod | ✅ |
db_user | IAM-authenticated Redshift user. | admin | ✅ |
S3 Configuration (Required if use_s3_copy
is true)
Only in Mage Pro.Try our fully managed solution to access this advanced feature.
Key | Description | Required | Sample Value |
---|---|---|---|
aws_access_key_id | AWS access key for uploading data to S3. Ignored if using IAM role. | ✅ (unless using IAM role) | AKIA... |
aws_secret_access_key | AWS secret key for uploading data to S3. Ignored if using IAM role. | ✅ (unless using IAM role) | xyz... |
aws_region | Region where the S3 bucket is located. | ✅ | us-west-2 |
bucket | S3 bucket to temporarily stage Parquet files for Redshift COPY. | ✅ | mage-feature-sets |
redshift_iam_role | IAM role ARN with S3 read access attached to your Redshift cluster. | Optional | arn:aws:iam::123456789012:role/MyRedshiftRole |
s3_creds
config object:
Type Mapping
Only in Mage Pro.Try our fully managed solution to access this advanced feature.
type_mapping
configuration allows you to override default column type conversions. This is useful for advanced cases like storing JSON in Redshift’s SUPER
type or adjusting column widths.
Example Configuration
YAML Format:Supported Overrides
object
→ Redshift type for JSON objects (e.g.,SUPER
)array
→ Redshift type for JSON arrays (e.g.,SUPER
)string
→ Custom VARCHAR or other string typedatetime
→ Custom timestamp type (e.g.,TIMESTAMPTZ
)number
→ Custom numeric type (e.g.,BIGINT
)
When usingSUPER
, Mage automatically appliesJSON_PARSE()
for correct Redshift insertion.
Optional Parameters
Key | Description | Example Value |
---|---|---|
skip_schema_creation | If true , Mage will skip running the CREATE SCHEMA command. Useful if the schema already exists. See issue | true |
lower_case | If true , Mage will automatically convert column names to lowercase. Default is true . | true |