Skip to content

AttributeType 'SS' not allowed #185

@tracey-ruark

Description

@tracey-ruark

Describe the issue
We've got an existing dynalite implementation up and running, using jest-dynalite-config.js to configure our tables. We're attempting to add attributes to an existing table to store an array of string values and we ran into the error: ValidationException: 2 validation errors detected: Value 'SS' at 'attributeDefinitions.2.member.attributeType' failed to satisfy constraint: Member must satisfy enum value set: [B, N, S]; Value 'SS' at 'attributeDefinitions.3.member.attributeType' failed to satisfy constraint: Member must satisfy enum value set: [B, N, S]

Steps to reproduce
Here is the configuration block of the existing table inside of our jest-dynalite-config.js file prior to the changes:

{
  TableName: `service-store`,
  KeySchema: [
    {
      AttributeName: 'serviceName',
      KeyType: 'HASH'
    }
  ],
  AttributeDefinitions: [
    {
      AttributeName: 'serviceName',
      AttributeType: 'S'
    }
  ],
  ProvisionedThroughput: {
    ReadCapacityUnits: 1,
    WriteCapacityUnits: 1
  }
}

Modified as follows to add two new attributes with the 'SS' AttributeType:

{
  TableName: `service-store`,
  KeySchema: [
    {
      AttributeName: 'serviceName',
      KeyType: 'HASH'
    }
  ],
  AttributeDefinitions: [
    {
      AttributeName: 'serviceName',
      AttributeType: 'S'
    },
    {
      AttributeName: 'testTypes',
      AttributeType: 'SS'
    },
    {
      AttributeName: 'testEnvs',
      AttributeType: 'SS'
    }
  ],
  ProvisionedThroughput: {
    ReadCapacityUnits: 1,
    WriteCapacityUnits: 1
  }
}

Expected behavior
DynamoDB documentation indicates that the 'SS' type is a valid attribute type for representing a String Set, as long as it is not used for Hash or Range Keys. Since this isn't being used as a Hash or Range key we would expect it to work the same in Dynalite as it would in DynamoDB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions