Files
pulumi-dokploy/sdk/nodejs/libsql.ts
T
max-voitcov 73386ba0ff
build / build (push) Failing after 11m22s
release / plugin (push) Failing after 31m35s
release / sdks (push) Has been skipped
Bridge what Dokploy v0.30 added, and let the docs through
Six new resources from terraform-provider-dokploy v0.2.0 -- Network,
DnsProvider, VaultProvider, Schedule, VolumeBackup and Libsql -- plus the new
properties on Domain (`enabled`), Compose (`serviceNetworks`, `createEnvFile`,
`icon`) and Application. Verified with `pulumi up` against a live v0.30.2
instance: create, preview-clean, and destroy.

The upstream provider also now refuses a volume Mount with no `volumeName`,
which Dokploy would otherwise turn into an anonymous Docker volume recreated
on every deploy. That surfaces here at preview time, before anything exists.

Two things made that fix nearly invisible to Pulumi users, so this commit
fixes the second one: the bridge resolves the upstream `docs/` through the Go
module cache, where a locally `replace`d dependency never lands, so tfgen was
emitting every resource with no description at all. UpstreamRepoPath now
points at the checkout and all 445 inputs carry documentation -- with names
rendered per language, so Python readers see `volume_name` where TypeScript
readers see `volumeName`.
2026-08-26 00:46:32 +03:00

573 lines
22 KiB
TypeScript
Generated

// *** 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 managed libSQL instance running on Dokploy.
*
* > Creating this resource provisions the service definition but does **not** start a deployment. Deploy it from the Dokploy UI or CLI.
*
* > Credentials are stored in Terraform state. Use a state backend with encryption at rest.
*
* libSQL runs as a `sqld` server. A `primary` node owns the data; a `replica` node follows a primary named by `sqldPrimaryUrl`.
*/
export class Libsql extends pulumi.CustomResource {
/**
* Get an existing Libsql 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<pulumi.ID>, state?: LibsqlState, opts?: pulumi.CustomResourceOptions): Libsql {
return new Libsql(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'dokploy:index/libsql:Libsql';
/**
* Returns true if the given object is an instance of Libsql. 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 Libsql {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Libsql.__pulumiType;
}
/**
* Unique Docker service name. Generated from `name` when omitted, because Dokploy's libSQL endpoint does not generate one. Changing it forces a new database.
*/
declare public readonly appName: pulumi.Output<string>;
/**
* Current status reported by Dokploy: `idle`, `running`, `done` or `error`.
*/
declare public /*out*/ readonly applicationStatus: pulumi.Output<string>;
/**
* Override the container entrypoint command.
*/
declare public readonly command: pulumi.Output<string | undefined>;
/**
* Hard CPU limit, for example `1`.
*/
declare public readonly cpuLimit: pulumi.Output<string | undefined>;
/**
* Soft CPU reservation, for example `0.5`.
*/
declare public readonly cpuReservation: pulumi.Output<string | undefined>;
/**
* RFC 3339 timestamp of when the database was created.
*/
declare public /*out*/ readonly createdAt: pulumi.Output<string>;
/**
* Password for the database user.
*/
declare public readonly databasePassword: pulumi.Output<string>;
/**
* Database user to create.
*/
declare public readonly databaseUser: pulumi.Output<string>;
/**
* Free-form description.
*/
declare public readonly description: pulumi.Output<string | undefined>;
/**
* Detach the service from the shared `dokploy-network`.
*/
declare public readonly detachDokployNetwork: pulumi.Output<boolean>;
/**
* libSQL server image to run, for example `ghcr.io/tursodatabase/libsql-server:latest`.
*/
declare public readonly dockerImage: pulumi.Output<string>;
/**
* Serve multiple logical databases from one instance through libSQL namespaces.
*/
declare public readonly enableNamespaces: pulumi.Output<boolean>;
/**
* Docker Swarm endpoint specification, as a JSON object.
*/
declare public readonly endpointSpecSwarm: pulumi.Output<string | undefined>;
/**
* Environment variables in `KEY=value` format, one per line.
*/
declare public readonly env: pulumi.Output<string | undefined>;
/**
* Environment this database belongs to.
*/
declare public readonly environmentId: pulumi.Output<string>;
/**
* Host port exposing the admin API.
*/
declare public readonly externalAdminPort: pulumi.Output<number | undefined>;
/**
* Host port exposing the gRPC replication endpoint.
*/
declare public readonly externalGrpcPort: pulumi.Output<number | undefined>;
/**
* Host port exposing the HTTP API.
*/
declare public readonly externalPort: pulumi.Output<number | undefined>;
/**
* Docker Swarm health check configuration, as a JSON object.
*/
declare public readonly healthCheckSwarm: pulumi.Output<string | undefined>;
/**
* Docker Swarm service labels, as a JSON object.
*/
declare public readonly labelsSwarm: pulumi.Output<string | undefined>;
/**
* Hard memory limit, for example `512m`.
*/
declare public readonly memoryLimit: pulumi.Output<string | undefined>;
/**
* Soft memory reservation, for example `256m`.
*/
declare public readonly memoryReservation: pulumi.Output<string | undefined>;
/**
* Docker Swarm service mode, as a JSON object.
*/
declare public readonly modeSwarm: pulumi.Output<string | undefined>;
/**
* Display name of the database.
*/
declare public readonly name: pulumi.Output<string>;
/**
* IDs of additional Docker networks to attach.
*/
declare public readonly networkIds: pulumi.Output<string[]>;
/**
* Docker Swarm network attachments, as a JSON array.
*/
declare public readonly networkSwarm: pulumi.Output<string | undefined>;
/**
* Docker Swarm placement constraints, as a JSON object.
*/
declare public readonly placementSwarm: pulumi.Output<string | undefined>;
/**
* Number of replicas to run.
*/
declare public readonly replicas: pulumi.Output<number>;
/**
* Docker Swarm restart policy, as a JSON object.
*/
declare public readonly restartPolicySwarm: pulumi.Output<string | undefined>;
/**
* Docker Swarm rollback configuration, as a JSON object.
*/
declare public readonly rollbackConfigSwarm: pulumi.Output<string | undefined>;
/**
* Remote server to deploy on. Omit to use the Dokploy host itself.
*/
declare public readonly serverId: pulumi.Output<string | undefined>;
/**
* Role this node plays in a libSQL cluster. Valid values: `primary`, `replica`. Defaults to `primary`.
*/
declare public readonly sqldNode: pulumi.Output<string>;
/**
* URL of the primary node, when `sqldNode` is `replica`.
*/
declare public readonly sqldPrimaryUrl: pulumi.Output<string | undefined>;
/**
* Grace period in nanoseconds before a container is killed.
*/
declare public readonly stopGracePeriodSwarm: pulumi.Output<number | undefined>;
/**
* Docker Swarm rolling update configuration, as a JSON object.
*/
declare public readonly updateConfigSwarm: pulumi.Output<string | undefined>;
/**
* Create a Libsql 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: LibsqlArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: LibsqlArgs | LibsqlState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as LibsqlState | undefined;
resourceInputs["appName"] = state?.appName;
resourceInputs["applicationStatus"] = state?.applicationStatus;
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["enableNamespaces"] = state?.enableNamespaces;
resourceInputs["endpointSpecSwarm"] = state?.endpointSpecSwarm;
resourceInputs["env"] = state?.env;
resourceInputs["environmentId"] = state?.environmentId;
resourceInputs["externalAdminPort"] = state?.externalAdminPort;
resourceInputs["externalGrpcPort"] = state?.externalGrpcPort;
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["replicas"] = state?.replicas;
resourceInputs["restartPolicySwarm"] = state?.restartPolicySwarm;
resourceInputs["rollbackConfigSwarm"] = state?.rollbackConfigSwarm;
resourceInputs["serverId"] = state?.serverId;
resourceInputs["sqldNode"] = state?.sqldNode;
resourceInputs["sqldPrimaryUrl"] = state?.sqldPrimaryUrl;
resourceInputs["stopGracePeriodSwarm"] = state?.stopGracePeriodSwarm;
resourceInputs["updateConfigSwarm"] = state?.updateConfigSwarm;
} else {
const args = argsOrState as LibsqlArgs | 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?.dockerImage === undefined && !opts.urn) {
throw new Error("Missing required property 'dockerImage'");
}
if (args?.environmentId === undefined && !opts.urn) {
throw new Error("Missing required property 'environmentId'");
}
resourceInputs["appName"] = args?.appName;
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["enableNamespaces"] = args?.enableNamespaces;
resourceInputs["endpointSpecSwarm"] = args?.endpointSpecSwarm;
resourceInputs["env"] = args?.env;
resourceInputs["environmentId"] = args?.environmentId;
resourceInputs["externalAdminPort"] = args?.externalAdminPort;
resourceInputs["externalGrpcPort"] = args?.externalGrpcPort;
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["replicas"] = args?.replicas;
resourceInputs["restartPolicySwarm"] = args?.restartPolicySwarm;
resourceInputs["rollbackConfigSwarm"] = args?.rollbackConfigSwarm;
resourceInputs["serverId"] = args?.serverId;
resourceInputs["sqldNode"] = args?.sqldNode;
resourceInputs["sqldPrimaryUrl"] = args?.sqldPrimaryUrl;
resourceInputs["stopGracePeriodSwarm"] = args?.stopGracePeriodSwarm;
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(Libsql.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering Libsql resources.
*/
export interface LibsqlState {
/**
* Unique Docker service name. Generated from `name` when omitted, because Dokploy's libSQL endpoint does not generate one. Changing it forces a new database.
*/
appName?: pulumi.Input<string | undefined>;
/**
* Current status reported by Dokploy: `idle`, `running`, `done` or `error`.
*/
applicationStatus?: pulumi.Input<string | undefined>;
/**
* Override the container entrypoint command.
*/
command?: pulumi.Input<string | undefined>;
/**
* Hard CPU limit, for example `1`.
*/
cpuLimit?: pulumi.Input<string | undefined>;
/**
* Soft CPU reservation, for example `0.5`.
*/
cpuReservation?: pulumi.Input<string | undefined>;
/**
* RFC 3339 timestamp of when the database was created.
*/
createdAt?: pulumi.Input<string | undefined>;
/**
* Password for the database user.
*/
databasePassword?: pulumi.Input<string | undefined>;
/**
* Database user to create.
*/
databaseUser?: pulumi.Input<string | undefined>;
/**
* Free-form description.
*/
description?: pulumi.Input<string | undefined>;
/**
* Detach the service from the shared `dokploy-network`.
*/
detachDokployNetwork?: pulumi.Input<boolean | undefined>;
/**
* libSQL server image to run, for example `ghcr.io/tursodatabase/libsql-server:latest`.
*/
dockerImage?: pulumi.Input<string | undefined>;
/**
* Serve multiple logical databases from one instance through libSQL namespaces.
*/
enableNamespaces?: pulumi.Input<boolean | undefined>;
/**
* Docker Swarm endpoint specification, as a JSON object.
*/
endpointSpecSwarm?: pulumi.Input<string | undefined>;
/**
* Environment variables in `KEY=value` format, one per line.
*/
env?: pulumi.Input<string | undefined>;
/**
* Environment this database belongs to.
*/
environmentId?: pulumi.Input<string | undefined>;
/**
* Host port exposing the admin API.
*/
externalAdminPort?: pulumi.Input<number | undefined>;
/**
* Host port exposing the gRPC replication endpoint.
*/
externalGrpcPort?: pulumi.Input<number | undefined>;
/**
* Host port exposing the HTTP API.
*/
externalPort?: pulumi.Input<number | undefined>;
/**
* Docker Swarm health check configuration, as a JSON object.
*/
healthCheckSwarm?: pulumi.Input<string | undefined>;
/**
* Docker Swarm service labels, as a JSON object.
*/
labelsSwarm?: pulumi.Input<string | undefined>;
/**
* Hard memory limit, for example `512m`.
*/
memoryLimit?: pulumi.Input<string | undefined>;
/**
* Soft memory reservation, for example `256m`.
*/
memoryReservation?: pulumi.Input<string | undefined>;
/**
* Docker Swarm service mode, as a JSON object.
*/
modeSwarm?: pulumi.Input<string | undefined>;
/**
* Display name of the database.
*/
name?: pulumi.Input<string | undefined>;
/**
* IDs of additional Docker networks to attach.
*/
networkIds?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* Docker Swarm network attachments, as a JSON array.
*/
networkSwarm?: pulumi.Input<string | undefined>;
/**
* Docker Swarm placement constraints, as a JSON object.
*/
placementSwarm?: pulumi.Input<string | undefined>;
/**
* Number of replicas to run.
*/
replicas?: pulumi.Input<number | undefined>;
/**
* Docker Swarm restart policy, as a JSON object.
*/
restartPolicySwarm?: pulumi.Input<string | undefined>;
/**
* Docker Swarm rollback configuration, as a JSON object.
*/
rollbackConfigSwarm?: pulumi.Input<string | undefined>;
/**
* Remote server to deploy on. Omit to use the Dokploy host itself.
*/
serverId?: pulumi.Input<string | undefined>;
/**
* Role this node plays in a libSQL cluster. Valid values: `primary`, `replica`. Defaults to `primary`.
*/
sqldNode?: pulumi.Input<string | undefined>;
/**
* URL of the primary node, when `sqldNode` is `replica`.
*/
sqldPrimaryUrl?: pulumi.Input<string | undefined>;
/**
* Grace period in nanoseconds before a container is killed.
*/
stopGracePeriodSwarm?: pulumi.Input<number | undefined>;
/**
* Docker Swarm rolling update configuration, as a JSON object.
*/
updateConfigSwarm?: pulumi.Input<string | undefined>;
}
/**
* The set of arguments for constructing a Libsql resource.
*/
export interface LibsqlArgs {
/**
* Unique Docker service name. Generated from `name` when omitted, because Dokploy's libSQL endpoint does not generate one. Changing it forces a new database.
*/
appName?: pulumi.Input<string | undefined>;
/**
* Override the container entrypoint command.
*/
command?: pulumi.Input<string | undefined>;
/**
* Hard CPU limit, for example `1`.
*/
cpuLimit?: pulumi.Input<string | undefined>;
/**
* Soft CPU reservation, for example `0.5`.
*/
cpuReservation?: pulumi.Input<string | undefined>;
/**
* Password for the database user.
*/
databasePassword: pulumi.Input<string>;
/**
* Database user to create.
*/
databaseUser: pulumi.Input<string>;
/**
* Free-form description.
*/
description?: pulumi.Input<string | undefined>;
/**
* Detach the service from the shared `dokploy-network`.
*/
detachDokployNetwork?: pulumi.Input<boolean | undefined>;
/**
* libSQL server image to run, for example `ghcr.io/tursodatabase/libsql-server:latest`.
*/
dockerImage: pulumi.Input<string>;
/**
* Serve multiple logical databases from one instance through libSQL namespaces.
*/
enableNamespaces?: pulumi.Input<boolean | undefined>;
/**
* Docker Swarm endpoint specification, as a JSON object.
*/
endpointSpecSwarm?: pulumi.Input<string | undefined>;
/**
* Environment variables in `KEY=value` format, one per line.
*/
env?: pulumi.Input<string | undefined>;
/**
* Environment this database belongs to.
*/
environmentId: pulumi.Input<string>;
/**
* Host port exposing the admin API.
*/
externalAdminPort?: pulumi.Input<number | undefined>;
/**
* Host port exposing the gRPC replication endpoint.
*/
externalGrpcPort?: pulumi.Input<number | undefined>;
/**
* Host port exposing the HTTP API.
*/
externalPort?: pulumi.Input<number | undefined>;
/**
* Docker Swarm health check configuration, as a JSON object.
*/
healthCheckSwarm?: pulumi.Input<string | undefined>;
/**
* Docker Swarm service labels, as a JSON object.
*/
labelsSwarm?: pulumi.Input<string | undefined>;
/**
* Hard memory limit, for example `512m`.
*/
memoryLimit?: pulumi.Input<string | undefined>;
/**
* Soft memory reservation, for example `256m`.
*/
memoryReservation?: pulumi.Input<string | undefined>;
/**
* Docker Swarm service mode, as a JSON object.
*/
modeSwarm?: pulumi.Input<string | undefined>;
/**
* Display name of the database.
*/
name?: pulumi.Input<string | undefined>;
/**
* IDs of additional Docker networks to attach.
*/
networkIds?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* Docker Swarm network attachments, as a JSON array.
*/
networkSwarm?: pulumi.Input<string | undefined>;
/**
* Docker Swarm placement constraints, as a JSON object.
*/
placementSwarm?: pulumi.Input<string | undefined>;
/**
* Number of replicas to run.
*/
replicas?: pulumi.Input<number | undefined>;
/**
* Docker Swarm restart policy, as a JSON object.
*/
restartPolicySwarm?: pulumi.Input<string | undefined>;
/**
* Docker Swarm rollback configuration, as a JSON object.
*/
rollbackConfigSwarm?: pulumi.Input<string | undefined>;
/**
* Remote server to deploy on. Omit to use the Dokploy host itself.
*/
serverId?: pulumi.Input<string | undefined>;
/**
* Role this node plays in a libSQL cluster. Valid values: `primary`, `replica`. Defaults to `primary`.
*/
sqldNode?: pulumi.Input<string | undefined>;
/**
* URL of the primary node, when `sqldNode` is `replica`.
*/
sqldPrimaryUrl?: pulumi.Input<string | undefined>;
/**
* Grace period in nanoseconds before a container is killed.
*/
stopGracePeriodSwarm?: pulumi.Input<number | undefined>;
/**
* Docker Swarm rolling update configuration, as a JSON object.
*/
updateConfigSwarm?: pulumi.Input<string | undefined>;
}