Amazon DocumentDB Management in VS Code
Overview
Section titled “Overview”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.
Connecting
Section titled “Connecting”To connect to Amazon DocumentDB in DBCode:
- Open the DBCode Extension: Launch Visual Studio Code and open the DBCode extension.
- Add a New Connection: Click on the “Add Connection” icon.
- Choose Amazon DocumentDB: Select Amazon DocumentDB as the database type. The form comes preset with DocumentDB-friendly defaults: the
mongodb://protocol, SSL/TLS enabled, andretryWrites=false(DocumentDB does not support retryable writes). - Enter your cluster details: host (your cluster endpoint), port (27017), username, and password.
- Connect: Click save to connect and start managing your collections and documents.
For detailed instructions on connecting, refer to the Connect article.
Connecting from outside the VPC
Section titled “Connecting from outside the VPC”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.