Skip to content

fix(dynamodb,eventbridge,lambda,cloudtrail,wafv2): publish the member names AWS publishes (#738) - #754

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/738-wire-names
Aug 23, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/738-wire-names

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Nine response members were published under a name no AWS SDK reads. Every one was checked against the member name in the official API reference rather than swept mechanically, because a Go json tag is only a bug when three things hold at once — the plugin's protocol serializes Go tags, the struct actually reaches a response body, and AWS spells the member differently.

Of 158 candidate tag lines, 24 turned out to be cases where AWS really does publish the capitalized form: the bare spelling ARN appears on 16 lines and is correct on 15 of them (Secrets Manager, SSM, WAFv2's Web ACL, CloudFront and ElastiCache all publish ARN), and FSx genuinely publishes ResourceARN and DNSName. A blanket ARN → Arn rename would have broken six correct fields to fix one, so this is per-service.

What was wrong

Service Member Was
DynamoDB TableArn, LatestStreamArn, IndexArn (GSI and LSI) TableARN, LatestStreamARN, IndexARN
EventBridge a rule's Arn ARN
Lambda ESM FunctionArn, EventSourceArn FunctionARN, EventSourceARN
CloudTrail KmsKeyId, LogFileValidationEnabled KMSKeyId, EnableLogFileValidation
WAFv2 an IP set's IPAddressVersion IPVersion

EnableLogFileValidation is CreateTrail's and UpdateTrail's input name — every response publishes the setting as LogFileValidationEnabled — so the input parsing still reads it. PutRule, which wraps a rule's ARN under RuleArn, was already correct. The lowercase eventSourceARN inside a Lambda stream-record event payload is a different and correct spelling, and is untouched. A trail's own TrailARN is correct.

StackDeployer decodes substrate's own CreateTable response with an inline tag, so it changes in the same commit — otherwise the deployer would have stopped recording table ARNs the moment the tag was fixed.

WAFv2 is a behaviour fix

The wrong member name was used to parse the request as well as to render the response, so a typed SDK — which can only send IPAddressVersion — had its IPV6 request read as absent and silently replaced by substrate's IPV4 default. The set was created successfully holding the wrong address family, so a consumer's error branch never ran.

Why no test caught this

test/e2e had no DynamoDB or WAFv2 client at all. The unit tier asserts on substrate's own spelling, and only a typed SDK can decide whether a member decodes — which is exactly how nine wrong names stayed green through every release.

  • test/e2e/journey_wire_names_test.go creates a table with a stream and a GSI and reads all three ARNs off the SDK's TableDescription, then round-trips an IPv6 IP set. Against the previous code: TableArn is nil, LatestStreamArn is nil, GSI IndexArn is nil, IPAddressVersion = "" want IPV6.
  • emulator/wire_names_738_test.go pins CloudTrail's, EventBridge's and Lambda's members through a raw map[string]any, asserting both that the published name is present and that the wrong one is absent. All three fail against the previous code.
  • emulator/wafv2_plugin_test.go gains a table-driven round-trip for the three address-version cases.

Verified live through the AWS CLI against a built binary: dynamodb create-table / describe-table return all three ARNs, and wafv2 get-ip-set reports IPV6. (cloudtrail create-trail still answers ServiceNotAvailable: service not emulated: com through the CLI — that is #739's routing miss, unrelated to this change and confirmed by it.)

The e2e module gains the dynamodb and wafv2 clients, which requires aws-sdk-go-v2 v1.43.7 there.

Compatibility

DynamoDBTable is both the response shape and the persisted record, so the state key renames too: a stream or exported fixture recorded before this change decodes the ARN as empty. Accepted as a fixture break at a minor version rather than carried as a permanent read alias. A fixture asserting that an IPV6 request produced an IPV4 set also flips.

Also re-adds the ## [Unreleased] heading the previous release PR consumed.

Closes #738

… names AWS publishes (#738)

Nine response members carried a Go json tag no AWS SDK reads. Each was checked
against the member name in the official API reference rather than swept
mechanically: a tag is only a bug when the plugin's protocol serializes Go tags,
the struct reaches a response body, and AWS spells the member differently. Of 158
candidate lines, 24 are cases where AWS really does publish the capitalized form —
the bare spelling ARN appears on 16 lines and is correct on 15, and FSx genuinely
publishes ResourceARN and DNSName — so a blanket ARN -> Arn rename would have
broken six correct fields to fix one.

DynamoDB's TableArn, LatestStreamArn and both IndexArn descriptors decoded as nil
through a real SDK, so a consumer reading TableArn got "" and no error.
StackDeployer's own decode of substrate's CreateTable response changes in the same
commit or it stops recording table ARNs. EventBridge's rule Arn, Lambda's ESM
FunctionArn and EventSourceArn, and CloudTrail's KmsKeyId plus the
LogFileValidationEnabled output member (EnableLogFileValidation is the *input*
name, still read as such) are the rest.

WAFv2 is a behaviour fix, not a rendering one: the wrong name parsed the request
too, so a typed SDK's IPV6 CreateIPSet was read as absent and silently replaced by
the IPV4 default — the set was created holding the wrong address family with no
error.

test/e2e had no DynamoDB or WAFv2 client at all, which is how both defects stayed
green: the unit tier asserts on substrate's own spelling, and only a typed SDK can
decide whether a member decodes. It gains a journey reading all three ARNs off the
SDK's TableDescription and an IPv6 round-trip; emulator gains raw-map pinning
tests for CloudTrail, EventBridge and Lambda. All fail against the previous code.
@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit fbc1bab into main Aug 23, 2026
13 checks passed
@scttfrdmn
scttfrdmn deleted the fix/738-wire-names branch August 23, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dynamodb: TableArn is serialized as TableARN, so every SDK reads it as absent

1 participant