1. Registry
  2. Packages
  3. Dokploy
  4. API Docs
  5. MongoDB
Viewing docs for Dokploy v0.3.1
published on Tuesday, Sep 29, 2026 by dimeskigj
dokploy logo Dokploy
Viewing docs for Dokploy v0.3.1
published on Tuesday, Sep 29, 2026 by dimeskigj

    A Dokploy MongoDB database.

    Create MongoDB Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new MongoDB(name: string, args: MongoDBArgs, opts?: CustomResourceOptions);
    @overload
    def MongoDB(resource_name: str,
                args: MongoDBArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def MongoDB(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                database_password: Optional[str] = None,
                database_user: Optional[str] = None,
                environment_id: Optional[str] = None,
                name: Optional[str] = None,
                app_name: Optional[str] = None,
                description: Optional[str] = None,
                docker_image: Optional[str] = None,
                environment: Optional[str] = None,
                external_port: Optional[int] = None,
                replica_sets: Optional[bool] = None,
                server_id: Optional[str] = None)
    func NewMongoDB(ctx *Context, name string, args MongoDBArgs, opts ...ResourceOption) (*MongoDB, error)
    public MongoDB(string name, MongoDBArgs args, CustomResourceOptions? opts = null)
    public MongoDB(String name, MongoDBArgs args)
    public MongoDB(String name, MongoDBArgs args, CustomResourceOptions options)
    
    type: dokploy:MongoDB
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "dokploy_mongo_d_b" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args MongoDBArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args MongoDBArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args MongoDBArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MongoDBArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MongoDBArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var mongoDBResource = new Dokploy.MongoDB("mongoDBResource", new()
    {
        DatabasePassword = "string",
        DatabaseUser = "string",
        EnvironmentId = "string",
        Name = "string",
        AppName = "string",
        Description = "string",
        DockerImage = "string",
        Environment = "string",
        ExternalPort = 0,
        ReplicaSets = false,
        ServerId = "string",
    });
    
    example, err := dokploy.NewMongoDB(ctx, "mongoDBResource", &dokploy.MongoDBArgs{
    	DatabasePassword: pulumi.String("string"),
    	DatabaseUser:     pulumi.String("string"),
    	EnvironmentId:    pulumi.String("string"),
    	Name:             pulumi.String("string"),
    	AppName:          pulumi.String("string"),
    	Description:      pulumi.String("string"),
    	DockerImage:      pulumi.String("string"),
    	Environment:      pulumi.String("string"),
    	ExternalPort:     pulumi.Int(0),
    	ReplicaSets:      pulumi.Bool(false),
    	ServerId:         pulumi.String("string"),
    })
    
    resource "dokploy_mongo_d_b" "mongoDBResource" {
      pulumi {
        replace_on_changes = [environment_id, server_id]
      }
      lifecycle {
        create_before_destroy = true
      }
      database_password = "string"
      database_user     = "string"
      environment_id    = "string"
      name              = "string"
      app_name          = "string"
      description       = "string"
      docker_image      = "string"
      environment       = "string"
      external_port     = 0
      replica_sets      = false
      server_id         = "string"
    }
    
    var mongoDBResource = new MongoDB("mongoDBResource", MongoDBArgs.builder()
        .databasePassword("string")
        .databaseUser("string")
        .environmentId("string")
        .name("string")
        .appName("string")
        .description("string")
        .dockerImage("string")
        .environment("string")
        .externalPort(0)
        .replicaSets(false)
        .serverId("string")
        .build());
    
    mongo_db_resource = dokploy.MongoDB("mongoDBResource",
        database_password="string",
        database_user="string",
        environment_id="string",
        name="string",
        app_name="string",
        description="string",
        docker_image="string",
        environment="string",
        external_port=0,
        replica_sets=False,
        server_id="string")
    
    const mongoDBResource = new dokploy.MongoDB("mongoDBResource", {
        databasePassword: "string",
        databaseUser: "string",
        environmentId: "string",
        name: "string",
        appName: "string",
        description: "string",
        dockerImage: "string",
        environment: "string",
        externalPort: 0,
        replicaSets: false,
        serverId: "string",
    });
    
    type: dokploy:MongoDB
    properties:
        appName: string
        databasePassword: string
        databaseUser: string
        description: string
        dockerImage: string
        environment: string
        environmentId: string
        externalPort: 0
        name: string
        replicaSets: false
        serverId: string
    

    MongoDB Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The MongoDB resource accepts the following input properties:

    DatabasePassword string
    The MongoDB database password.
    DatabaseUser string
    The MongoDB database user.
    EnvironmentId string
    The target environment ID.
    Name string
    The database resource name.
    AppName string
    The optional deployed database name.
    Description string
    An optional database description.
    DockerImage string
    The MongoDB Docker image.
    Environment string
    Environment variables for MongoDB.
    ExternalPort int
    The optional externally exposed port.
    ReplicaSets bool
    Whether to enable a MongoDB replica set.
    ServerId string
    The optional server ID.
    DatabasePassword string
    The MongoDB database password.
    DatabaseUser string
    The MongoDB database user.
    EnvironmentId string
    The target environment ID.
    Name string
    The database resource name.
    AppName string
    The optional deployed database name.
    Description string
    An optional database description.
    DockerImage string
    The MongoDB Docker image.
    Environment string
    Environment variables for MongoDB.
    ExternalPort int
    The optional externally exposed port.
    ReplicaSets bool
    Whether to enable a MongoDB replica set.
    ServerId string
    The optional server ID.
    database_password string
    The MongoDB database password.
    database_user string
    The MongoDB database user.
    environment_id string
    The target environment ID.
    name string
    The database resource name.
    app_name string
    The optional deployed database name.
    description string
    An optional database description.
    docker_image string
    The MongoDB Docker image.
    environment string
    Environment variables for MongoDB.
    external_port number
    The optional externally exposed port.
    replica_sets bool
    Whether to enable a MongoDB replica set.
    server_id string
    The optional server ID.
    databasePassword String
    The MongoDB database password.
    databaseUser String
    The MongoDB database user.
    environmentId String
    The target environment ID.
    name String
    The database resource name.
    appName String
    The optional deployed database name.
    description String
    An optional database description.
    dockerImage String
    The MongoDB Docker image.
    environment String
    Environment variables for MongoDB.
    externalPort Integer
    The optional externally exposed port.
    replicaSets Boolean
    Whether to enable a MongoDB replica set.
    serverId String
    The optional server ID.
    databasePassword string
    The MongoDB database password.
    databaseUser string
    The MongoDB database user.
    environmentId string
    The target environment ID.
    name string
    The database resource name.
    appName string
    The optional deployed database name.
    description string
    An optional database description.
    dockerImage string
    The MongoDB Docker image.
    environment string
    Environment variables for MongoDB.
    externalPort number
    The optional externally exposed port.
    replicaSets boolean
    Whether to enable a MongoDB replica set.
    serverId string
    The optional server ID.
    database_password str
    The MongoDB database password.
    database_user str
    The MongoDB database user.
    environment_id str
    The target environment ID.
    name str
    The database resource name.
    app_name str
    The optional deployed database name.
    description str
    An optional database description.
    docker_image str
    The MongoDB Docker image.
    environment str
    Environment variables for MongoDB.
    external_port int
    The optional externally exposed port.
    replica_sets bool
    Whether to enable a MongoDB replica set.
    server_id str
    The optional server ID.
    databasePassword String
    The MongoDB database password.
    databaseUser String
    The MongoDB database user.
    environmentId String
    The target environment ID.
    name String
    The database resource name.
    appName String
    The optional deployed database name.
    description String
    An optional database description.
    dockerImage String
    The MongoDB Docker image.
    environment String
    Environment variables for MongoDB.
    externalPort Number
    The optional externally exposed port.
    replicaSets Boolean
    Whether to enable a MongoDB replica set.
    serverId String
    The optional server ID.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the MongoDB resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    MongoId string
    The stable Dokploy MongoDB ID.
    Status string
    The current MongoDB deployment status.
    Id string
    The provider-assigned unique ID for this managed resource.
    MongoId string
    The stable Dokploy MongoDB ID.
    Status string
    The current MongoDB deployment status.
    id string
    The provider-assigned unique ID for this managed resource.
    mongo_id string
    The stable Dokploy MongoDB ID.
    status string
    The current MongoDB deployment status.
    id String
    The provider-assigned unique ID for this managed resource.
    mongoId String
    The stable Dokploy MongoDB ID.
    status String
    The current MongoDB deployment status.
    id string
    The provider-assigned unique ID for this managed resource.
    mongoId string
    The stable Dokploy MongoDB ID.
    status string
    The current MongoDB deployment status.
    id str
    The provider-assigned unique ID for this managed resource.
    mongo_id str
    The stable Dokploy MongoDB ID.
    status str
    The current MongoDB deployment status.
    id String
    The provider-assigned unique ID for this managed resource.
    mongoId String
    The stable Dokploy MongoDB ID.
    status String
    The current MongoDB deployment status.

    Package Details

    Repository
    dokploy dimeskigj/pulumi-dokploy
    License
    Apache-2.0
    dokploy logo Dokploy
    Viewing docs for Dokploy v0.3.1
    published on Tuesday, Sep 29, 2026 by dimeskigj

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial