-
Notifications
You must be signed in to change notification settings - Fork 240
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
ApiGatewayToDynamoDB: customize resource name on REST API #848
Comments
We understand the concept and can see the value - but when we read the snippet it looks reasonable to us. We will take a look at what an implementation involves - but could you provide an example of what the snippet would look like after the change you're proposing? (BTW - there's a significant change to API Gateway constructs coming imminently although this item is not addressed.) |
The weird thing in the example I gave is that the My proposed change is to:
which would be less confusing IMO. I'll try and drop a PR to address this, WDYT? |
We had put this on our list to implement, but will hold off if you want to give it a try. As we see it, there's a new optional attribute on the Construct props, resourceName. If supplied, this is used in place of partitionKeyName on line 249. It's also used in every This is only applicable to this construct, the default resource names on the other apigateway constructs are specific to the content (Records, Message, etc.). We'd want to see at least one more unit test and one more integration test. Let us know if you want to take it on. (re-reading this and your post, I guess it is pretty much exactly what you proposed above :-) |
That's correct! I'll still need a custom template indeed |
So just to clarify - will you be submitting a PR, or should we add it to our todo list? |
I should be able to submit a PR at the beginning of next week! |
Great - we'll watch out for it. |
Hello, I would like to customize the generated resource name on my REST API when using
ApiGatewayToDynamoDB
.Use Case
Currently, the resource name is generated from the DynamoDB partition key
aws-solutions-constructs/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/lib/index.ts
Line 152 in 0bc9043
However, I am trying to implement a more complex use case where my integration will query on the sort key. It feel weird to have to write:
I understand that this is the default use case, but it should be customizable IMO.
Proposed Solution
Add an optional
resourceName
string parameter on the construct and use it to define the resource name if it is passed. Otherwise, use the table's partition key like in the current implementation.Other
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: