Skip to content

Amazon DocumentDB Management in VS Code

Amazon DocumentDB is a fully managed, MongoDB-compatible document database service from AWS. It stores data as flexible JSON-like documents and speaks the MongoDB wire protocol, so you work with it in DBCode exactly as you would MongoDB: collections, documents, aggregation pipelines, and the same query editor.

To connect to Amazon DocumentDB in DBCode:

  1. Open the DBCode Extension: Launch Visual Studio Code and open the DBCode extension.
  2. Add a New Connection: Click on the “Add Connection” icon.
  3. Choose Amazon DocumentDB: Select Amazon DocumentDB as the database type. The form comes preset with DocumentDB-friendly defaults: the mongodb:// protocol, SSL/TLS enabled, and retryWrites=false (DocumentDB does not support retryable writes).
  4. Enter your cluster details: host (your cluster endpoint), port (27017), username, and password.
  5. Connect: Click save to connect and start managing your collections and documents.

For detailed instructions on connecting, refer to the Connect article.

Amazon DocumentDB clusters run inside a VPC and are not reachable from the public internet. To connect from your local machine, either run VS Code from a host inside the VPC, or use an SSH tunnel through a bastion in the VPC. DBCode has built-in SSH tunnel support under the connection’s Tunnel settings.

When you connect through a tunnel, the cluster’s TLS certificate is issued for the cluster endpoint rather than the tunnel address, so set Certificate Verification to Verify CA Only or No Verification to avoid a hostname mismatch. Leave Additional Hosts empty so DBCode connects directly instead of attempting replica-set discovery of in-VPC hosts that are unreachable through the tunnel.

For more on tunnels, see SSH Tunnels.

For more information about Amazon DocumentDB, check out Amazon DocumentDB.