Skip to content

Can I use an IndexName for a DynamoDB proxy? #69

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

Open
ffiorillosparkdigital opened this issue Feb 26, 2020 · 3 comments
Open

Can I use an IndexName for a DynamoDB proxy? #69

ffiorillosparkdigital opened this issue Feb 26, 2020 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ffiorillosparkdigital
Copy link

ffiorillosparkdigital commented Feb 26, 2020

Hi! I'm looking for a way to set up an endpoint that would use an index based on GSI, instead of using the primary Hash/Sort Key. Is this possible? I don't see any examples in the docs.

I tried adding this, but causes an error:
IndexName: user_id_index

apiGatewayServiceProxies:
- dynamodb:
path: /myapp/by_user/{user_id}
method: get
tableName: { Ref: 'myTable' }
IndexName: user_id_index
hashKey:
pathParam: user_id
attributeType: S
action: GetItem
cors: true

results in:

child "dynamodb" fails because ["IndexName" is not allowed]

Any help is appreciated. Thanks!

@horike37
Copy link
Collaborator

Right now, this plugin does not support for index of DynamoDB. But always welcome to proposal or pull request by anyone 👍

@horike37 horike37 added enhancement New feature or request help wanted Extra attention is needed labels Feb 27, 2020
@ffiorillosparkdigital
Copy link
Author

@horike37 thank you for your response.
After doing some more research, it looks like this could be achieved by using a custom Mapping Template in the API Gateway endpoint . Can this be achieved somehow in Serverless with the plugin?

Thanks!

eduardoporfiro added a commit to eduardoporfiro/serverless-apigateway-service-proxy that referenced this issue May 14, 2024
Adding documentation to explain how to use it
Close serverless-operations#69
eduardoporfiro added a commit to eduardoporfiro/serverless-apigateway-service-proxy that referenced this issue May 14, 2024
Adding query type to get information from dynamo and using index too. Close serverless-operations#69
eduardoporfiro added a commit to eduardoporfiro/serverless-apigateway-service-proxy that referenced this issue May 14, 2024
Adding documentation to explain how to use it
Close serverless-operations#69
@eduardoporfiro
Copy link

@horike37 hi
I just created an pull request trying to fix this issue! Can you take a look? I'm sorry if I did some mistake, be welcome to comment! It's my first time contributing in some open source code!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants