-
Notifications
You must be signed in to change notification settings - Fork 79
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
Amplify Gen2 Data Construct does not expose tables or cfnTables #2137
Comments
Hey @dbanksdesign, Thank you for bringing this to our attention. We've managed to replicate the issue, so we're categorizing it as a bug for the team to investigate further. |
The issue here is that the Data construct's table creation strategy is to use the Amplify-provisioned iterative tables, rather than the CloudFormation-managed default. That means the resource shows up under Object.values(dataResources.amplifyDynamoDbTables).forEach((table) => {
table.pointInTimeRecoveryEnabled = false;
}); @AaronZyLee will be working to find the right way to update our docs to reflect this change. |
Would I be able to get an ARN or StreamARN via amplifyDynamoDbTables? If not, I assume it is more than just a documentation problem, right? |
I did a test directly with CDK, and I didn't encounter the problem (https://gist.github.com/marnutux/f22b06dc8398babfa1f04c61daf36b0b#file-amplify-stack-example-ts-L30). I only have the issue when using the abstraction |
Hi there. Via the same method, would I be able to add a Global Index. I did not see a way to do this via the Data resource model |
Hey, We are working on it and it will be released as part of GA. |
Hey @jrobertshawe, We have completed the work for backend and currently working on the client side library. We will let you know as soon as it is released. |
This issue has been fixed in release: @aws-amplify/backend": "^0.13.0-beta.6 |
@AnilMaktala still same, here are my amplify backend versions
|
@pavinthan - you should be able to access the resources under |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Hi @renebrandel I have been following a trail of issues and discord threads all pointing to this issue. As far as I can tell the tables and cfnTables still don't work. Unless I am missing something? I would like to be able to add a DynamoEventSource for my lambda as described in the documentation Also looking at other challenges like adding Tags to my tables. Do you have any advice here? |
Hey. You should be able to use cfnAmplifyTables, which provide the same interface. The reasons is to address some of the workflow problems (like updating multiple GSIs in a single request) requires us to use a custom Amplify DDB table resource. |
The L2 reference (.tables) should work as is though. |
Thanks for the speedy response and clarification! First part was my misunderstanding of the different interfaces. I still have some problem with adding tags though. I see no error when using the below code, but it doesn't add any tags in the generated template/deployed resource. |
Same problem here. |
Same here. And in my case, I was trying to override some settings for my gsi, but in the end I had to use custom resource to help me with that. Also I believe this could potentially an issue when we have multiple GSIs to create or configure, because if we configure our GSIs by following the amplify gen2 doc, then by default all those GSIs will be created with a Again, I understand the amplify devs have good reasons to design |
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
20
Amplify CLI Version
gen 2
What operating system are you using?
mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No
Describe the bug
Based on https://docs.amplify.aws/gen2/build-a-backend/data/override-resources/ I should be able to access the tables the data construct creates, but those objects are empty
Expected behavior
I should have access to them like the docs says
Reproduction steps
Follow https://docs.amplify.aws/gen2/start/ to create a gen2 app, then write the code in https://docs.amplify.aws/gen2/build-a-backend/data/override-resources/ it will fail because
dataResources.tables["Todo"]
is undefined because the tables object is empty.Project Identifier
No response
Log output
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: