Delete Table in DynamoDB Using Java (Guide w/ Code Examples)
Provided by Rafal Wilinski
To delete a DynamoDB table, you can use the DeleteTableRequest
class.
You can provide the name of the table you wish to delete when using this class.
import software.amazon.awssdk.services.dynamodb.DynamoDbClient; import software.amazon.awssdk.services.dynamodb.model.DeleteTableRequest; import software.amazon.awssdk.services.dynamodb.model.DeleteTableResponse; public class DeleteTableExample { public static void main(String[] args) { DynamoDbClient ddb = DynamoDbClient.create(); String tableName = "my-table"; DeleteTableRequest request = DeleteTableRequest.builder() .tableName(tableName) .build(); DeleteTableResponse response = ddb.deleteTable(request); System.out.println("Table deleted : " + tableName); } }
Similar Code Examples
- Query Date Range in DynamoDB Using Java
- Update Multiple Attributes in DynamoDB Using Java
- Delete Multiple Items in DynamoDB Using Java
- Batch Save Using DynamoDB Mapper
- Batch Get in DynamoDB Using Java
- Update Multiple Items in DynamoDB Using Java
- Batch Write Item in DynamoDB Using Java
- Query Global Secondary Index in DynamoDB Using Java
- Query Local Secondary Index in DynamoDB Using Java
- Batch Load Using DynamoDB Mapper
- Conditional Update in DynamoDB Using Java
- GetItem in DynamoDB Using Java
- Update Attribute in DynamoDB Using Java
- Get Multiple Items in DynamoDB Using Java
- Delete All Items in DynamoDB Using Java
Spend less time in the AWS console, use Dynobase.
Try 7-day free trial. No credit card needed.
Product Features
DynamoDB Tools
DynamoDB Info
© 2024 Dynobase