MongoDB Atlas cloud connection
Atlas connections use project API keys (not IAM). Ductape manages project network access and links Atlas clusters.
Setup checklist
- Atlas → Project Settings → copy Project ID (24-character hex).
- Security → Project Identity & Access → Applications → API Keys.
- Create API key with Project Owner under Project permissions.
- Copy public key and private key (private key shown once).
- Workbench → Cloud → Add Atlas connection with tag e.g.
prod_atlas. - After activation, under Private access, add Ductape proxy IPs to Atlas Network Access (or sync from Workbench).
SDK lifecycle
- TypeScript
- Java
- Go
- .NET
await ductape.cloud.connections.create({
provider: 'mongodb_atlas',
name: 'prod_atlas',
scopes: ['database'],
});
await ductape.cloud.connections.complete('prod_atlas', {
project_id: '5c843ba379358e5b3dc2dec6',
atlas_public_key: 'awqxqtif',
atlas_private_key: 'your-private-key',
});
await ductape.cloud.connections.validate('prod_atlas');
ductape.cloud.connections.create(Map.of(
"provider", "mongodb_atlas",
"name", "prod_atlas",
scopes: ['database'],
));
ductape.cloud.connections.complete('prod_atlas', Map.of(
"project_id", "5c843ba379358e5b3dc2dec6",
"atlas_public_key", "awqxqtif",
"atlas_private_key", "your-private-key",
));
ductape.cloud.connections.validate('prod_atlas');
client.cloud.connections.create({
"provider": "mongodb_atlas",
"name": "prod_atlas",
scopes: ['database'],
});
client.cloud.connections.complete('prod_atlas', {
"project_id": "5c843ba379358e5b3dc2dec6",
"atlas_public_key": "awqxqtif",
"atlas_private_key": "your-private-key",
});
client.cloud.connections.validate('prod_atlas');
await ductape.cloud.connections.create({
["provider"] = "mongodb_atlas",
["name"] = "prod_atlas",
scopes: ['database'],
});
await ductape.cloud.connections.complete('prod_atlas', {
["project_id"] = "5c843ba379358e5b3dc2dec6",
["atlas_public_key"] = "awqxqtif",
["atlas_private_key"] = "your-private-key",
});
await ductape.cloud.connections.validate('prod_atlas');
Linked services
service | Component type |
|---|---|
atlas-cluster | Databases (MongoDB) |
Import an existing cluster:
- TypeScript
- Java
- Go
- .NET
const result = await ductape.cloud.resources.import({
cloud: 'prod_atlas',
service: 'atlas-cluster',
type: 'databases',
product: 'my-product',
component: 'db-mongo',
env: 'prd',
resource: 'cluster-name',
});
Map<String, Object> result = ductape.cloud.resources.import(Map.of(
"cloud", "prod_atlas",
"service", "atlas-cluster",
"type", "databases",
"product", "my-product",
"component", "db-mongo",
"env", "prd",
"resource", "cluster-name",
));
result := client.cloud.resources.import({
"cloud": "prod_atlas",
"service": "atlas-cluster",
"type": "databases",
"product": "my-product",
"component": "db-mongo",
"env": "prd",
"resource": "cluster-name",
});
var result = await ductape.cloud.resources.import({
["cloud"] = "prod_atlas",
["service"] = "atlas-cluster",
["type"] = "databases",
["product"] = "my-product",
["component"] = "db-mongo",
["env"] = "prd",
["resource"] = "cluster-name",
});
Ductape stores the connection string as a workspace secret on the component env.