Redshift Serverless Deployer
An AWS CloudOps agent skill that deploys Amazon Redshift Serverless
namespaces and workgroups with correct production defaults. Emits a
READY_TO_DEPLOY checklist verifying every configuration item.
Quick navigation
| Need |
Section |
| What MUST be in the response |
"STRICT output contract" |
| Why the namespace-before-workgroup order matters |
"Reasoning framework" |
| What to verify before deploying |
"Prerequisites" |
| The ordered deployment steps |
"Deployment procedure" |
| Common silent-failure pitfalls |
"NEVER" |
| Workload-type decision matrix |
"Workload matrix" |
| 2024-2026 feature changes |
"Recent AWS features" |
| Deep CLI sequences |
references/cli-commands-and-iac.md |
| Security, networking, cost controls, full NEVER |
references/configuration-and-cost-guide.md |
STRICT output contract
When this skill is invoked with a Redshift Serverless deployment
request, the agent MUST respond with the READY_TO_DEPLOY checklist
defined in "Output format" using the literal all-caps labels
WORKGROUP:, VERDICT:, CHECKLIST:, and VERIFICATION_COMMANDS:.
Do NOT preface the checklist with prose, headings, or disclaimers —
emit the block as the first lines.
Required output structure
WORKGROUP: <workgroup-name> — the Redshift Serverless workgroup
being deployed.
VERDICT: READY_TO_DEPLOY OR VERDICT: PREREQUISITES_MISSING.
CHECKLIST: followed by indented lines with status markers
([✓], [✗], [OPTIONAL], [INPUT NEEDED]).
VERIFICATION_COMMANDS: followed by indented
aws redshift-serverless ... commands.
FORBIDDEN output patterns
- No prose preamble before
WORKGROUP: — first non-empty line
MUST be WORKGROUP:.
- No markdown variants of labels — write
VERDICT:, not
**VERDICT:**, ### Verdict, or `VERDICT`.
- No swapping verdict tokens — exactly
READY_TO_DEPLOY or
PREREQUISITES_MISSING.
- No omitting
VERIFICATION_COMMANDS: — include even when
PREREQUISITES_MISSING.
- No extra sections after
VERIFICATION_COMMANDS: — the
checklist block is the entire response.
- No status marker drift — use only
[✓], [✗], [OPTIONAL],
[INPUT NEEDED].
Perfect example (copy the shape exactly)
WORKGROUP: analytics-wg-prod
VERDICT: READY_TO_DEPLOY
CHECKLIST:
[✓] Namespace — analytics-ns-prod, database dev, admin user admin
[✓] Admin credentials — stored in Secrets Manager secret arn:aws:secretsmanager:us-east-1:123456789012:secret:redshift/admin-XXX
[✓] KMS encryption — customer-managed key arn:aws:kms:us-east-1:123456789012:key/abc123 (encryption enabled)
[✓] IAM roles — sysid:aws-redshift arn:aws:iam::123456789012:role/RedshiftNSRole
[✓] VPC security groups — sg-redshift-prod (inbound 5439 from sg-analytics-app)
[✓] Workgroup — analytics-wg-prod, base capacity 128 RPU
[✓] Subnet group — redshift-subnet-group (3 subnets across us-east-1a/b/c)
[✓] Public access — disabled (private only)
[✓] Enhanced VPC routing — enabled (traffic stays in VPC)
[✓] Usage limits — daily 500 RPU-hours, monthly 12000 RPU-hour budget
[✓] Data API — enabled (query via execute-statement, no persistent connection)
[✓] Query editor v2 — associated (managed IAM policy)
[✓] Snapshots — automated every 8 hours, 7-day retention, cross-Region copy to us-west-2 with KMS key arn:aws:kms:us-west-2:123456789012:key/def456
[OPTIONAL] Concurrency scaling — enabled (auto-scaling beyond base RPU)
VERIFICATION_COMMANDS:
aws redshift-serverless describe-workgroup --workgroup-name analytics-wg-prod
aws redshift-serverless describe-namespace --namespace-name analytics-ns-prod
aws redshift-serverless list-usage-limits --usage-type serverless-compute
aws redshift-serverless describe-scheduled-actions
aws secretsmanager describe-secret --secret-id redshift/admin
aws kms describe-key --key-id alias/redshift-prod
Reasoning framework (why the deployment order matters)
- Namespace FIRST — a namespace is the database container. It
owns the database name, admin credentials, KMS key, IAM roles, VPC
security groups, and snapshot schedule. Without a namespace you
cannot create a workgroup. The create-namespace call is the only
place where admin credentials, KMS, and IAM roles are set.
- Admin credentials — choose between Secrets Manager-managed
(recommended) or manual admin password. Secrets Manager auto-rotates
and avoids hardcoding secrets. Manual passwords expire after a
configured period; rotation is YOUR responsibility.
- KMS encryption — Redshift Serverless uses an AWS-owned key by
default. For production, use a customer-managed key (CMK) so you
control rotation policy and cross-account access. The CMK must
exist BEFORE create-namespace.
- VPC security groups on the namespace — the namespace-level
security groups control which clients can reach the database on port
- A common mistake is to attach a security group with no inbound
rule, then wonder why the Data API times out.
- Workgroup SECOND — the workgroup attaches to a namespace and
defines the compute (base capacity RPU), subnet group, public access
toggle, and enhanced VPC routing. A workgroup without enhanced VPC
routing sends COPY/UNLOAD traffic over the public internet.
- Usage limits THIRD — Redshift Serverless bills by RPU-hour. A
runaway query can exhaust a budget in hours. Set daily and monthly
limits BEFORE the first workload runs.
- Snapshots LAST — configure scheduled snapshots and cross-Region
copy as the final step so the namespace has data to snapshot.
Prerequisites (verify before deployment)
| Prerequisite |
Why it matters |
How to verify |
| KMS key (if CMK encryption) |
CMK must exist and the caller needs kms:CreateGrant. NEVER create with AWS-owned and migrate later. |
aws kms describe-key --key-id <alias> |
| VPC subnets (3+ AZs) |
Redshift Serverless requires a subnet group spanning at least 3 AZs for HA. |
aws ec2 describe-subnets --subnet-ids <ids> |
| Security group(s) |
Inbound rule for port 5439 from the analytics application SG. NEVER 0.0.0.0/0. |
aws ec2 describe-security-groups --group-ids <sg-ids> |
| Subnet group |
Created from the subnets; attached to the workgroup. |
aws redshift-serverless describe-subnet-groups (errors if none) |
| IAM namespace role (optional) |
Trust redshift.amazonaws.com. Scoped for S3/Glue/KMS access during COPY/UNLOAD. |
aws iam get-role --role-name <role> |
| Secrets Manager secret (recommended) |
Stores admin password. Auto-rotation via Lambda. NEVER hardcode admin password in create-namespace. |
aws secretsmanager describe-secret --secret-id <id> |
| Service quota |
Default 30 RPU-hours per region per account. Request increase BEFORE production. |
aws service-quotas get-service-quota --service-code redshift-serverless --quota-code L-XXXXXXXX |
| Cross-Region KMS key (if cross-Region snapshots) |
Snapshot copy requires a separate CMK in the destination Region. NEVER reuse the source-Region key. |
aws kms describe-key --key-id <dest-alias> --region <dest-region> |
Deployment procedure (apply in order)
Step 1: KMS key (encryption)
For production, use a customer-managed key. The AWS-owned key cannot
be audited, rotated, or shared cross-account. Create the CMK BEFORE
the namespace.
Moved verbatim → references/cli-commands-and-iac.md § "Step 1 — KMS key creation".
Load when: creating the customer-managed KMS key and alias before create-namespace.
Rules:
- Key policy MUST allow
redshift-serverless.amazonaws.com to use
kms:CreateGrant and kms:GenerateDataKey*.
- NEVER use the same CMK across Regions — KMS keys are Region-scoped.
- Document the key ID — there is no way to recover the key ID from
a namespace after creation if the alias is deleted.
Step 2: Subnet group
aws redshift-serverless create-subnet-group \
--subnet-group-name redshift-subnet-group \
--subnet-ids subnet-aaa subnet-bbb subnet-ccc \
--security-group-ids sg-redshift-prod
Rules:
- At least 3 subnets across different AZs for high availability.
- Subnets MUST be in private IP ranges if you disable public access
(recommended for production).
- Security group inbound MUST allow port 5439 from the analytics
application SG. NEVER
0.0.0.0/0.
Step 3: IAM namespace role (for COPY/UNLOAD/S3/Glue)
The namespace IAM role is assumed by Redshift Serverless for
data-plane AWS API calls (COPY from S3, UNLOAD to S3, Glue catalog
integration). Without it, COPY from S3 fails with S3ServiceException.
Moved verbatim → references/cli-commands-and-iac.md § "Step 3 — IAM namespace role".
Load when: creating the namespace IAM role and its inline data-access policy.
Step 4: Secrets Manager admin credential (recommended)
aws secretsmanager create-secret \
--name redshift/admin \
--secret-string '{
"username": "admin",
"password": "<generate-32-char-strong-password>",
"engine": "redshift",
"host": "<filled-after-workgroup-creation>",
"port": 5439
}'
NEVER hardcode the admin password in the create-namespace CLI.
Secrets Manager manages rotation, auditing, and access scoping. If you
must use a manual admin password, set adminPassword in
create-namespace and rotate it within 90 days.
Step 5: Namespace
Moved verbatim → references/cli-commands-and-iac.md § "Step 5 — create-namespace".
Load when: running create-namespace with KMS, IAM roles, security groups, and log exports.
Rules:
- db-name MUST be lowercase, 1-64 alphanumeric/underscore. NOT a
reserved keyword. Default
dev.
- admin-user-password MUST be 8-64 chars with at least one
uppercase, lowercase, number, and special char.
- log-exports —
userlog, connectionlog, useractivitylog
stream to CloudWatch Logs. Set on namespace creation; not retroactive.
- security-group-ids — applied at the namespace level. The
security group inbound rule for port 5439 controls client access.
Step 6: Workgroup (compute)
aws redshift-serverless create-workgroup \
--workgroup-name analytics-wg-prod \
--namespace-name analytics-ns-prod \
--base-capacity 128 \
--subnet-group-name redshift-subnet-group \
--security-group-ids sg-redshift-prod \
--publicly-accessible false \
--config-parameters '[{"parameterKey":"enable_user_activity_logging","parameterValue":"true"},{"parameterKey":"enable_data_api","parameterValue":"true"},{"parameterKey":"enhanced_vpc_routing","parameterValue":"true"},{"parameterKey":"query_group","parameterValue":"analytics"}]' \
--tags Environment=production Application=analytics
Parameters:
- base-capacity — RPU (Redshift Processing Units). 8-512 RPU in
multiples of 8. 128 RPU is a common production starting point.
- publicly-accessible —
false for production. NEVER expose a
data warehouse to the public internet.
- enhanced_vpc_routing —
true forces COPY/UNLOAD traffic through
your VPC. Without it, traffic traverses the public internet via
Amazon S3 endpoints.
- enable_data_api —
true enables the Data API for query
execution without a persistent JDBC/ODBC connection.
Step 7: Usage limits (cost controls)
aws redshift-serverless put-usage-limit \
--usage-type serverless-compute \
--amount 500 \
--period daily \
--breach-action log
aws redshift-serverless put-usage-limit \
--usage-type serverless-compute \
--amount 12000 \
--period monthly \
--breach-action emit-metric
breach-action |
Behavior |
log |
Log a CloudWatch event when the limit is exceeded. Queries continue. |
emit-metric |
Emit a CloudWatch metric and log. Queries continue. |
disable |
Disable the workgroup. ALL queries fail until the limit is reset. |
- NEVER use
disable on a production workgroup without a runbook.
A threshold breach silently turns off analytics. Use log or
emit-metric with a CloudWatch alarm.
- Daily 500 RPU-hours is a starting budget for a moderate analytics
workload. 1 RPU-hour = 1 RPU running for 1 hour.
- Monitor with CloudWatch: metric
ServerlessComputeCapacity,
dimension Workgroup.
Step 8: Data API
The Data API (enabled via enable_data_api=true in the workgroup
config-parameters) lets you execute queries via the
redshift-data:ExecuteStatement API. No JDBC/ODBC connection needed.
aws redshift-data execute-statement \
--workgroup-name analytics-wg-prod \
--database dev \
--sql "SELECT COUNT(*) FROM sales"
Rules:
- The caller needs
redshift-data:ExecuteStatement plus the
Secrets Manager secret permission if using Secrets Manager auth.
describe-statement and get-statement-result for async result
retrieval. Long-running queries return immediately with a statement ID.
- NEVER use the Data API for high-frequency OLTP queries — it is
optimized for batch analytics, not microsecond latency.
Step 9: Query editor v2 association
Query editor v2 is a managed web UI. It requires an IAM policy allowing
redshift-serverless:* and redshift-data:* for the IAM principal
running it.
Moved verbatim → references/cli-commands-and-iac.md § "Step 9 — query editor v2 policy".
Load when: creating the query editor v2 IAM policy.
Attach the policy to the IAM user/role that runs the query editor v2.
The query editor auto-discovers workgroups and namespaces.
Step 10: Snapshots and cross-Region copy
Moved verbatim → references/cli-commands-and-iac.md § "Step 10 — snapshots and cross-Region copy".
Load when: creating the scheduled action and cross-Region snapshot copy grant.
Rules:
- Cross-Region copy requires a SEPARATE CMK in the destination
Region. NEVER reuse the source-Region key — KMS keys are Region-scoped.
- Snapshot retention is configurable via the
--snapshot-retention-period on the scheduled action.
- NEVER delete the cross-Region snapshot CMK while a snapshot copy
grant references it — the next scheduled copy will fail silently.
Step 11: Verification
Moved verbatim → references/diagnostic-commands.md § "Step 11 — verification commands".
Load when: verifying the deployment after apply — workgroup, namespace, usage limits, snapshots, secret, KMS, log groups.
Latest Redshift Serverless features (2024-2026)
Moved verbatim → references/advanced-patterns.md § "Latest features (2024-2026)".
Load when: deciding cross-Region copy, usage-limit cost controls, Secrets Manager rotation, zero-ETL, concurrent scaling, ML-driven WLM, or row-level security.
Workload matrix
| Workload |
Base RPU |
Public access |
Enhanced VPC |
Usage limit |
Cross-Region snapshots |
| BI dashboard |
32-64 |
Disabled |
Enabled |
Daily 200 RPU-hr |
Optional |
| Ad-hoc analytics |
128 |
Disabled |
Enabled |
Daily 500 RPU-hr |
Yes |
| Heavy ETL (nightly) |
256 |
Disabled |
Enabled |
Daily 1000 RPU-hr (peak at night) |
Yes |
| Multi-tenant SaaS |
128-256 |
Disabled |
Enabled |
Monthly 12000 RPU-hr |
Yes |
| Dev/test |
8-32 |
Disabled |
Disabled |
Monthly 500 RPU-hr |
No |
| Real-time (zero-ETL) |
128 |
Disabled |
Enabled |
Monthly 15000 RPU-hr |
Yes |
NEVER (top 5 — full list of 12 in references)
- NEVER create a namespace with the AWS-owned KMS key for production.
The AWS-owned key cannot be audited, rotated, shared cross-account,
or used for cross-Region snapshot copy. Migrating encryption keys
after creation requires a full UNLOAD/LOAD cycle. #1 rollback-breaker.
- NEVER enable
publicly-accessible=true on a production workgroup.
A data warehouse should never be reachable from the public internet.
Use a bastion, VPN, or Direct Connect for admin access.
- NEVER deploy a workgroup without
enhanced_vpc_routing=true if you
COPY/UNLOAD from/to S3. Without it, COPY/UNLOAD traffic traverses
the public internet via Amazon S3 endpoints, which violates most
compliance regimes (HIPAA, PCI, SOC2).
- NEVER set
breach-action=disable on a production usage limit without
a runbook. A threshold breach silently turns off ALL queries. Use
log or emit-metric with a CloudWatch alarm for production.
- NEVER delete the cross-Region snapshot CMK while a snapshot copy
grant references it. The next scheduled cross-Region copy will fail
silently, and you will not know until a DR failover is attempted.
Expert heuristic — sizing, cost controls, and snapshot strategy
- RPU sizing: start at 128 RPU for a moderate analytics workload
(10-50 concurrent queries, 1-5 TB). For heavy ETL with nightly
windowed loads, scale to 256+ RPU during the window and rely on
concurrent scaling for daytime BI.
- The 80/20 budget rule: set the daily usage limit at 80% of your
daily budget and the monthly limit at 120%. The daily limit catches
runaway queries early; the monthly limit is the hard ceiling.
- Snapshot interval vs cost: every snapshot consumes storage at
the source Region AND the destination Region. An 8-hour interval is
a good default; a 1-hour interval doubles snapshot storage cost.
- Data API vs JDBC: use the Data API for Lambda, Step Functions,
and EventBridge integrations (no connection pool needed). Use JDBC
for BI tools that require persistent connections (Tableau, Looker).
- CMK rotation: enable annual KMS key rotation. Redshift Serverless
handles re-encryption transparently.
- Log exports: set
userlog, connectionlog, useractivitylog
at namespace creation. CloudWatch log group is /aws/redshift/<namespace>.
Retention defaults to Never Expire — set a retention policy.
Pre-flight safety checks (run before any deployment CLI)
- Confirm CMK exists and key policy allows
redshift-serverless.
- Confirm subnet group spans 3+ AZs.
- Confirm security group inbound rule for port 5439 from analytics
app SG. NEVER
0.0.0.0/0.
- Confirm namespace IAM role trusts
redshift.amazonaws.com.
- Confirm Secrets Manager secret exists (if used for admin password).
- Confirm service quota for RPU-hours is sufficient.
- For cross-Region snapshots, confirm destination-Region CMK exists.
- For existing namespaces, capture current config for rollback.
Full CLI sequences for all checks in references/configuration-and-cost-guide.md.
Output format — MANDATORY literal labels
When invoked with a Redshift Serverless deployment request, your
ENTIRE response MUST be the checklist block below. The labels are
case-sensitive all-caps keywords. Do NOT write a preamble. Start
with WORKGROUP: and stop after the VERIFICATION_COMMANDS: block.
WORKGROUP: <name>
VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING
CHECKLIST:
[✓] Namespace — <namespace-name>, database <db-name>, admin user <admin>
[✓] Admin credentials — Secrets Manager secret <secret-arn> | manual password (rotate <days>)
[✓] KMS encryption — customer-managed key <key-arn> (encryption enabled) | AWS-owned (NOT recommended)
[✓] IAM roles — <namespace-role> (<data-plane-permissions>)
[✓] VPC security groups — <sg-ids> (inbound 5439 from <source-sg>)
[✓] Workgroup — <workgroup-name>, base capacity <rpu> RPU
[✓] Subnet group — <subnet-group> (<subnet-count> subnets across <az-count> AZs)
[✓] Public access — enabled | disabled
[✓] Enhanced VPC routing — enabled | disabled
[✓] Usage limits — daily <daily> RPU-hours, monthly <monthly> RPU-hour budget (<breach-action>)
[✓] Data API — enabled | disabled
[✓] Query editor v2 — associated (<iam-policy>)
[✓] Snapshots — automated every <interval>, <retention>-day retention, cross-Region copy to <dest-region> with KMS <dest-key-arn>
[OPTIONAL] Concurrency scaling — enabled (auto-scaling beyond base RPU)
VERIFICATION_COMMANDS:
aws redshift-serverless describe-workgroup --workgroup-name <wg>
aws redshift-serverless describe-namespace --namespace-name <ns>
aws redshift-serverless list-usage-limits
aws secretsmanager describe-secret --secret-id <secret-id>
aws kms describe-key --key-id <key-alias>
Status marker semantics:
[✓] — applied and verified.
[✗] — NOT applied or misconfigured. Cite the gap.
[OPTIONAL] — recommended but not required.
[INPUT NEEDED] — prerequisite value missing; operator must provide.
PREREQUISITES_MISSING verdict: if any REQUIRED prerequisite is
missing (CMK for production, subnet group with 3+ AZs, security group
with port 5439 inbound, namespace IAM role for COPY/UNLOAD, Secrets
Manager secret for admin password), the verdict is
PREREQUISITES_MISSING.
References (load on demand)
- references/cli-commands-and-iac.md — full CLI sequences and Terraform/CloudFormation equivalents; now also holds the KMS, IAM role, namespace, query-editor policy, and snapshot CLI moved from SKILL.md
- references/configuration-and-cost-guide.md — encryption, networking, usage limits, DR strategy, full NEVER list; now also holds the SKILL.md edge-case catalog
- references/diagnostic-commands.md — Step 11 post-deployment verification commands
- references/advanced-patterns.md — 2024-2026 feature changes (cross-Region copy, cost controls, Secrets Manager rotation, zero-ETL, concurrent scaling, ML-driven WLM, RLS)
Domain
AWS CloudOps / Redshift Serverless Analytics Data Warehouse
Provisioning.
Edge-case handling
Moved verbatim → references/configuration-and-cost-guide.md § "Edge-case handling".
Load when: migrating from provisioned, cross-account datashares, multi-AZ, zero-ETL from Aurora, rotation, usage-limit reset, or CMK deletion edge cases.
AWS documentation
References
references/cli-commands-and-iac.md — full copy-pasteable CLI command
sequence for all 11 deployment steps, including KMS key creation,
subnet group creation, namespace IAM role, Secrets Manager secret,
namespace creation, workgroup creation, usage limits, scheduled
snapshots, cross-Region snapshot copy, and Terraform /
CloudFormation equivalents.
references/configuration-and-cost-guide.md — deep reference on
encryption strategy, VPC networking, usage-limit tuning, snapshot
and cross-Region DR strategy, Data API patterns, query editor v2
setup, full NEVER list, edge-case handling, and pre-flight safety
CLI.
1---2name: redshift-serverless-deployer3description: 'Deploys Amazon Redshift Serverless with production-grade configuration: namespace creation (DB name, admin credentials, KMS encryption, IAM roles, VPC security groups), workgroup creation (base capacity RPU, subnet group, public access, enhanced VPC routing), usage limits (daily/monthly RPU caps, cost controls), Data API for query execution without persistent connections, query editor v2, scheduled and cross-Region snapshots for DR, and latest features (cross-Region snapshot copy, cost controls with usage thresholds, Secrets Manager integration, zero-ETL). Emits a READY_TO_DEPLOY checklist with every configuration item verified. Use when creating a Redshift Serverless namespace or workgroup, validating a configuration, or generating deployment CLI and IaC templates. Triggers: Redshift Serverless, serverless data warehouse, RPU capacity, namespace, workgroup, Data API, cross-Region snapshots, usage limits, cost controls, query editor v2.'4license: Apache-2.05compatibility: 'Requires an LLM agent runtime (Claude Code, Cursor, Windsurf, Codex, Gemini). For live deployment: AWS CLI v2 with redshift-serverless, ec2, kms, iam, secretsmanager, and logs access. Works with Terraform aws_redshiftserverless_* resources, CloudFormation AWS::RedshiftServerless::* resources, and the AWS Console Redshift Serverless wizard.'6metadata:7 source: https://skillmd.com/skills/jhkchan/redshift-serverless-deployer8 domain: aws-cloudops9 complexity: high10 requires_llm: 'true'11 phase: '1'12 supports_pipeline: 'true'13 entry_point: 'false'14 family: Analytics15 task_type: deploy16 skill_class: capability17 lifecycle_status: active18 verdict_shape: READY_TO_DEPLOY | PREREQUISITES_MISSING19 version: 0.1.020 author: Jacky Chan — AWS Community Builder21 tags: aws, redshift, redshift-serverless, cloudops, deploy, analytics, namespace, workgroup22 dependencies: aws-orchestrator23 keywords: aws, redshift, redshift-serverless, cloudops, deploy, provisioning, analytics, data-warehouse, namespace, workgroup, rpu, data-api, cross-region-snapshots, usage-limits, cost-controls, kms-encryption24 when_to_use: Invoke when the user wants to create a new Redshift Serverless namespace or workgroup, deploy a serverless data warehouse, validate an existing Redshift Serverless configuration against best practices, generate deployment CLI commands or IaC templates, or troubleshoot a Redshift Serverless deployment failure caused by missing prerequisites (KMS key, security groups, subnet group, IAM roles). Do NOT invoke for provisioned Redshift clusters (use redshift-cluster-deployer), Athena (use athena-query-optimizer), or Aurora (use rds-instance-deployer).25---2627# Redshift Serverless Deployer2829An AWS CloudOps agent skill that deploys Amazon Redshift Serverless30namespaces and workgroups with correct production defaults. Emits a31READY_TO_DEPLOY checklist verifying every configuration item.3233## Quick navigation3435| Need | Section |36|---|---|37| What MUST be in the response | "STRICT output contract" |38| Why the namespace-before-workgroup order matters | "Reasoning framework" |39| What to verify before deploying | "Prerequisites" |40| The ordered deployment steps | "Deployment procedure" |41| Common silent-failure pitfalls | "NEVER" |42| Workload-type decision matrix | "Workload matrix" |43| 2024-2026 feature changes | "Recent AWS features" |44| Deep CLI sequences | `references/cli-commands-and-iac.md` |45| Security, networking, cost controls, full NEVER | `references/configuration-and-cost-guide.md` |4647## STRICT output contract4849When this skill is invoked with a Redshift Serverless deployment50request, the agent MUST respond with the READY_TO_DEPLOY checklist51defined in "Output format" using the literal all-caps labels52`WORKGROUP:`, `VERDICT:`, `CHECKLIST:`, and `VERIFICATION_COMMANDS:`.53Do NOT preface the checklist with prose, headings, or disclaimers —54emit the block as the first lines.5556### Required output structure57581. `WORKGROUP: <workgroup-name>` — the Redshift Serverless workgroup59 being deployed.602. `VERDICT: READY_TO_DEPLOY` OR `VERDICT: PREREQUISITES_MISSING`.613. `CHECKLIST:` followed by indented lines with status markers62 (`[✓]`, `[✗]`, `[OPTIONAL]`, `[INPUT NEEDED]`).634. `VERIFICATION_COMMANDS:` followed by indented64 `aws redshift-serverless ...` commands.6566### FORBIDDEN output patterns6768- **No prose preamble before `WORKGROUP:`** — first non-empty line69 MUST be `WORKGROUP:`.70- **No markdown variants of labels** — write `VERDICT:`, not71 `**VERDICT:**`, `### Verdict`, or `` `VERDICT` ``.72- **No swapping verdict tokens** — exactly `READY_TO_DEPLOY` or73 `PREREQUISITES_MISSING`.74- **No omitting `VERIFICATION_COMMANDS:`** — include even when75 PREREQUISITES_MISSING.76- **No extra sections after `VERIFICATION_COMMANDS:`** — the77 checklist block is the entire response.78- **No status marker drift** — use only `[✓]`, `[✗]`, `[OPTIONAL]`,79 `[INPUT NEEDED]`.8081### Perfect example (copy the shape exactly)8283```text84WORKGROUP: analytics-wg-prod85VERDICT: READY_TO_DEPLOY86CHECKLIST:87 [✓] Namespace — analytics-ns-prod, database dev, admin user admin88 [✓] Admin credentials — stored in Secrets Manager secret arn:aws:secretsmanager:us-east-1:123456789012:secret:redshift/admin-XXX89 [✓] KMS encryption — customer-managed key arn:aws:kms:us-east-1:123456789012:key/abc123 (encryption enabled)90 [✓] IAM roles — sysid:aws-redshift arn:aws:iam::123456789012:role/RedshiftNSRole91 [✓] VPC security groups — sg-redshift-prod (inbound 5439 from sg-analytics-app)92 [✓] Workgroup — analytics-wg-prod, base capacity 128 RPU93 [✓] Subnet group — redshift-subnet-group (3 subnets across us-east-1a/b/c)94 [✓] Public access — disabled (private only)95 [✓] Enhanced VPC routing — enabled (traffic stays in VPC)96 [✓] Usage limits — daily 500 RPU-hours, monthly 12000 RPU-hour budget97 [✓] Data API — enabled (query via execute-statement, no persistent connection)98 [✓] Query editor v2 — associated (managed IAM policy)99 [✓] Snapshots — automated every 8 hours, 7-day retention, cross-Region copy to us-west-2 with KMS key arn:aws:kms:us-west-2:123456789012:key/def456100 [OPTIONAL] Concurrency scaling — enabled (auto-scaling beyond base RPU)101VERIFICATION_COMMANDS:102 aws redshift-serverless describe-workgroup --workgroup-name analytics-wg-prod103 aws redshift-serverless describe-namespace --namespace-name analytics-ns-prod104 aws redshift-serverless list-usage-limits --usage-type serverless-compute105 aws redshift-serverless describe-scheduled-actions106 aws secretsmanager describe-secret --secret-id redshift/admin107 aws kms describe-key --key-id alias/redshift-prod108```109110## Reasoning framework (why the deployment order matters)1111121. **Namespace FIRST** — a namespace is the database container. It113 owns the database name, admin credentials, KMS key, IAM roles, VPC114 security groups, and snapshot schedule. Without a namespace you115 cannot create a workgroup. The create-namespace call is the only116 place where admin credentials, KMS, and IAM roles are set.1172. **Admin credentials** — choose between Secrets Manager-managed118 (recommended) or manual admin password. Secrets Manager auto-rotates119 and avoids hardcoding secrets. Manual passwords expire after a120 configured period; rotation is YOUR responsibility.1213. **KMS encryption** — Redshift Serverless uses an AWS-owned key by122 default. For production, use a customer-managed key (CMK) so you123 control rotation policy and cross-account access. The CMK must124 exist BEFORE create-namespace.1254. **VPC security groups on the namespace** — the namespace-level126 security groups control which clients can reach the database on port127 5439. A common mistake is to attach a security group with no inbound128 rule, then wonder why the Data API times out.1295. **Workgroup SECOND** — the workgroup attaches to a namespace and130 defines the compute (base capacity RPU), subnet group, public access131 toggle, and enhanced VPC routing. A workgroup without enhanced VPC132 routing sends COPY/UNLOAD traffic over the public internet.1336. **Usage limits THIRD** — Redshift Serverless bills by RPU-hour. A134 runaway query can exhaust a budget in hours. Set daily and monthly135 limits BEFORE the first workload runs.1367. **Snapshots LAST** — configure scheduled snapshots and cross-Region137 copy as the final step so the namespace has data to snapshot.138139## Prerequisites (verify before deployment)140141| Prerequisite | Why it matters | How to verify |142|---|---|---|143| **KMS key (if CMK encryption)** | CMK must exist and the caller needs `kms:CreateGrant`. NEVER create with AWS-owned and migrate later. | `aws kms describe-key --key-id <alias>` |144| **VPC subnets (3+ AZs)** | Redshift Serverless requires a subnet group spanning at least 3 AZs for HA. | `aws ec2 describe-subnets --subnet-ids <ids>` |145| **Security group(s)** | Inbound rule for port 5439 from the analytics application SG. NEVER `0.0.0.0/0`. | `aws ec2 describe-security-groups --group-ids <sg-ids>` |146| **Subnet group** | Created from the subnets; attached to the workgroup. | `aws redshift-serverless describe-subnet-groups` (errors if none) |147| **IAM namespace role (optional)** | Trust `redshift.amazonaws.com`. Scoped for S3/Glue/KMS access during COPY/UNLOAD. | `aws iam get-role --role-name <role>` |148| **Secrets Manager secret (recommended)** | Stores admin password. Auto-rotation via Lambda. NEVER hardcode admin password in create-namespace. | `aws secretsmanager describe-secret --secret-id <id>` |149| **Service quota** | Default 30 RPU-hours per region per account. Request increase BEFORE production. | `aws service-quotas get-service-quota --service-code redshift-serverless --quota-code L-XXXXXXXX` |150| **Cross-Region KMS key (if cross-Region snapshots)** | Snapshot copy requires a separate CMK in the destination Region. NEVER reuse the source-Region key. | `aws kms describe-key --key-id <dest-alias> --region <dest-region>` |151152## Deployment procedure (apply in order)153154### Step 1: KMS key (encryption)155156For production, use a customer-managed key. The AWS-owned key cannot157be audited, rotated, or shared cross-account. Create the CMK BEFORE158the namespace.159160> **Moved verbatim** → [references/cli-commands-and-iac.md](references/cli-commands-and-iac.md) § "Step 1 — KMS key creation".161> Load when: creating the customer-managed KMS key and alias before create-namespace.162163Rules:164- **Key policy MUST allow `redshift-serverless.amazonaws.com`** to use165 `kms:CreateGrant` and `kms:GenerateDataKey*`.166- **NEVER use the same CMK across Regions** — KMS keys are Region-scoped.167- **Document the key ID** — there is no way to recover the key ID from168 a namespace after creation if the alias is deleted.169170### Step 2: Subnet group171172```bash173aws redshift-serverless create-subnet-group \174 --subnet-group-name redshift-subnet-group \175 --subnet-ids subnet-aaa subnet-bbb subnet-ccc \176 --security-group-ids sg-redshift-prod177```178179Rules:180- **At least 3 subnets** across different AZs for high availability.181- **Subnets MUST be in private IP ranges** if you disable public access182 (recommended for production).183- **Security group inbound** MUST allow port 5439 from the analytics184 application SG. NEVER `0.0.0.0/0`.185186### Step 3: IAM namespace role (for COPY/UNLOAD/S3/Glue)187188The namespace IAM role is assumed by Redshift Serverless for189data-plane AWS API calls (COPY from S3, UNLOAD to S3, Glue catalog190integration). Without it, COPY from S3 fails with `S3ServiceException`.191192> **Moved verbatim** → [references/cli-commands-and-iac.md](references/cli-commands-and-iac.md) § "Step 3 — IAM namespace role".193> Load when: creating the namespace IAM role and its inline data-access policy.194195### Step 4: Secrets Manager admin credential (recommended)196197```bash198aws secretsmanager create-secret \199 --name redshift/admin \200 --secret-string '{201 "username": "admin",202 "password": "<generate-32-char-strong-password>",203 "engine": "redshift",204 "host": "<filled-after-workgroup-creation>",205 "port": 5439206 }'207```208209**NEVER hardcode the admin password in the create-namespace CLI.**210Secrets Manager manages rotation, auditing, and access scoping. If you211must use a manual admin password, set `adminPassword` in212create-namespace and rotate it within 90 days.213214### Step 5: Namespace215216> **Moved verbatim** → [references/cli-commands-and-iac.md](references/cli-commands-and-iac.md) § "Step 5 — create-namespace".217> Load when: running create-namespace with KMS, IAM roles, security groups, and log exports.218219Rules:220- **db-name MUST be lowercase**, 1-64 alphanumeric/underscore. NOT a221 reserved keyword. Default `dev`.222- **admin-user-password MUST be 8-64 chars** with at least one223 uppercase, lowercase, number, and special char.224- **log-exports** — `userlog`, `connectionlog`, `useractivitylog`225 stream to CloudWatch Logs. Set on namespace creation; not retroactive.226- **security-group-ids** — applied at the namespace level. The227 security group inbound rule for port 5439 controls client access.228229### Step 6: Workgroup (compute)230231```bash232aws redshift-serverless create-workgroup \233 --workgroup-name analytics-wg-prod \234 --namespace-name analytics-ns-prod \235 --base-capacity 128 \236 --subnet-group-name redshift-subnet-group \237 --security-group-ids sg-redshift-prod \238 --publicly-accessible false \239 --config-parameters '[{"parameterKey":"enable_user_activity_logging","parameterValue":"true"},{"parameterKey":"enable_data_api","parameterValue":"true"},{"parameterKey":"enhanced_vpc_routing","parameterValue":"true"},{"parameterKey":"query_group","parameterValue":"analytics"}]' \240 --tags Environment=production Application=analytics241```242243Parameters:244- **base-capacity** — RPU (Redshift Processing Units). 8-512 RPU in245 multiples of 8. 128 RPU is a common production starting point.246- **publicly-accessible** — `false` for production. NEVER expose a247 data warehouse to the public internet.248- **enhanced_vpc_routing** — `true` forces COPY/UNLOAD traffic through249 your VPC. Without it, traffic traverses the public internet via250 Amazon S3 endpoints.251- **enable_data_api** — `true` enables the Data API for query252 execution without a persistent JDBC/ODBC connection.253254### Step 7: Usage limits (cost controls)255256```bash257aws redshift-serverless put-usage-limit \258 --usage-type serverless-compute \259 --amount 500 \260 --period daily \261 --breach-action log262263aws redshift-serverless put-usage-limit \264 --usage-type serverless-compute \265 --amount 12000 \266 --period monthly \267 --breach-action emit-metric268```269270| `breach-action` | Behavior |271|---|---|272| `log` | Log a CloudWatch event when the limit is exceeded. Queries continue. |273| `emit-metric` | Emit a CloudWatch metric and log. Queries continue. |274| `disable` | Disable the workgroup. ALL queries fail until the limit is reset. |275276- **NEVER use `disable` on a production workgroup** without a runbook.277 A threshold breach silently turns off analytics. Use `log` or278 `emit-metric` with a CloudWatch alarm.279- **Daily 500 RPU-hours** is a starting budget for a moderate analytics280 workload. 1 RPU-hour = 1 RPU running for 1 hour.281- **Monitor with CloudWatch:** metric `ServerlessComputeCapacity`,282 dimension `Workgroup`.283284### Step 8: Data API285286The Data API (enabled via `enable_data_api=true` in the workgroup287config-parameters) lets you execute queries via the288`redshift-data:ExecuteStatement` API. No JDBC/ODBC connection needed.289290```bash291aws redshift-data execute-statement \292 --workgroup-name analytics-wg-prod \293 --database dev \294 --sql "SELECT COUNT(*) FROM sales"295```296297Rules:298- **The caller needs `redshift-data:ExecuteStatement`** plus the299 Secrets Manager secret permission if using Secrets Manager auth.300- **`describe-statement` and `get-statement-result`** for async result301 retrieval. Long-running queries return immediately with a statement ID.302- **NEVER use the Data API for high-frequency OLTP queries** — it is303 optimized for batch analytics, not microsecond latency.304305### Step 9: Query editor v2 association306307Query editor v2 is a managed web UI. It requires an IAM policy allowing308`redshift-serverless:*` and `redshift-data:*` for the IAM principal309running it.310311> **Moved verbatim** → [references/cli-commands-and-iac.md](references/cli-commands-and-iac.md) § "Step 9 — query editor v2 policy".312> Load when: creating the query editor v2 IAM policy.313314Attach the policy to the IAM user/role that runs the query editor v2.315The query editor auto-discovers workgroups and namespaces.316317### Step 10: Snapshots and cross-Region copy318319> **Moved verbatim** → [references/cli-commands-and-iac.md](references/cli-commands-and-iac.md) § "Step 10 — snapshots and cross-Region copy".320> Load when: creating the scheduled action and cross-Region snapshot copy grant.321322Rules:323- **Cross-Region copy requires a SEPARATE CMK** in the destination324 Region. NEVER reuse the source-Region key — KMS keys are Region-scoped.325- **Snapshot retention** is configurable via the326 `--snapshot-retention-period` on the scheduled action.327- **NEVER delete the cross-Region snapshot CMK** while a snapshot copy328 grant references it — the next scheduled copy will fail silently.329330### Step 11: Verification331332> **Moved verbatim** → [references/diagnostic-commands.md](references/diagnostic-commands.md) § "Step 11 — verification commands".333> Load when: verifying the deployment after apply — workgroup, namespace, usage limits, snapshots, secret, KMS, log groups.334335## Latest Redshift Serverless features (2024-2026)336337> **Moved verbatim** → [references/advanced-patterns.md](references/advanced-patterns.md) § "Latest features (2024-2026)".338> Load when: deciding cross-Region copy, usage-limit cost controls, Secrets Manager rotation, zero-ETL, concurrent scaling, ML-driven WLM, or row-level security.339340## Workload matrix341342| Workload | Base RPU | Public access | Enhanced VPC | Usage limit | Cross-Region snapshots |343|---|---|---|---|---|---|344| **BI dashboard** | 32-64 | Disabled | Enabled | Daily 200 RPU-hr | Optional |345| **Ad-hoc analytics** | 128 | Disabled | Enabled | Daily 500 RPU-hr | Yes |346| **Heavy ETL (nightly)** | 256 | Disabled | Enabled | Daily 1000 RPU-hr (peak at night) | Yes |347| **Multi-tenant SaaS** | 128-256 | Disabled | Enabled | Monthly 12000 RPU-hr | Yes |348| **Dev/test** | 8-32 | Disabled | Disabled | Monthly 500 RPU-hr | No |349| **Real-time (zero-ETL)** | 128 | Disabled | Enabled | Monthly 15000 RPU-hr | Yes |350351## NEVER (top 5 — full list of 12 in references)352353- NEVER create a namespace with the AWS-owned KMS key for production.354 The AWS-owned key cannot be audited, rotated, shared cross-account,355 or used for cross-Region snapshot copy. Migrating encryption keys356 after creation requires a full UNLOAD/LOAD cycle. #1 rollback-breaker.357- NEVER enable `publicly-accessible=true` on a production workgroup.358 A data warehouse should never be reachable from the public internet.359 Use a bastion, VPN, or Direct Connect for admin access.360- NEVER deploy a workgroup without `enhanced_vpc_routing=true` if you361 COPY/UNLOAD from/to S3. Without it, COPY/UNLOAD traffic traverses362 the public internet via Amazon S3 endpoints, which violates most363 compliance regimes (HIPAA, PCI, SOC2).364- NEVER set `breach-action=disable` on a production usage limit without365 a runbook. A threshold breach silently turns off ALL queries. Use366 `log` or `emit-metric` with a CloudWatch alarm for production.367- NEVER delete the cross-Region snapshot CMK while a snapshot copy368 grant references it. The next scheduled cross-Region copy will fail369 silently, and you will not know until a DR failover is attempted.370371## Expert heuristic — sizing, cost controls, and snapshot strategy372373- **RPU sizing:** start at 128 RPU for a moderate analytics workload374 (10-50 concurrent queries, 1-5 TB). For heavy ETL with nightly375 windowed loads, scale to 256+ RPU during the window and rely on376 concurrent scaling for daytime BI.377- **The 80/20 budget rule:** set the daily usage limit at 80% of your378 daily budget and the monthly limit at 120%. The daily limit catches379 runaway queries early; the monthly limit is the hard ceiling.380- **Snapshot interval vs cost:** every snapshot consumes storage at381 the source Region AND the destination Region. An 8-hour interval is382 a good default; a 1-hour interval doubles snapshot storage cost.383- **Data API vs JDBC:** use the Data API for Lambda, Step Functions,384 and EventBridge integrations (no connection pool needed). Use JDBC385 for BI tools that require persistent connections (Tableau, Looker).386- **CMK rotation:** enable annual KMS key rotation. Redshift Serverless387 handles re-encryption transparently.388- **Log exports:** set `userlog`, `connectionlog`, `useractivitylog`389 at namespace creation. CloudWatch log group is `/aws/redshift/<namespace>`.390 Retention defaults to Never Expire — set a retention policy.391392## Pre-flight safety checks (run before any deployment CLI)393394- **Confirm CMK exists and key policy allows `redshift-serverless`.**395- **Confirm subnet group spans 3+ AZs.**396- **Confirm security group inbound rule for port 5439 from analytics397 app SG.** NEVER `0.0.0.0/0`.398- **Confirm namespace IAM role trusts `redshift.amazonaws.com`.**399- **Confirm Secrets Manager secret exists (if used for admin password).**400- **Confirm service quota for RPU-hours is sufficient.**401- **For cross-Region snapshots, confirm destination-Region CMK exists.**402- **For existing namespaces, capture current config for rollback.**403404Full CLI sequences for all checks in `references/configuration-and-cost-guide.md`.405406## Output format — MANDATORY literal labels407408When invoked with a Redshift Serverless deployment request, your409ENTIRE response MUST be the checklist block below. The labels are410**case-sensitive all-caps keywords**. Do NOT write a preamble. Start411with `WORKGROUP:` and stop after the `VERIFICATION_COMMANDS:` block.412413```text414WORKGROUP: <name>415VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING416CHECKLIST:417 [✓] Namespace — <namespace-name>, database <db-name>, admin user <admin>418 [✓] Admin credentials — Secrets Manager secret <secret-arn> | manual password (rotate <days>)419 [✓] KMS encryption — customer-managed key <key-arn> (encryption enabled) | AWS-owned (NOT recommended)420 [✓] IAM roles — <namespace-role> (<data-plane-permissions>)421 [✓] VPC security groups — <sg-ids> (inbound 5439 from <source-sg>)422 [✓] Workgroup — <workgroup-name>, base capacity <rpu> RPU423 [✓] Subnet group — <subnet-group> (<subnet-count> subnets across <az-count> AZs)424 [✓] Public access — enabled | disabled425 [✓] Enhanced VPC routing — enabled | disabled426 [✓] Usage limits — daily <daily> RPU-hours, monthly <monthly> RPU-hour budget (<breach-action>)427 [✓] Data API — enabled | disabled428 [✓] Query editor v2 — associated (<iam-policy>)429 [✓] Snapshots — automated every <interval>, <retention>-day retention, cross-Region copy to <dest-region> with KMS <dest-key-arn>430 [OPTIONAL] Concurrency scaling — enabled (auto-scaling beyond base RPU)431VERIFICATION_COMMANDS:432 aws redshift-serverless describe-workgroup --workgroup-name <wg>433 aws redshift-serverless describe-namespace --namespace-name <ns>434 aws redshift-serverless list-usage-limits435 aws secretsmanager describe-secret --secret-id <secret-id>436 aws kms describe-key --key-id <key-alias>437```438439**Status marker semantics:**440- `[✓]` — applied and verified.441- `[✗]` — NOT applied or misconfigured. Cite the gap.442- `[OPTIONAL]` — recommended but not required.443- `[INPUT NEEDED]` — prerequisite value missing; operator must provide.444445**PREREQUISITES_MISSING verdict:** if any REQUIRED prerequisite is446missing (CMK for production, subnet group with 3+ AZs, security group447with port 5439 inbound, namespace IAM role for COPY/UNLOAD, Secrets448Manager secret for admin password), the verdict is449`PREREQUISITES_MISSING`.450451## References (load on demand)452453- [references/cli-commands-and-iac.md](references/cli-commands-and-iac.md) — full CLI sequences and Terraform/CloudFormation equivalents; now also holds the KMS, IAM role, namespace, query-editor policy, and snapshot CLI moved from SKILL.md454- [references/configuration-and-cost-guide.md](references/configuration-and-cost-guide.md) — encryption, networking, usage limits, DR strategy, full NEVER list; now also holds the SKILL.md edge-case catalog455- [references/diagnostic-commands.md](references/diagnostic-commands.md) — Step 11 post-deployment verification commands456- [references/advanced-patterns.md](references/advanced-patterns.md) — 2024-2026 feature changes (cross-Region copy, cost controls, Secrets Manager rotation, zero-ETL, concurrent scaling, ML-driven WLM, RLS)457458## Domain459460AWS CloudOps / Redshift Serverless Analytics Data Warehouse461Provisioning.462463## Edge-case handling464465> **Moved verbatim** → [references/configuration-and-cost-guide.md](references/configuration-and-cost-guide.md) § "Edge-case handling".466> Load when: migrating from provisioned, cross-account datashares, multi-AZ, zero-ETL from Aurora, rotation, usage-limit reset, or CMK deletion edge cases.467468## AWS documentation469470- **Redshift Serverless Developer Guide** — https://docs.aws.amazon.com/redshift/latest/dg/serverless-whatis.html471- **CreateNamespace API** — https://docs.aws.amazon.com/redshift-serverless/latest/APIReference/API_CreateNamespace.html472- **CreateWorkgroup API** — https://docs.aws.amazon.com/redshift-serverless/latest/APIReference/API_CreateWorkgroup.html473- **Redshift Serverless Usage Limits** — https://docs.aws.amazon.com/redshift/latest/dg/serverless-usage-limits.html474- **Redshift Data API** — https://docs.aws.amazon.com/redshift/latest/dg/data-api.html475- **Cross-Region Snapshots** — https://docs.aws.amazon.com/redshift/latest/dg/serverless-cross-region-snapshots.html476- **Query Editor v2** — https://docs.aws.amazon.com/redshift/latest/dg/query-editor-v2.html477- **Zero-ETL Integrations** — https://docs.aws.amazon.com/redshift/latest/dg/zero-etl.html478- **Redshift Serverless CLI Reference** — https://docs.aws.amazon.com/cli/latest/reference/redshift-serverless/479480## References481482- `references/cli-commands-and-iac.md` — full copy-pasteable CLI command483 sequence for all 11 deployment steps, including KMS key creation,484 subnet group creation, namespace IAM role, Secrets Manager secret,485 namespace creation, workgroup creation, usage limits, scheduled486 snapshots, cross-Region snapshot copy, and Terraform /487 CloudFormation equivalents.488489- `references/configuration-and-cost-guide.md` — deep reference on490 encryption strategy, VPC networking, usage-limit tuning, snapshot491 and cross-Region DR strategy, Data API patterns, query editor v2492 setup, full NEVER list, edge-case handling, and pre-flight safety493 CLI.