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

Unable to use local DynamoDB restore from C# #139

Closed
lukep-coxauto opened this issue Apr 13, 2022 · 1 comment
Closed

Unable to use local DynamoDB restore from C# #139

lukep-coxauto opened this issue Apr 13, 2022 · 1 comment
Labels

Comments

@lukep-coxauto
Copy link

lukep-coxauto commented Apr 13, 2022

dynamodump has an option to use local DynamoDB by setting the region to local. The problem is that the AWS regions are defined explicitly in the C# client in an enum, and local is not contained within the enum.

DynamoDB local uses the region property to differentiate sets of tables, so if you create the tables under the region local, and you aren't able to specify the region local when using the DynamoDB client, you aren't able to access any tables.

> aws dynamodb list-tables --endpoint-url http://localhost:2732 --region local
{                                                                                                                                                                                                         
    "TableNames": [
        "Table1",
        "Table2",
        "Table3", 
    ]
}
> aws dynamodb list-tables --endpoint-url http://localhost:2732 --region us-east-1
{
    "TableNames": []
}

If we were able to add an additional flag such as --useDynamoDBLocal in tandem with a region specified by --region, then we could specify the region as an existing AWS region so DynamoDB Local partitions the tables into a namespace that's accessible from typed language clients where the local region will not exist.

This line in the file is the issue. if you pass "local" it sets the region to "local" also which makes the table partitioning listed under "local" region.

region=args.region,

@bchew
Copy link
Owner

bchew commented Apr 26, 2022

@lukep-coxauto I did some tests and from what I can tell, running DynamoDB Local with -sharedDb lists all tables regardless of region specified (or not even specified) https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.UsageNotes.html

However, I am unsure if that would resolve your issue when it comes to typed language clients as I have not done any testing on that.

As to your point on local region being used, I understand where you are coming from on that but I believe that would require fair bit of changes to how dynamodump cli is used and it does sound outside the scope of the original intention of what the tool was designed for (it was originally tested with dynalite and not DynamoDB Local for e.g.). Having said that, am happy for you to create a pull request of the changes if you like. 🙂

@github-actions github-actions bot added the Stale label Oct 3, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants