fix(aws): validate AWS integrations against SDK and API docs

Merged
WA
2d ago
+4389-187

Summary

  • DynamoDB:
    • Get, query, scan and update failed whenever an item held an integer above 2^53: the SDK returned a BigInt and Response.json threw. Those numbers now come back as exact strings.
    • String, number and binary sets serialized as {} and now come back as arrays.
    • Binary values serialized as index objects and now come back as base64.
    • New optional projectionExpression, consistentRead, indexName, parallel scan segment/totalSegments, and returnValues on put, delete and update. Update still defaults to ALL_NEW.
    • New outputs: scannedCount and table stream/ARN fields.
  • RDS Data API:
    • SELECT rowCount was always 0 and is now the row count. Writes are unchanged.
    • Insert/update placeholders now match the sanitized column names, so quoted keys no longer fail.
    • New optional parameters binding (with typeHint) for query/execute; generatedFields returned.
  • Athena:
    • The first result row was always dropped, which lost real data for DDL/utility statements. It is now dropped only when it matches the column names, or when column metadata is missing, as before.
    • New start-query encryption, expectedBucketOwner and clientRequestToken; execution athenaError, timings and engineVersion; column label, precision and scale.
  • SES:
    • Templated and bulk sends gain Reply-To through their own field, so a value saved for Send Email never carries over.
    • Bulk destinations now pass through ccAddresses/bccAddresses, which used to be silently stripped. Malformed values are still dropped rather than failing the send.
    • New fromName and emailTags (validated against the SES tag rules).
    • Account sandbox/enforcement status.
  • SQS: on the hosted deployment, queue URLs must be real SQS hostnames over https, because the SDK sends signed requests to the queue URL's host. Self-hosted installs keep SQS-compatible endpoints (LocalStack, ElasticMQ).
  • Lambda:
    • 13 advanced dropdowns had no unset option, so the editor persisted their first option. That disabled new event source mappings and reset tracing, SnapStart, log format, function URL invoke mode and CORS credentials on every update.
    • They now default to AWS's own default, or to unchanged on updates. Saved values are untouched.
    • New invoke tenantId, application/system log levels, GetFunction code.error and tagsError.
  • S3:
    • Object keys containing !'()* are now signed the way the SDK signs them; other keys sign identically.
    • Get Object returns ETag, version, storage class, SSE and user metadata.
    • List gains Delimiter/StartAfter and CommonPrefixes.
    • Put gains metadata, storage class and SSE. These default to the bucket's own settings.
  • Textract: Queries are reachable from the block; async jobs report jobStatus/statusMessage/warnings (partial success). Sync input over AWS's 10 MB limit fails fast instead of downloading 100 MB first.
  • Secrets Manager:
    • Binary secrets are readable (returned as base64); they used to throw.
    • List filters and sort; create/update KMS key and tags.
    • Describe dates and version stages in the block outputs.
  • CloudWatch:
    • Alarms, log events and log streams now return paging tokens.
    • Alarm config, actions, dimensions and metric-math fields.
    • Percentile (ExtendedStatistics) and unit on metric statistics.
  • CloudFormation:
    • Stack parameters, capabilities, export names and detailed status.
    • Change-set details, parameters, tags and paging.
    • RoleARN and termination protection.
  • IAM / STS / Identity Center:
    • Get Role now returns its documented permissions boundary and tags, which used to come back empty.
    • Create user/role gain permissions boundary and tags; list policies gains a usage filter.
    • AssumeRole gains SourceIdentity.
    • Identity Center user name parts, status and external IDs.
  • EC2: Describe Instances returns block devices, network interfaces, platform, state codes, IMDS settings, lifecycle and monitoring.
  • Response contract schemas now describe every new field.
  • Backwards compatibility:
    • No param, subBlock id, operation value, tool id or output was removed, renamed or retyped, and no default changed.
    • New block fields are scoped to their own operations in tools.config.params.
    • The only output values that change are ones that previously errored, were always empty, or were unusable: {} sets and index-object binary.

Follow-ups (not in this PR)

  • SES attachments: deferred. Attachment reads authorize via context.userId, the shared tool-file boundary; the new egress path should land with that boundary taking the acting principal.
  • EC2 RunInstances and DryRun.
  • CloudFormation TemplateURL, which needs a contract change to make templateBody optional.
  • Percentile-only metric statistics.
  • STS credential outputs could be hidden from logs; left alone here because it changes what existing logs and API responses show.
  • CloudWatch Logs Insights queries are not stopped on poll timeout.

Type of Change

  • Bug fix
  • New feature (additive params and outputs)

Testing

  • New regression tests, each red on the pre-fix code:
    • DynamoDB unmarshalling, through the real DocumentClient middleware
    • RDS SELECT rowCount and quoted-column placeholders
    • Athena DDL first row
    • SES templated Reply-To, bulk Cc/Bcc and From-name encoding
    • SQS host guard (hosted rejects EC2/API Gateway/http hosts; self-hosted LocalStack allowed)
    • S3 signature, checked against @smithy/signature-v4
  • vitest over every touched tools/, lib/internal/ and block test for these services, plus lib/api/contracts/tools/aws: 220 passed.
  • check-block-registry.ts origin/staging, check:tool-metadata, check:docs, check:integration-catalog and biome pass.
  • An independent review of the full diff checked it against the installed AWS SDK types; its findings are fixed here.
  • Type-check and check:audits run in CI.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)