dsql-to-analytics-pipeline — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited dsql-to-analytics-pipeline (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
This skill covers everything DOWNSTREAM of the DSQL CDC stream: how to wire the stream into Kinesis, write a correct consumer Lambda, model events at the analytics sink, and avoid the data-loss footguns that come with async statement APIs and unordered delivery. Source-side DSQL concerns (DDL, IAM auth, OCC, schema design) belong to the companion dsql skill.
In the Aurora DSQL CDC public preview, both INSERT and UPDATE arrive as op='c'. Code that expects a separate 'u' op (the typical Debezium / DMS shape) will silently treat every UPDATE as if no row existed, then miss the latest state when downstream readers query a naive MAX(event_id) view. The append-only + ROW_NUMBER-by-commit-timestamp pattern this skill prescribes handles both cases correctly. There are several sibling footguns (the Redshift Data API's 200-parameter cap, the async execute_statement poll requirement, poison-record wedging) that cause silent data loss when missed. Each one is called out below.
for analytics in Redshift Serverless, S3 Tables (Iceberg), or both.
Kinesis stream and lands rows in an analytics sink.
log for the sink table shape.
poll) before you ship.
OCC retries, multi-tenant isolation, query plans. Use the companion dsql skill.
Use a COPY ... TO or pg_dump style flow; CDC is for change capture.
to Lambda + Redshift Data API + Firehose.
applies, but several callouts (preview status, op='c'-only, aws dsql create-stream, the dsql.amazonaws.com trust principal) are DSQL-specific.
DSQL cluster -> DSQL CDC stream (preview) -> Kinesis Data Stream -> Lambda event source mapping -> parameterized INSERTs into a Redshift Serverless append-only cdc_events table (or Firehose with an Iceberg destination + transform Lambda) -> per-source-table *_current views that reconstruct current state via ROW_NUMBER() OVER (PARTITION BY record_id ORDER BY commit_timestamp DESC).
Load these as needed. Each file leads with the non-obvious lessons; AWS documentation paraphrasing is intentionally avoided.
When: MUST load before creating the DSQL CDC stream or wiring the DSQL-to-Kinesis IAM trust. Contains: Public-preview status callout, why there is no CloudFormation resource type yet, idempotent aws dsql create-stream + get-stream polling, the dsql.amazonaws.com trust principal with aws:SourceArn matching <cluster-arn>/stream/* (NOT the bare cluster ARN), the c-and-d-only-in-preview gotcha, the CDC record envelope shape your consumer must parse.
When: MUST load before designing the sink schema. This is the single most important design decision in the pipeline. Contains: Why append-only beats in-place upsert under unordered duplicate delivery, the cdc_events DDL with DISTKEY/SORTKEY rationale, the *_current view template with ROW_NUMBER, the tombstone pattern (operation <> 'd'), schema-drift absorption via SUPER.
When: MUST load before writing or reviewing the consumer Lambda. Each pattern in here was earned by debugging a silent data-loss class. Contains: Parameterized SQL only (named params via the Data API Parameters= argument), the 200-parameter cap and ROWS_PER_CHUNK math, async describe_statement polling with exponential backoff, re-raise on failure to drive Kinesis retry, poison-record skipping vs raising, Lambda timeout sizing, full handler skeleton.
When: Load when authoring the EventSourceMapping CFN resource. Contains: Complete CFN snippet with BatchSize, MaximumBatchingWindowInSeconds, MaximumRetryAttempts, MaximumRecordAgeInSeconds, BisectBatchOnFunctionError, DestinationConfig.OnFailure -> SQS DLQ, plus the DLQ resource and the placeholder Lambda body that fails loudly if real code is not deployed.
When: Load when the sink is Redshift Serverless. Contains: IAM policy with the redshift-data:* resource-must-be-* quirk, redshift-serverless:GetCredentials for IAM-auth into the workgroup, JSON_PARSE(:d) to land SUPER, event_data."col"::TYPE projection rules, enable_case_sensitive_identifier for mixed-case JSON keys, PartiQL unnest pattern for SUPER arrays.
When: Load when the sink (or additional sink) is S3 Tables / Iceberg via Firehose. Contains: Why a transform Lambda is required (Firehose maps top-level JSON keys to Iceberg columns by name, so the CDC envelope must be flattened), pointer to the sibling streaming-into-data-lake skill that covers the Firehose-specific footguns end-to-end.
Each row tells you which skill owns a topic so you do not duplicate the guidance here.
| If you also need... | Load this skill |
|---|---|
| DSQL DDL, schema design, IAM auth, OCC, query plans | dsql (same plugin) |
| Validate SQL is DSQL-compatible before running it | dsql -> dsql_lint MCP tool |
| Land CDC into S3 Tables (Iceberg) via Firehose | streaming-into-data-lake (data-analytics plugin) for Firehose / Iceberg-specific footguns |
| Query a Redshift Serverless external schema over S3 | The Redshift external-schema skill (lakehouse-style) in your data-analytics plugin |
| Generic Kinesis / Lambda / SQS reference | The serverless skill in aws-core |
dsql skill tocreate the cluster and validate the schema with dsql_lint.
Kinesis stream + IAM role first, then aws dsql create-stream, then poll until ACTIVE. There is no CFN type yet; script it.
(append-only-pattern.md). cdc_events table + one *_current view per source table. Resist the urge to model in-place upserts.
(lambda-consumer.md, event-source-mapping.yaml). Set BisectBatchOnFunctionError, MaximumRetryAttempts, MaximumRecordAgeInSeconds, and a DLQ.
for Redshift; sink-s3-iceberg.md for Iceberg). Remember: redshift-data:* only accepts Resource: "*".
land as new rows in cdc_events; the *_current view should reflect the latest state per primary key within seconds.
The append-only sink absorbs new tables with NO DDL. The Lambda routes all events to the same cdc_events table; only a new *_current view is needed if downstream consumers want a typed projection.
transact (see the dsqlskill).
cdc_events with the newsource_table value (SELECT DISTINCT source_table FROM cdc_events).
*_current view per the template inSame answer: zero sink-side DDL required for ingestion. The new column appears in event_data automatically because SUPER is schema-flexible. The matching *_current view needs a new event_data."new_col"::TYPE AS new_col line if the column should be projected.
*_currentThe append-only pattern fails closed: if a row is missing from *_current, check (in order):
cdc_events? `SELECT * FROM cdc_events WHERE record_id= '...' ORDER BY commit_timestamp DESC LIMIT 5`. If absent, the event never reached Redshift -> check Lambda CloudWatch logs and the DLQ.
'd' (delete tombstone)? The view filtersthose out.
commit_timestamp parsing correct? See theCAST(:ts AS BIGINT) / 1000.0 note in lambda-consumer.md. A wrong divisor moves the timestamp by 3 orders of magnitude and the ROW_NUMBER ordering picks the wrong event.
Truncate cdc_events, set the EventSourceMapping StartingPosition: TRIM_HORIZON, redeploy. CDC retention on the Kinesis stream defines the replay window (default 24 hours, max 365 days).
the async poll. See lambda-consumer.md section 3.
ROWS_PER_CHUNK is set above 200 / params_per_row. Lower it.
certainly mismatches. Check aws:SourceArn is ArnLike against <cluster-arn>/stream/*, not the bare cluster ARN. See cdc-stream-setup.md.
BatchSize orraise the function timeout. The math: `ceil(BatchSize / ROWS_PER_CHUNK)
kinesis.data Base64, inspect the payload. Common causes: source schema change the Lambda chokes on, malformed ts_ms, missing primary key.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.