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

Working with existing DynamoDB table flow: requires excessive permissions #4761

Closed
Isan-Rivkin opened this issue Dec 7, 2022 · 0 comments · Fixed by #4809
Closed

Working with existing DynamoDB table flow: requires excessive permissions #4761

Isan-Rivkin opened this issue Dec 7, 2022 · 0 comments · Fixed by #4809
Assignees
Labels
area/KV Improvements to the KV store implementation contributor team/cloud-native Team cloud native

Comments

@Isan-Rivkin
Copy link
Contributor

Isan-Rivkin commented Dec 7, 2022

When working with DynamoDB, some users prefer to create the DynamoDB externally (with IAC for example).

Current Flow:

  1. Try create table
  2. Check type: if error.Type == ResourceInUseException then table exists and it's ok dismiss error.
  3. else:... handle error.

The problem:

Even when working with an existing DDB table the code requires to have excessive permissions (CreateTable, DeleteTable and UpdateTable).
If the user did not provide those extra permissions it will be a different error than ResourceInUseException which causes the flow to fail.

Suggested solutions:

Could be that user indicates in the config that it's an existing table and the code will skip CreateTableWithContext.
Another option is to try and DescribeTable before trying to create it, the downside here is that it will cause initial error in cases the table doesn't exist.
Another option could be check if the error is Permission related and try to describe the table, only if the table does not exist handle this as real error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/KV Improvements to the KV store implementation contributor team/cloud-native Team cloud native
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant