// *** 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"; /** * A scheduled backup of a Docker volume to a configured `dokploy.Destination`. * * This is the counterpart to a `dokploy.Mount` with `type = "volume"`: the mount gives the volume a stable name, and this resource copies its contents off the host on a schedule. * * Set exactly one of the `*_id` attributes to say which service owns the volume. */ export class VolumeBackup extends pulumi.CustomResource { /** * Get an existing VolumeBackup 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?: VolumeBackupState, opts?: pulumi.CustomResourceOptions): VolumeBackup { return new VolumeBackup(name, state, { ...opts, id: id }); } /** @internal */ public static readonly __pulumiType = 'dokploy:index/volumeBackup:VolumeBackup'; /** * Returns true if the given object is an instance of VolumeBackup. 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 VolumeBackup { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === VolumeBackup.__pulumiType; } /** * Docker service name that owns the volume. Derived by Dokploy when omitted. */ declare public readonly appName: pulumi.Output; /** * Application that owns the volume. */ declare public readonly applicationId: pulumi.Output; /** * Compose stack that owns the volume. */ declare public readonly composeId: pulumi.Output; /** * RFC 3339 timestamp of when the backup job was created. */ declare public /*out*/ readonly createdAt: pulumi.Output; /** * Standard five-field cron expression, for example `0 4 * * *`. */ declare public readonly cronExpression: pulumi.Output; /** * Backup destination (S3-compatible bucket) to upload to. */ declare public readonly destinationId: pulumi.Output; /** * Whether the backup schedule is active. */ declare public readonly enabled: pulumi.Output; /** * Number of backups to retain. Older ones are pruned. */ declare public readonly keepLatestCount: pulumi.Output; /** * libSQL instance that owns the volume. */ declare public readonly libsqlId: pulumi.Output; /** * MariaDB instance that owns the volume. */ declare public readonly mariadbId: pulumi.Output; /** * MongoDB instance that owns the volume. */ declare public readonly mongoId: pulumi.Output; /** * MySQL instance that owns the volume. */ declare public readonly mysqlId: pulumi.Output; /** * Display name of the backup job. */ declare public readonly name: pulumi.Output; /** * PostgreSQL instance that owns the volume. */ declare public readonly postgresId: pulumi.Output; /** * Path prefix inside the destination bucket, for example `backups/shop/`. */ declare public readonly prefix: pulumi.Output; /** * Redis instance that owns the volume. */ declare public readonly redisId: pulumi.Output; /** * Service inside a Compose stack that owns the volume. */ declare public readonly serviceName: pulumi.Output; /** * The kind of service that owns the volume. Valid values: `application`, `postgres`, `mysql`, `mariadb`, `mongo`, `redis`, `compose`, `libsql`. Defaults to `application`. */ declare public readonly serviceType: pulumi.Output; /** * Stop the service while the backup runs. Slower, but guarantees a consistent copy of data that is being written to. */ declare public readonly turnOff: pulumi.Output; /** * Name of the Docker volume to back up. */ declare public readonly volumeName: pulumi.Output; /** * Create a VolumeBackup 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: VolumeBackupArgs, opts?: pulumi.CustomResourceOptions) constructor(name: string, argsOrState?: VolumeBackupArgs | VolumeBackupState, opts?: pulumi.CustomResourceOptions) { let resourceInputs: pulumi.Inputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState as VolumeBackupState | undefined; resourceInputs["appName"] = state?.appName; resourceInputs["applicationId"] = state?.applicationId; resourceInputs["composeId"] = state?.composeId; resourceInputs["createdAt"] = state?.createdAt; resourceInputs["cronExpression"] = state?.cronExpression; resourceInputs["destinationId"] = state?.destinationId; resourceInputs["enabled"] = state?.enabled; resourceInputs["keepLatestCount"] = state?.keepLatestCount; resourceInputs["libsqlId"] = state?.libsqlId; resourceInputs["mariadbId"] = state?.mariadbId; resourceInputs["mongoId"] = state?.mongoId; resourceInputs["mysqlId"] = state?.mysqlId; resourceInputs["name"] = state?.name; resourceInputs["postgresId"] = state?.postgresId; resourceInputs["prefix"] = state?.prefix; resourceInputs["redisId"] = state?.redisId; resourceInputs["serviceName"] = state?.serviceName; resourceInputs["serviceType"] = state?.serviceType; resourceInputs["turnOff"] = state?.turnOff; resourceInputs["volumeName"] = state?.volumeName; } else { const args = argsOrState as VolumeBackupArgs | undefined; if (args?.cronExpression === undefined && !opts.urn) { throw new Error("Missing required property 'cronExpression'"); } if (args?.destinationId === undefined && !opts.urn) { throw new Error("Missing required property 'destinationId'"); } if (args?.prefix === undefined && !opts.urn) { throw new Error("Missing required property 'prefix'"); } if (args?.volumeName === undefined && !opts.urn) { throw new Error("Missing required property 'volumeName'"); } resourceInputs["appName"] = args?.appName; resourceInputs["applicationId"] = args?.applicationId; resourceInputs["composeId"] = args?.composeId; resourceInputs["cronExpression"] = args?.cronExpression; resourceInputs["destinationId"] = args?.destinationId; resourceInputs["enabled"] = args?.enabled; resourceInputs["keepLatestCount"] = args?.keepLatestCount; resourceInputs["libsqlId"] = args?.libsqlId; resourceInputs["mariadbId"] = args?.mariadbId; resourceInputs["mongoId"] = args?.mongoId; resourceInputs["mysqlId"] = args?.mysqlId; resourceInputs["name"] = args?.name; resourceInputs["postgresId"] = args?.postgresId; resourceInputs["prefix"] = args?.prefix; resourceInputs["redisId"] = args?.redisId; resourceInputs["serviceName"] = args?.serviceName; resourceInputs["serviceType"] = args?.serviceType; resourceInputs["turnOff"] = args?.turnOff; resourceInputs["volumeName"] = args?.volumeName; resourceInputs["createdAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(VolumeBackup.__pulumiType, name, resourceInputs, opts); } } /** * Input properties used for looking up and filtering VolumeBackup resources. */ export interface VolumeBackupState { /** * Docker service name that owns the volume. Derived by Dokploy when omitted. */ appName?: pulumi.Input; /** * Application that owns the volume. */ applicationId?: pulumi.Input; /** * Compose stack that owns the volume. */ composeId?: pulumi.Input; /** * RFC 3339 timestamp of when the backup job was created. */ createdAt?: pulumi.Input; /** * Standard five-field cron expression, for example `0 4 * * *`. */ cronExpression?: pulumi.Input; /** * Backup destination (S3-compatible bucket) to upload to. */ destinationId?: pulumi.Input; /** * Whether the backup schedule is active. */ enabled?: pulumi.Input; /** * Number of backups to retain. Older ones are pruned. */ keepLatestCount?: pulumi.Input; /** * libSQL instance that owns the volume. */ libsqlId?: pulumi.Input; /** * MariaDB instance that owns the volume. */ mariadbId?: pulumi.Input; /** * MongoDB instance that owns the volume. */ mongoId?: pulumi.Input; /** * MySQL instance that owns the volume. */ mysqlId?: pulumi.Input; /** * Display name of the backup job. */ name?: pulumi.Input; /** * PostgreSQL instance that owns the volume. */ postgresId?: pulumi.Input; /** * Path prefix inside the destination bucket, for example `backups/shop/`. */ prefix?: pulumi.Input; /** * Redis instance that owns the volume. */ redisId?: pulumi.Input; /** * Service inside a Compose stack that owns the volume. */ serviceName?: pulumi.Input; /** * The kind of service that owns the volume. Valid values: `application`, `postgres`, `mysql`, `mariadb`, `mongo`, `redis`, `compose`, `libsql`. Defaults to `application`. */ serviceType?: pulumi.Input; /** * Stop the service while the backup runs. Slower, but guarantees a consistent copy of data that is being written to. */ turnOff?: pulumi.Input; /** * Name of the Docker volume to back up. */ volumeName?: pulumi.Input; } /** * The set of arguments for constructing a VolumeBackup resource. */ export interface VolumeBackupArgs { /** * Docker service name that owns the volume. Derived by Dokploy when omitted. */ appName?: pulumi.Input; /** * Application that owns the volume. */ applicationId?: pulumi.Input; /** * Compose stack that owns the volume. */ composeId?: pulumi.Input; /** * Standard five-field cron expression, for example `0 4 * * *`. */ cronExpression: pulumi.Input; /** * Backup destination (S3-compatible bucket) to upload to. */ destinationId: pulumi.Input; /** * Whether the backup schedule is active. */ enabled?: pulumi.Input; /** * Number of backups to retain. Older ones are pruned. */ keepLatestCount?: pulumi.Input; /** * libSQL instance that owns the volume. */ libsqlId?: pulumi.Input; /** * MariaDB instance that owns the volume. */ mariadbId?: pulumi.Input; /** * MongoDB instance that owns the volume. */ mongoId?: pulumi.Input; /** * MySQL instance that owns the volume. */ mysqlId?: pulumi.Input; /** * Display name of the backup job. */ name?: pulumi.Input; /** * PostgreSQL instance that owns the volume. */ postgresId?: pulumi.Input; /** * Path prefix inside the destination bucket, for example `backups/shop/`. */ prefix: pulumi.Input; /** * Redis instance that owns the volume. */ redisId?: pulumi.Input; /** * Service inside a Compose stack that owns the volume. */ serviceName?: pulumi.Input; /** * The kind of service that owns the volume. Valid values: `application`, `postgres`, `mysql`, `mariadb`, `mongo`, `redis`, `compose`, `libsql`. Defaults to `application`. */ serviceType?: pulumi.Input; /** * Stop the service while the backup runs. Slower, but guarantees a consistent copy of data that is being written to. */ turnOff?: pulumi.Input; /** * Name of the Docker volume to back up. */ volumeName: pulumi.Input; }