Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeType 'SS' not allowed #185

Open
tracey-ruark opened this issue May 24, 2024 · 0 comments
Open

AttributeType 'SS' not allowed #185

tracey-ruark opened this issue May 24, 2024 · 0 comments

Comments

@tracey-ruark
Copy link

tracey-ruark commented May 24, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant