// *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** import * as pulumi from "@pulumi/pulumi"; import * as utilities from "./utilities"; export class Mongo extends pulumi.CustomResource { /** * Get an existing Mongo resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ public static get(name: string, id: pulumi.Input, state?: MongoState, opts?: pulumi.CustomResourceOptions): Mongo { return new Mongo(name, state, { ...opts, id: id }); } /** @internal */ public static readonly __pulumiType = 'dokploy:index/mongo:Mongo'; /** * Returns true if the given object is an instance of Mongo. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ public static isInstance(obj: any): obj is Mongo { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Mongo.__pulumiType; } /** * Unique Docker service name. Generated by Dokploy when omitted. Changing it forces a new database. */ declare public readonly appName: pulumi.Output; /** * Current status reported by Dokploy: `idle`, `running`, `done` or `error`. */ declare public /*out*/ readonly applicationStatus: pulumi.Output; /** * Arguments appended to the container command. */ declare public readonly args: pulumi.Output; /** * Override the container entrypoint command. */ declare public readonly command: pulumi.Output; /** * Hard CPU limit, for example `1`. */ declare public readonly cpuLimit: pulumi.Output; /** * Soft CPU reservation, for example `0.5`. */ declare public readonly cpuReservation: pulumi.Output; /** * RFC 3339 timestamp of when the database was created. */ declare public /*out*/ readonly createdAt: pulumi.Output; /** * Password for the root user. */ declare public readonly databasePassword: pulumi.Output; /** * Root username to create. */ declare public readonly databaseUser: pulumi.Output; /** * Free-form description. */ declare public readonly description: pulumi.Output; /** * Detach the service from the shared `dokploy-network`. */ declare public readonly detachDokployNetwork: pulumi.Output; /** * MongoDB image to run. Defaults to `mongo:8`. */ declare public readonly dockerImage: pulumi.Output; /** * Docker Swarm endpoint specification, as a JSON object. */ declare public readonly endpointSpecSwarm: pulumi.Output; /** * Environment variables in `KEY=value` format, one per line. */ declare public readonly env: pulumi.Output; /** * Environment this database belongs to. */ declare public readonly environmentId: pulumi.Output; /** * Host port to expose the database on. Leave unset to keep the database reachable only from inside the Docker network. */ declare public readonly externalPort: pulumi.Output; /** * Docker Swarm health check configuration, as a JSON object. */ declare public readonly healthCheckSwarm: pulumi.Output; /** * Docker Swarm service labels, as a JSON object. */ declare public readonly labelsSwarm: pulumi.Output; /** * Hard memory limit, for example `512m`. */ declare public readonly memoryLimit: pulumi.Output; /** * Soft memory reservation, for example `256m`. */ declare public readonly memoryReservation: pulumi.Output; /** * Docker Swarm service mode, as a JSON object. */ declare public readonly modeSwarm: pulumi.Output; /** * Display name of the database. */ declare public readonly name: pulumi.Output; /** * IDs of additional Docker networks to attach. */ declare public readonly networkIds: pulumi.Output; /** * Docker Swarm network attachments, as a JSON array. */ declare public readonly networkSwarm: pulumi.Output; /** * Docker Swarm placement constraints, as a JSON object. */ declare public readonly placementSwarm: pulumi.Output; /** * Start the instance as a single-node replica set. */ declare public readonly replicaSets: pulumi.Output; /** * Number of replicas to run. */ declare public readonly replicas: pulumi.Output; /** * Docker Swarm restart policy, as a JSON object. */ declare public readonly restartPolicySwarm: pulumi.Output; /** * Docker Swarm rollback configuration, as a JSON object. */ declare public readonly rollbackConfigSwarm: pulumi.Output; /** * Remote server to deploy on. Omit to use the Dokploy host itself. */ declare public readonly serverId: pulumi.Output; /** * Grace period in nanoseconds before a container is killed. */ declare public readonly stopGracePeriodSwarm: pulumi.Output; /** * Docker Swarm ulimits, as a JSON object. */ declare public readonly ulimitsSwarm: pulumi.Output; /** * Docker Swarm rolling update configuration, as a JSON object. */ declare public readonly updateConfigSwarm: pulumi.Output; /** * Create a Mongo resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: MongoArgs, opts?: pulumi.CustomResourceOptions) constructor(name: string, argsOrState?: MongoArgs | MongoState, opts?: pulumi.CustomResourceOptions) { let resourceInputs: pulumi.Inputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState as MongoState | undefined; resourceInputs["appName"] = state?.appName; resourceInputs["applicationStatus"] = state?.applicationStatus; resourceInputs["args"] = state?.args; resourceInputs["command"] = state?.command; resourceInputs["cpuLimit"] = state?.cpuLimit; resourceInputs["cpuReservation"] = state?.cpuReservation; resourceInputs["createdAt"] = state?.createdAt; resourceInputs["databasePassword"] = state?.databasePassword; resourceInputs["databaseUser"] = state?.databaseUser; resourceInputs["description"] = state?.description; resourceInputs["detachDokployNetwork"] = state?.detachDokployNetwork; resourceInputs["dockerImage"] = state?.dockerImage; resourceInputs["endpointSpecSwarm"] = state?.endpointSpecSwarm; resourceInputs["env"] = state?.env; resourceInputs["environmentId"] = state?.environmentId; resourceInputs["externalPort"] = state?.externalPort; resourceInputs["healthCheckSwarm"] = state?.healthCheckSwarm; resourceInputs["labelsSwarm"] = state?.labelsSwarm; resourceInputs["memoryLimit"] = state?.memoryLimit; resourceInputs["memoryReservation"] = state?.memoryReservation; resourceInputs["modeSwarm"] = state?.modeSwarm; resourceInputs["name"] = state?.name; resourceInputs["networkIds"] = state?.networkIds; resourceInputs["networkSwarm"] = state?.networkSwarm; resourceInputs["placementSwarm"] = state?.placementSwarm; resourceInputs["replicaSets"] = state?.replicaSets; resourceInputs["replicas"] = state?.replicas; resourceInputs["restartPolicySwarm"] = state?.restartPolicySwarm; resourceInputs["rollbackConfigSwarm"] = state?.rollbackConfigSwarm; resourceInputs["serverId"] = state?.serverId; resourceInputs["stopGracePeriodSwarm"] = state?.stopGracePeriodSwarm; resourceInputs["ulimitsSwarm"] = state?.ulimitsSwarm; resourceInputs["updateConfigSwarm"] = state?.updateConfigSwarm; } else { const args = argsOrState as MongoArgs | undefined; if (args?.databasePassword === undefined && !opts.urn) { throw new Error("Missing required property 'databasePassword'"); } if (args?.databaseUser === undefined && !opts.urn) { throw new Error("Missing required property 'databaseUser'"); } if (args?.environmentId === undefined && !opts.urn) { throw new Error("Missing required property 'environmentId'"); } resourceInputs["appName"] = args?.appName; resourceInputs["args"] = args?.args; resourceInputs["command"] = args?.command; resourceInputs["cpuLimit"] = args?.cpuLimit; resourceInputs["cpuReservation"] = args?.cpuReservation; resourceInputs["databasePassword"] = args?.databasePassword ? pulumi.secret(args.databasePassword) : undefined; resourceInputs["databaseUser"] = args?.databaseUser; resourceInputs["description"] = args?.description; resourceInputs["detachDokployNetwork"] = args?.detachDokployNetwork; resourceInputs["dockerImage"] = args?.dockerImage; resourceInputs["endpointSpecSwarm"] = args?.endpointSpecSwarm; resourceInputs["env"] = args?.env; resourceInputs["environmentId"] = args?.environmentId; resourceInputs["externalPort"] = args?.externalPort; resourceInputs["healthCheckSwarm"] = args?.healthCheckSwarm; resourceInputs["labelsSwarm"] = args?.labelsSwarm; resourceInputs["memoryLimit"] = args?.memoryLimit; resourceInputs["memoryReservation"] = args?.memoryReservation; resourceInputs["modeSwarm"] = args?.modeSwarm; resourceInputs["name"] = args?.name; resourceInputs["networkIds"] = args?.networkIds; resourceInputs["networkSwarm"] = args?.networkSwarm; resourceInputs["placementSwarm"] = args?.placementSwarm; resourceInputs["replicaSets"] = args?.replicaSets; resourceInputs["replicas"] = args?.replicas; resourceInputs["restartPolicySwarm"] = args?.restartPolicySwarm; resourceInputs["rollbackConfigSwarm"] = args?.rollbackConfigSwarm; resourceInputs["serverId"] = args?.serverId; resourceInputs["stopGracePeriodSwarm"] = args?.stopGracePeriodSwarm; resourceInputs["ulimitsSwarm"] = args?.ulimitsSwarm; resourceInputs["updateConfigSwarm"] = args?.updateConfigSwarm; resourceInputs["applicationStatus"] = undefined /*out*/; resourceInputs["createdAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["databasePassword"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Mongo.__pulumiType, name, resourceInputs, opts); } } /** * Input properties used for looking up and filtering Mongo resources. */ export interface MongoState { /** * Unique Docker service name. Generated by Dokploy when omitted. Changing it forces a new database. */ appName?: pulumi.Input; /** * Current status reported by Dokploy: `idle`, `running`, `done` or `error`. */ applicationStatus?: pulumi.Input; /** * Arguments appended to the container command. */ args?: pulumi.Input[]>; /** * Override the container entrypoint command. */ command?: pulumi.Input; /** * Hard CPU limit, for example `1`. */ cpuLimit?: pulumi.Input; /** * Soft CPU reservation, for example `0.5`. */ cpuReservation?: pulumi.Input; /** * RFC 3339 timestamp of when the database was created. */ createdAt?: pulumi.Input; /** * Password for the root user. */ databasePassword?: pulumi.Input; /** * Root username to create. */ databaseUser?: pulumi.Input; /** * Free-form description. */ description?: pulumi.Input; /** * Detach the service from the shared `dokploy-network`. */ detachDokployNetwork?: pulumi.Input; /** * MongoDB image to run. Defaults to `mongo:8`. */ dockerImage?: pulumi.Input; /** * Docker Swarm endpoint specification, as a JSON object. */ endpointSpecSwarm?: pulumi.Input; /** * Environment variables in `KEY=value` format, one per line. */ env?: pulumi.Input; /** * Environment this database belongs to. */ environmentId?: pulumi.Input; /** * Host port to expose the database on. Leave unset to keep the database reachable only from inside the Docker network. */ externalPort?: pulumi.Input; /** * Docker Swarm health check configuration, as a JSON object. */ healthCheckSwarm?: pulumi.Input; /** * Docker Swarm service labels, as a JSON object. */ labelsSwarm?: pulumi.Input; /** * Hard memory limit, for example `512m`. */ memoryLimit?: pulumi.Input; /** * Soft memory reservation, for example `256m`. */ memoryReservation?: pulumi.Input; /** * Docker Swarm service mode, as a JSON object. */ modeSwarm?: pulumi.Input; /** * Display name of the database. */ name?: pulumi.Input; /** * IDs of additional Docker networks to attach. */ networkIds?: pulumi.Input[]>; /** * Docker Swarm network attachments, as a JSON array. */ networkSwarm?: pulumi.Input; /** * Docker Swarm placement constraints, as a JSON object. */ placementSwarm?: pulumi.Input; /** * Start the instance as a single-node replica set. */ replicaSets?: pulumi.Input; /** * Number of replicas to run. */ replicas?: pulumi.Input; /** * Docker Swarm restart policy, as a JSON object. */ restartPolicySwarm?: pulumi.Input; /** * Docker Swarm rollback configuration, as a JSON object. */ rollbackConfigSwarm?: pulumi.Input; /** * Remote server to deploy on. Omit to use the Dokploy host itself. */ serverId?: pulumi.Input; /** * Grace period in nanoseconds before a container is killed. */ stopGracePeriodSwarm?: pulumi.Input; /** * Docker Swarm ulimits, as a JSON object. */ ulimitsSwarm?: pulumi.Input; /** * Docker Swarm rolling update configuration, as a JSON object. */ updateConfigSwarm?: pulumi.Input; } /** * The set of arguments for constructing a Mongo resource. */ export interface MongoArgs { /** * Unique Docker service name. Generated by Dokploy when omitted. Changing it forces a new database. */ appName?: pulumi.Input; /** * Arguments appended to the container command. */ args?: pulumi.Input[]>; /** * Override the container entrypoint command. */ command?: pulumi.Input; /** * Hard CPU limit, for example `1`. */ cpuLimit?: pulumi.Input; /** * Soft CPU reservation, for example `0.5`. */ cpuReservation?: pulumi.Input; /** * Password for the root user. */ databasePassword: pulumi.Input; /** * Root username to create. */ databaseUser: pulumi.Input; /** * Free-form description. */ description?: pulumi.Input; /** * Detach the service from the shared `dokploy-network`. */ detachDokployNetwork?: pulumi.Input; /** * MongoDB image to run. Defaults to `mongo:8`. */ dockerImage?: pulumi.Input; /** * Docker Swarm endpoint specification, as a JSON object. */ endpointSpecSwarm?: pulumi.Input; /** * Environment variables in `KEY=value` format, one per line. */ env?: pulumi.Input; /** * Environment this database belongs to. */ environmentId: pulumi.Input; /** * Host port to expose the database on. Leave unset to keep the database reachable only from inside the Docker network. */ externalPort?: pulumi.Input; /** * Docker Swarm health check configuration, as a JSON object. */ healthCheckSwarm?: pulumi.Input; /** * Docker Swarm service labels, as a JSON object. */ labelsSwarm?: pulumi.Input; /** * Hard memory limit, for example `512m`. */ memoryLimit?: pulumi.Input; /** * Soft memory reservation, for example `256m`. */ memoryReservation?: pulumi.Input; /** * Docker Swarm service mode, as a JSON object. */ modeSwarm?: pulumi.Input; /** * Display name of the database. */ name?: pulumi.Input; /** * IDs of additional Docker networks to attach. */ networkIds?: pulumi.Input[]>; /** * Docker Swarm network attachments, as a JSON array. */ networkSwarm?: pulumi.Input; /** * Docker Swarm placement constraints, as a JSON object. */ placementSwarm?: pulumi.Input; /** * Start the instance as a single-node replica set. */ replicaSets?: pulumi.Input; /** * Number of replicas to run. */ replicas?: pulumi.Input; /** * Docker Swarm restart policy, as a JSON object. */ restartPolicySwarm?: pulumi.Input; /** * Docker Swarm rollback configuration, as a JSON object. */ rollbackConfigSwarm?: pulumi.Input; /** * Remote server to deploy on. Omit to use the Dokploy host itself. */ serverId?: pulumi.Input; /** * Grace period in nanoseconds before a container is killed. */ stopGracePeriodSwarm?: pulumi.Input; /** * Docker Swarm ulimits, as a JSON object. */ ulimitsSwarm?: pulumi.Input; /** * Docker Swarm rolling update configuration, as a JSON object. */ updateConfigSwarm?: pulumi.Input; }