Files
pulumi-dokploy/sdk/go/dokploy/mount.go
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

340 lines
13 KiB
Go
Generated

// Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package dokploy
import (
"context"
"reflect"
"errors"
"github.com/maxvojtkov/pulumi-dokploy/sdk/go/dokploy/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// A volume, bind mount, or config file attached to a Dokploy service.
//
// * `type = "volume"` — a named Docker volume; set `volumeName`.
// * `type = "bind"` — a path on the host; set `hostPath`.
// * `type = "file"` — a file rendered from `content`; set `filePath`.
//
// > **A `volume` mount must set `volumeName`.** Dokploy hands an unset name to Docker as an empty source, which creates a fresh anonymous volume on every deploy and orphans the previous one — the data never survives a redeploy. The provider rejects that combination at plan time.
type Mount struct {
pulumi.CustomResourceState
// Contents of the generated file, when `type` is `file`.
Content pulumi.StringPtrOutput `pulumi:"content"`
// Path of the generated file, when `type` is `file`.
FilePath pulumi.StringPtrOutput `pulumi:"filePath"`
// Path on the host, when `type` is `bind`.
HostPath pulumi.StringPtrOutput `pulumi:"hostPath"`
// Path inside the container where the mount appears.
MountPath pulumi.StringOutput `pulumi:"mountPath"`
// ID of the service this mount attaches to. Must match `serviceType` — an application ID, a compose ID, a postgres ID, and so on.
ServiceId pulumi.StringOutput `pulumi:"serviceId"`
// The kind of service this mount attaches to. Valid values: `application`, `postgres`, `mysql`, `mariadb`, `mongo`, `redis`, `compose`, `libsql`.
ServiceType pulumi.StringOutput `pulumi:"serviceType"`
// The kind of mount to create. Valid values: `bind`, `volume`, `file`.
Type pulumi.StringOutput `pulumi:"type"`
// Name of the Docker volume, when `type` is `volume`.
VolumeName pulumi.StringPtrOutput `pulumi:"volumeName"`
}
// NewMount registers a new resource with the given unique name, arguments, and options.
func NewMount(ctx *pulumi.Context,
name string, args *MountArgs, opts ...pulumi.ResourceOption) (*Mount, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.MountPath == nil {
return nil, errors.New("invalid value for required argument 'MountPath'")
}
if args.ServiceId == nil {
return nil, errors.New("invalid value for required argument 'ServiceId'")
}
if args.ServiceType == nil {
return nil, errors.New("invalid value for required argument 'ServiceType'")
}
if args.Type == nil {
return nil, errors.New("invalid value for required argument 'Type'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Mount
err := ctx.RegisterResource("dokploy:index/mount:Mount", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetMount gets an existing Mount resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetMount(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *MountState, opts ...pulumi.ResourceOption) (*Mount, error) {
var resource Mount
err := ctx.ReadResource("dokploy:index/mount:Mount", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Mount resources.
type mountState struct {
// Contents of the generated file, when `type` is `file`.
Content *string `pulumi:"content"`
// Path of the generated file, when `type` is `file`.
FilePath *string `pulumi:"filePath"`
// Path on the host, when `type` is `bind`.
HostPath *string `pulumi:"hostPath"`
// Path inside the container where the mount appears.
MountPath *string `pulumi:"mountPath"`
// ID of the service this mount attaches to. Must match `serviceType` — an application ID, a compose ID, a postgres ID, and so on.
ServiceId *string `pulumi:"serviceId"`
// The kind of service this mount attaches to. Valid values: `application`, `postgres`, `mysql`, `mariadb`, `mongo`, `redis`, `compose`, `libsql`.
ServiceType *string `pulumi:"serviceType"`
// The kind of mount to create. Valid values: `bind`, `volume`, `file`.
Type *string `pulumi:"type"`
// Name of the Docker volume, when `type` is `volume`.
VolumeName *string `pulumi:"volumeName"`
}
type MountState struct {
// Contents of the generated file, when `type` is `file`.
Content pulumi.StringPtrInput
// Path of the generated file, when `type` is `file`.
FilePath pulumi.StringPtrInput
// Path on the host, when `type` is `bind`.
HostPath pulumi.StringPtrInput
// Path inside the container where the mount appears.
MountPath pulumi.StringPtrInput
// ID of the service this mount attaches to. Must match `serviceType` — an application ID, a compose ID, a postgres ID, and so on.
ServiceId pulumi.StringPtrInput
// The kind of service this mount attaches to. Valid values: `application`, `postgres`, `mysql`, `mariadb`, `mongo`, `redis`, `compose`, `libsql`.
ServiceType pulumi.StringPtrInput
// The kind of mount to create. Valid values: `bind`, `volume`, `file`.
Type pulumi.StringPtrInput
// Name of the Docker volume, when `type` is `volume`.
VolumeName pulumi.StringPtrInput
}
func (MountState) ElementType() reflect.Type {
return reflect.TypeOf((*mountState)(nil)).Elem()
}
type mountArgs struct {
// Contents of the generated file, when `type` is `file`.
Content *string `pulumi:"content"`
// Path of the generated file, when `type` is `file`.
FilePath *string `pulumi:"filePath"`
// Path on the host, when `type` is `bind`.
HostPath *string `pulumi:"hostPath"`
// Path inside the container where the mount appears.
MountPath string `pulumi:"mountPath"`
// ID of the service this mount attaches to. Must match `serviceType` — an application ID, a compose ID, a postgres ID, and so on.
ServiceId string `pulumi:"serviceId"`
// The kind of service this mount attaches to. Valid values: `application`, `postgres`, `mysql`, `mariadb`, `mongo`, `redis`, `compose`, `libsql`.
ServiceType string `pulumi:"serviceType"`
// The kind of mount to create. Valid values: `bind`, `volume`, `file`.
Type string `pulumi:"type"`
// Name of the Docker volume, when `type` is `volume`.
VolumeName *string `pulumi:"volumeName"`
}
// The set of arguments for constructing a Mount resource.
type MountArgs struct {
// Contents of the generated file, when `type` is `file`.
Content pulumi.StringPtrInput
// Path of the generated file, when `type` is `file`.
FilePath pulumi.StringPtrInput
// Path on the host, when `type` is `bind`.
HostPath pulumi.StringPtrInput
// Path inside the container where the mount appears.
MountPath pulumi.StringInput
// ID of the service this mount attaches to. Must match `serviceType` — an application ID, a compose ID, a postgres ID, and so on.
ServiceId pulumi.StringInput
// The kind of service this mount attaches to. Valid values: `application`, `postgres`, `mysql`, `mariadb`, `mongo`, `redis`, `compose`, `libsql`.
ServiceType pulumi.StringInput
// The kind of mount to create. Valid values: `bind`, `volume`, `file`.
Type pulumi.StringInput
// Name of the Docker volume, when `type` is `volume`.
VolumeName pulumi.StringPtrInput
}
func (MountArgs) ElementType() reflect.Type {
return reflect.TypeOf((*mountArgs)(nil)).Elem()
}
type MountInput interface {
pulumi.Input
ToMountOutput() MountOutput
ToMountOutputWithContext(ctx context.Context) MountOutput
}
func (*Mount) ElementType() reflect.Type {
return reflect.TypeOf((**Mount)(nil)).Elem()
}
func (i *Mount) ToMountOutput() MountOutput {
return i.ToMountOutputWithContext(context.Background())
}
func (i *Mount) ToMountOutputWithContext(ctx context.Context) MountOutput {
return pulumi.ToOutputWithContext(ctx, i).(MountOutput)
}
// MountArrayInput is an input type that accepts MountArray and MountArrayOutput values.
// You can construct a concrete instance of `MountArrayInput` via:
//
// MountArray{ MountArgs{...} }
type MountArrayInput interface {
pulumi.Input
ToMountArrayOutput() MountArrayOutput
ToMountArrayOutputWithContext(context.Context) MountArrayOutput
}
type MountArray []MountInput
func (MountArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Mount)(nil)).Elem()
}
func (i MountArray) ToMountArrayOutput() MountArrayOutput {
return i.ToMountArrayOutputWithContext(context.Background())
}
func (i MountArray) ToMountArrayOutputWithContext(ctx context.Context) MountArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(MountArrayOutput)
}
// MountMapInput is an input type that accepts MountMap and MountMapOutput values.
// You can construct a concrete instance of `MountMapInput` via:
//
// MountMap{ "key": MountArgs{...} }
type MountMapInput interface {
pulumi.Input
ToMountMapOutput() MountMapOutput
ToMountMapOutputWithContext(context.Context) MountMapOutput
}
type MountMap map[string]MountInput
func (MountMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Mount)(nil)).Elem()
}
func (i MountMap) ToMountMapOutput() MountMapOutput {
return i.ToMountMapOutputWithContext(context.Background())
}
func (i MountMap) ToMountMapOutputWithContext(ctx context.Context) MountMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(MountMapOutput)
}
type MountOutput struct{ *pulumi.OutputState }
func (MountOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Mount)(nil)).Elem()
}
func (o MountOutput) ToMountOutput() MountOutput {
return o
}
func (o MountOutput) ToMountOutputWithContext(ctx context.Context) MountOutput {
return o
}
// Contents of the generated file, when `type` is `file`.
func (o MountOutput) Content() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Mount) pulumi.StringPtrOutput { return v.Content }).(pulumi.StringPtrOutput)
}
// Path of the generated file, when `type` is `file`.
func (o MountOutput) FilePath() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Mount) pulumi.StringPtrOutput { return v.FilePath }).(pulumi.StringPtrOutput)
}
// Path on the host, when `type` is `bind`.
func (o MountOutput) HostPath() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Mount) pulumi.StringPtrOutput { return v.HostPath }).(pulumi.StringPtrOutput)
}
// Path inside the container where the mount appears.
func (o MountOutput) MountPath() pulumi.StringOutput {
return o.ApplyT(func(v *Mount) pulumi.StringOutput { return v.MountPath }).(pulumi.StringOutput)
}
// ID of the service this mount attaches to. Must match `serviceType` — an application ID, a compose ID, a postgres ID, and so on.
func (o MountOutput) ServiceId() pulumi.StringOutput {
return o.ApplyT(func(v *Mount) pulumi.StringOutput { return v.ServiceId }).(pulumi.StringOutput)
}
// The kind of service this mount attaches to. Valid values: `application`, `postgres`, `mysql`, `mariadb`, `mongo`, `redis`, `compose`, `libsql`.
func (o MountOutput) ServiceType() pulumi.StringOutput {
return o.ApplyT(func(v *Mount) pulumi.StringOutput { return v.ServiceType }).(pulumi.StringOutput)
}
// The kind of mount to create. Valid values: `bind`, `volume`, `file`.
func (o MountOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *Mount) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
// Name of the Docker volume, when `type` is `volume`.
func (o MountOutput) VolumeName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Mount) pulumi.StringPtrOutput { return v.VolumeName }).(pulumi.StringPtrOutput)
}
type MountArrayOutput struct{ *pulumi.OutputState }
func (MountArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Mount)(nil)).Elem()
}
func (o MountArrayOutput) ToMountArrayOutput() MountArrayOutput {
return o
}
func (o MountArrayOutput) ToMountArrayOutputWithContext(ctx context.Context) MountArrayOutput {
return o
}
func (o MountArrayOutput) Index(i pulumi.IntInput) MountOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Mount {
return vs[0].([]*Mount)[vs[1].(int)]
}).(MountOutput)
}
type MountMapOutput struct{ *pulumi.OutputState }
func (MountMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Mount)(nil)).Elem()
}
func (o MountMapOutput) ToMountMapOutput() MountMapOutput {
return o
}
func (o MountMapOutput) ToMountMapOutputWithContext(ctx context.Context) MountMapOutput {
return o
}
func (o MountMapOutput) MapIndex(k pulumi.StringInput) MountOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Mount {
return vs[0].(map[string]*Mount)[vs[1].(string)]
}).(MountOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*MountInput)(nil)).Elem(), &Mount{})
pulumi.RegisterInputType(reflect.TypeOf((*MountArrayInput)(nil)).Elem(), MountArray{})
pulumi.RegisterInputType(reflect.TypeOf((*MountMapInput)(nil)).Elem(), MountMap{})
pulumi.RegisterOutputType(MountOutput{})
pulumi.RegisterOutputType(MountArrayOutput{})
pulumi.RegisterOutputType(MountMapOutput{})
}