Skip to content

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

Closed

Description

@scttfrdmn

DynamoDBTable.TableARN carries json:"TableARN" (emulator/dynamodb_types.go). AWS's member is TableArn — lowercase rn — on both TableDescription and Table:

So a caller asking for the ARN gets nothing, with no error:

$ aws --endpoint-url http://localhost:4678 dynamodb create-table --table-name probe \
    --attribute-definitions AttributeName=id,AttributeType=S \
    --key-schema AttributeName=id,KeyType=HASH --billing-mode PAY_PER_REQUEST \
    --query 'TableDescription.TableArn' --output text
None

$ aws --endpoint-url http://localhost:4678 dynamodb describe-table --table-name probe \
    --query 'Table.TableArn' --output text
None

The ARN itself is correct and stored — the Resource Groups Tagging API reports it accurately from the same record — so this is purely the wire name.

Found during #734's live SDK verification, which used a DynamoDB table to show that a resource written under one credential is visible to another. The table was visible; its ARN was not.

Why it matters more than a spelling

A consumer's usual next step after CreateTable is to pass the ARN to TagResource, to a CloudFormation output, or to an IAM policy's Resource. A typed SDK unmarshals TableArn into an empty string rather than failing, so that flow produces an empty-ARN request whose refusal names something unrelated. #734's own live script had to hard-code the ARN for exactly this reason.

Acceptance criteria

  • The JSON tag is TableArn, matching the API reference
  • CreateTable, DescribeTable, UpdateTable and DeleteTable all report it under that name
  • Index ARNs are checked the same way: AWS publishes IndexArn on GlobalSecondaryIndexDescription and LocalSecondaryIndexDescription, and LatestStreamArn on TableDescription — substrate's fields are IndexARN and LatestStreamARN
  • A test asserts the raw JSON key, not the Go field, so a rename cannot silently regress it
  • Compatibility noted: a fixture asserting on TableARN needs updating
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions