aws-amplify / amplify-category-api

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development. This plugin provides functionality for the API category, allowing for the creation and management of GraphQL and REST based backends for your amplify project.
https://docs.amplify.aws/
Apache License 2.0
89 stars 79 forks source link

Ability to create Local Secondary Index for AppSync Model table #3016

Open NiharikaBaliboyna9 opened 1 week ago

NiharikaBaliboyna9 commented 1 week ago

Environment information

NA

Describe the feature

Currently we can only crease GSI for the data models in Amplify.


ChartOfAccount: a
    .model({
      orgId: a.id().required(),
      accountName: a.string().required(),
      accountDescription: a.string(),
      categoryName: a.string().required(),
      categoryType: a.string().required(),}) //ex: "INCOME", "EXPENSE", "ASSET", 
    .identifier(["orgId", "accountName"])
    .secondaryIndexes((index) => [index("orgId").sortKeys(["categoryName"])])
    .authorization((allow) => [allow.owner()]),
});

There is no option to create Local Secondary Index for the model. Unable to update/add using the backend.ts as the table would be already created by then and the LSI should be created with the table.

Use case

To create and use Local Secondary Index for the data models in amplify.

aashishjaria commented 1 week ago

Very important feature

ykethan commented 1 week ago

Hey,👋 thanks for raising this! I'm going to transfer this over to our API repository for better assistance 🙂