Deleting an Amazon DynamoDB Table - AWS SDK for Ruby

Deleting an Amazon DynamoDB Table

The following example deletes the Movies table in the us-west-2 region.

# Create dynamodb client in us-west-2 region dynamodb = Aws::DynamoDB::Client.new(region: 'us-west-2') params = { table_name: 'Movies' } begin dynamodb.delete_table(params) puts 'Deleted table.' rescue Aws::DynamoDB::Errors::ServiceError => error puts 'Unable to delete table:' puts error.message end

See the complete example on GitHub.