Redshift Component
Execute SQL statements and manage data in Amazon Redshift using the AWS Redshift Data API
Component key: aws-redshift
Description
Amazon Redshift is a data warehouse service in the cloud to analyze large datasets using standard SQL and existing business intelligence tools. This component allows executing SQL statements and managing data in Amazon Redshift using the AWS Redshift Data API.
API Documentation
This component was built using the AWS SDK for JavaScript v3
Connections
Access Key and Secret
key: awsAccessKeySecretAn AWS IAM access key pair is required to interact with Redshift. Ensure the key pair generated in AWS has proper permissions to the Redshift resources to access. Read more about Redshift IAM actions in the AWS docs.
Setup Steps
- Sign in to the AWS Console and navigate to Identity and Access Management (IAM)
- Under the Access Keys section, select Create access key
- Once created, copy the Access Key and Secret access key
Configure the Connection
Create a connection of type AWS Access Key/Secret Key and enter:
- Access Key ID: The AWS Access Key ID
- Secret Access Key: The AWS Secret Access Key
| Input | Notes | Example |
|---|---|---|
| Access Key ID | The AWS Access Key ID used to authenticate requests to the Redshift Data API. | AKIAIOSFODNN7EXAMPLE |
| Secret Access Key | The AWS Secret Access Key paired with the Access Key ID for request signing. | wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY |
AWS Role ARN
key: awsAssumeRoleTo enable IAM role authentication, log in to the AWS Console and navigate to Identity and Access Management (IAM).
Setup Steps
Create an ARN user and generate credentials:
-
Navigate to Users and select Create User.
- Provide a user name and check the box providing user access to the AWS Management Console if needed.
- Once the user is created, copy the ARN provided in the summary for a later step.
-
To obtain the ARN for an existing user, click on the designated username from the Users page and the ARN will be provided in the summary section.
-
From the summary section, select Create access key
- Select Third-party service as the access key type and select Next.
- Set a description and select Create access key.
- Copy the Access Key and Secret access key for use in the connection configuration.
Create and assign a role:
- Navigate to Roles and select Create Role.
- Select Custom Trust Policy for the Trusted entity types.
- Copy the following statement into the statement console, replacing ARN with the user's actual ARN from the previous step:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "ARN"
},
"Action": "sts:AssumeRole"
}
]
}
- When adding permissions, provide the redshift:* permission to grant access to all Redshift operations.
- Complete the remaining steps and select Create Role.
Configure the Connection
Create a connection of type AWS Role ARN and enter:
- Role ARN: The ARN of the IAM role to assume (e.g.,
arn:aws:iam::OtherAccount-ID:role/assumed-role-name) - Access Key ID: The AWS IAM Access Key ID
- Secret Access Key: The AWS IAM Secret Access Key
- External ID (optional): A shared secret for enhanced security; see the AWS docs for more information
| Input | Notes | Example |
|---|---|---|
| Access Key ID | An AWS IAM Access Key ID | AKIAIOSFODNN7EXAMPLE |
| External ID | Provides enhanced security measures to the connection. Optional, but recommended. Please check AWS docs for more information. | shared-common-secret |
| Role ARN | An AWS IAM Role ARN | arn:aws:iam::OtherAccount-ID:role/assumed-role-name |
| Secret Access Key | An AWS IAM Secret Access Key | wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY |
Data Sources
Select AWS Region
Select an AWS region | key: selectRegion | type: picklist
Actions
Describe Statement
Get detailed information about a specific SQL statement in Redshift. | key: describeStatement
| Input | Notes | Example |
|---|---|---|
| AWS Connection | Select the AWS connection to use for Redshift Data API access. | |
| AWS Region | AWS provides services in multiple regions, like us-west-2 or eu-west-1. | us-east-1 |
| Statement ID | The unique identifier of the executed SQL statement returned by the Redshift Data API. | 12345678-1234-1234-1234-123456789012 |
{
"data": {
"$metadata": {
"httpStatusCode": 200,
"requestId": "example-request-id-12345-67890-abcdef",
"attempts": 1,
"totalRetryDelay": 0
},
"CreatedAt": "2025-01-15T10:30:00.000Z",
"Database": "example_database",
"Duration": 257716773,
"HasResultSet": false,
"Id": "example-statement-id-12345-67890-abcdef",
"QueryString": "INSERT INTO example_table (id, name, email)\nVALUES (1, 'Example User', 'user@example.com');\n",
"RedshiftPid": 123456789,
"RedshiftQueryId": 987654,
"ResultFormat": "JSON",
"ResultRows": 1,
"ResultSize": 0,
"SecretArn": "arn:aws:secretsmanager:us-east-1:123456789012:secret:redshift/example-secret-name",
"Status": "FINISHED",
"UpdatedAt": "2025-01-15T10:31:00.000Z",
"WorkgroupName": "example-workgroup"
}
}
Execute SQL Statement
Execute a SQL statement in Redshift. | key: executeStatement
| Input | Notes | Example |
|---|---|---|
| AWS Connection | Select the AWS connection to use for Redshift Data API access. | |
| AWS Region | AWS provides services in multiple regions, like us-west-2 or eu-west-1. | us-east-1 |
| Client Token | Unique identifier to ensure idempotency of the request. | client-token-123 |
| Cluster Identifier | The identifier of the Redshift cluster. Required for cluster connections using either Secrets Manager or temporary credentials. | my-redshift-cluster |
| Database Name | The name of the database to connect to. This parameter is required when authenticating using either Secrets Manager or temporary credentials. | analytics |
| Database User | The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials. | admin |
| Get Statement Result | When true, waits for the statement to finish executing and returns its result set. Only SELECT statements produce result rows. <strong>Note:</strong> long-running statements may cause a timeout. | true |
| Result Format | The format for query results (JSON or CSV). | JSON |
| Secret ARN | The ARN of the AWS Secrets Manager secret containing database credentials. Required when authenticating using Secrets Manager. | arn:aws:secretsmanager:us-east-1:123456789012:secret:redshift-credentials |
| Session ID | The ID of an existing session to reuse for statement execution, enabling multiple statements to share temporary tables and transaction state. | session-12345678 |
| Session Keep Alive (seconds) | Number of seconds to keep the session alive after query completion (max 24 hours). | 3600 |
| SQL Parameters | Named parameters that are substituted into the SQL statement at runtime using the colon-prefixed placeholder syntax (e.g., :status). | status: active, limit: 100 |
| SQL Statement | The SQL statement to run against the Redshift database. Supports DML (INSERT, UPDATE, DELETE), DDL (CREATE, DROP, ALTER), and query (SELECT) statements. | |
| Statement Name | A descriptive label assigned to the SQL statement to help identify it when listing or filtering statements later. | GetActiveUsers |
| Workgroup Name | The name of the Redshift serverless workgroup. This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials. | my-workgroup |
{
"data": {
"executeStatement": {
"$metadata": {
"httpStatusCode": 200,
"requestId": "example-request-id-12345-67890-abcdef",
"attempts": 1,
"totalRetryDelay": 0
},
"CreatedAt": "2025-01-15T10:30:00.000Z",
"Database": "example_database",
"Id": "example-statement-id-12345-67890-abcdef",
"SecretArn": "arn:aws:secretsmanager:us-east-1:123456789012:secret:redshift/example-secret-abc123",
"WorkgroupName": "example_workgroup"
},
"statementResults": {
"$metadata": {
"httpStatusCode": 200,
"requestId": "example-request-id-12345-67890-abcdef",
"attempts": 1,
"totalRetryDelay": 0
},
"ColumnMetadata": [
{
"isCaseSensitive": false,
"isCurrency": false,
"isSigned": true,
"label": "id",
"length": 0,
"name": "id",
"nullable": 1,
"precision": 10,
"scale": 0,
"schemaName": "public",
"tableName": "users",
"typeName": "int4"
},
{
"isCaseSensitive": true,
"isCurrency": false,
"isSigned": false,
"label": "name",
"length": 0,
"name": "name",
"nullable": 1,
"precision": 50,
"scale": 0,
"schemaName": "public",
"tableName": "users",
"typeName": "varchar"
},
{
"isCaseSensitive": true,
"isCurrency": false,
"isSigned": false,
"label": "email",
"length": 0,
"name": "email",
"nullable": 1,
"precision": 100,
"scale": 0,
"schemaName": "public",
"tableName": "users",
"typeName": "varchar"
}
],
"Records": [
[
{
"longValue": 1
},
{
"stringValue": "Alice"
},
{
"stringValue": "alice@example.com"
}
]
],
"TotalNumRows": 1
}
}
}
Get Statement Result
Retrieve the results of an executed SQL statement from Redshift. | key: getStatementResult
| Input | Notes | Example |
|---|---|---|
| AWS Connection | Select the AWS connection to use for Redshift Data API access. | |
| AWS Region | AWS provides services in multiple regions, like us-west-2 or eu-west-1. | us-east-1 |
| Next Token | The pagination token returned from a previous list request, used to retrieve the next page of results. | AQICAHi2k9rFZ... |
| Statement ID | The unique identifier of the executed SQL statement returned by the Redshift Data API. <strong>Note:</strong> Only statements that return results are supported. | 12345678-1234-1234-1234-123456789012 |
{
"data": {
"$metadata": {
"httpStatusCode": 200,
"requestId": "example-request-id-12345-67890-abcdef",
"attempts": 1,
"totalRetryDelay": 0
},
"ColumnMetadata": [
{
"isCaseSensitive": false,
"isCurrency": false,
"isSigned": true,
"label": "id",
"length": 0,
"name": "id",
"nullable": 1,
"precision": 10,
"scale": 0,
"schemaName": "public",
"tableName": "users",
"typeName": "int4"
},
{
"isCaseSensitive": true,
"isCurrency": false,
"isSigned": false,
"label": "name",
"length": 0,
"name": "name",
"nullable": 1,
"precision": 50,
"scale": 0,
"schemaName": "public",
"tableName": "users",
"typeName": "varchar"
},
{
"isCaseSensitive": true,
"isCurrency": false,
"isSigned": false,
"label": "email",
"length": 0,
"name": "email",
"nullable": 1,
"precision": 100,
"scale": 0,
"schemaName": "public",
"tableName": "users",
"typeName": "varchar"
}
],
"Records": [
[
{
"longValue": 1
},
{
"stringValue": "Alice"
},
{
"stringValue": "alice@example.com"
}
]
],
"TotalNumRows": 1
}
}
List Statements
List executed SQL statements in Redshift. | key: listStatements
| Input | Notes | Example |
|---|---|---|
| AWS Connection | Select the AWS connection to use for Redshift Data API access. | |
| AWS Region | AWS provides services in multiple regions, like us-west-2 or eu-west-1. | us-east-1 |
| Cluster Identifier | The cluster identifier. Only statements that ran on this cluster are returned. When providing <code>ClusterIdentifier</code>, then <code>WorkgroupName</code> can't be specified. | my-redshift-cluster |
| Database Name | The name of the database when listing statements run against a <code>ClusterIdentifier</code> or <code>WorkgroupName</code>. | analytics |
| Statement Name | The name of the SQL statement specified as input to <code>BatchExecuteStatement</code> or <code>ExecuteStatement</code> to identify the query. Multiple statements can be matched by providing a prefix that matches the beginning of the statement name. | GetActiveUsers |
| Status | Filters the returned statements to only those matching this execution status. Use ALL to retrieve statements in any state. | ALL |
| Workgroup Name | The serverless workgroup name or Amazon Resource Name (ARN). Only statements that ran on this workgroup are returned. When providing <code>WorkgroupName</code>, then <code>ClusterIdentifier</code> can't be specified. | my-workgroup |
{
"data": {
"$metadata": {
"httpStatusCode": 200,
"requestId": "example-list-request-id-12345-67890-abcdef",
"attempts": 1,
"totalRetryDelay": 0
},
"Statements": [
{
"CreatedAt": "2025-01-15T10:30:00.000Z",
"Id": "example-statement-id-12345-67890-abcdef",
"QueryString": "CREATE TABLE users (\n id INT,\n name VARCHAR(50),\n email VARCHAR(100)\n);\n",
"ResultFormat": "JSON",
"SecretArn": "arn:aws:secretsmanager:us-east-1:123456789012:secret:redshift/example-secret-abc123",
"StatementName": "ExampleStatement",
"Status": "PICKED",
"UpdatedAt": "2025-01-15T10:31:00.000Z"
}
]
}
}
Raw Request
Send raw HTTP request to Redshift Data API. | key: rawRequest
| Input | Notes | Example |
|---|---|---|
| Action | The Redshift Data API operation to invoke. Determines which API method is called with the provided body. | RedshiftData.ExecuteStatement |
| AWS Connection | Select the AWS connection to use for Redshift Data API access. | |
| AWS Region | AWS provides services in multiple regions, like us-west-2 or eu-west-1. | us-east-1 |
| Body | The JSON payload sent to the selected Redshift Data API operation. The required fields vary by action — refer to the AWS Redshift Data API documentation for the expected structure of each operation. |
Changelog
2026-03-20
Initial release of the Redshift component with comprehensive integration capabilities