Files
pulumi-dokploy/sdk/go/dokploy/provider.go
Max Vojtkov bb3c15135b Bridge terraform-provider-dokploy into a Pulumi provider
18 resources and 5 data sources mapped into the dokploy:index module, with
SDKs generated for TypeScript, Python, Go and .NET.
2026-08-08 15:28:16 +03:00

163 lines
6.5 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"
"github.com/maxvojtkov/pulumi-dokploy/sdk/go/dokploy/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The provider type for the dokploy package. By default, resources use package-wide configuration
// settings, however an explicit `Provider` instance may be created and passed during resource
// construction to achieve fine-grained programmatic control over provider settings. See the
// [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.
type Provider struct {
pulumi.ProviderResourceState
// API token generated in Dokploy under *Settings > Profile > API/CLI*. May also be set with the `DOKPLOY_API_KEY` environment variable.
ApiKey pulumi.StringPtrOutput `pulumi:"apiKey"`
// Base URL of the Dokploy instance, for example `https://dokploy.example.com`. A trailing `/api` is optional. May also be set with the `DOKPLOY_HOST` environment variable.
Host pulumi.StringPtrOutput `pulumi:"host"`
}
// NewProvider registers a new resource with the given unique name, arguments, and options.
func NewProvider(ctx *pulumi.Context,
name string, args *ProviderArgs, opts ...pulumi.ResourceOption) (*Provider, error) {
if args == nil {
args = &ProviderArgs{}
}
if args.ApiKey == nil {
if d := internal.GetEnvOrDefault(nil, nil, "DOKPLOY_API_KEY"); d != nil {
args.ApiKey = pulumi.StringPtr(d.(string))
}
}
if args.Host == nil {
if d := internal.GetEnvOrDefault(nil, nil, "DOKPLOY_HOST"); d != nil {
args.Host = pulumi.StringPtr(d.(string))
}
}
if args.TimeoutSeconds == nil {
if d := internal.GetEnvOrDefault(nil, internal.ParseEnvInt, "DOKPLOY_TIMEOUT_SECONDS"); d != nil {
args.TimeoutSeconds = pulumi.IntPtr(d.(int))
}
}
if args.ApiKey != nil {
args.ApiKey = pulumi.ToSecret(args.ApiKey).(pulumi.StringPtrInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"apiKey",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Provider
err := ctx.RegisterResource("pulumi:providers:dokploy", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
type providerArgs struct {
// API token generated in Dokploy under *Settings > Profile > API/CLI*. May also be set with the `DOKPLOY_API_KEY` environment variable.
ApiKey *string `pulumi:"apiKey"`
// Base URL of the Dokploy instance, for example `https://dokploy.example.com`. A trailing `/api` is optional. May also be set with the `DOKPLOY_HOST` environment variable.
Host *string `pulumi:"host"`
// Skip TLS certificate verification. Only use this for instances behind a self-signed certificate. Defaults to `false`.
InsecureSkipVerify *bool `pulumi:"insecureSkipVerify"`
// Per-request timeout in seconds. Defaults to `60`. May also be set with the `DOKPLOY_TIMEOUT_SECONDS` environment variable.
TimeoutSeconds *int `pulumi:"timeoutSeconds"`
}
// The set of arguments for constructing a Provider resource.
type ProviderArgs struct {
// API token generated in Dokploy under *Settings > Profile > API/CLI*. May also be set with the `DOKPLOY_API_KEY` environment variable.
ApiKey pulumi.StringPtrInput
// Base URL of the Dokploy instance, for example `https://dokploy.example.com`. A trailing `/api` is optional. May also be set with the `DOKPLOY_HOST` environment variable.
Host pulumi.StringPtrInput
// Skip TLS certificate verification. Only use this for instances behind a self-signed certificate. Defaults to `false`.
InsecureSkipVerify pulumi.BoolPtrInput
// Per-request timeout in seconds. Defaults to `60`. May also be set with the `DOKPLOY_TIMEOUT_SECONDS` environment variable.
TimeoutSeconds pulumi.IntPtrInput
}
func (ProviderArgs) ElementType() reflect.Type {
return reflect.TypeOf((*providerArgs)(nil)).Elem()
}
// This function returns a Terraform config object with terraform-namecased keys,to be used with the Terraform Module Provider.
func (r *Provider) TerraformConfig(ctx *pulumi.Context) (ProviderTerraformConfigResultOutput, error) {
out, err := ctx.Call("pulumi:providers:dokploy/terraformConfig", nil, ProviderTerraformConfigResultOutput{}, r)
if err != nil {
return ProviderTerraformConfigResultOutput{}, err
}
return out.(ProviderTerraformConfigResultOutput), nil
}
type ProviderTerraformConfigResult struct {
Result map[string]interface{} `pulumi:"result"`
}
type ProviderTerraformConfigResultOutput struct{ *pulumi.OutputState }
func (ProviderTerraformConfigResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*ProviderTerraformConfigResult)(nil)).Elem()
}
func (o ProviderTerraformConfigResultOutput) Result() pulumi.MapOutput {
return o.ApplyT(func(v ProviderTerraformConfigResult) map[string]interface{} { return v.Result }).(pulumi.MapOutput)
}
type ProviderInput interface {
pulumi.Input
ToProviderOutput() ProviderOutput
ToProviderOutputWithContext(ctx context.Context) ProviderOutput
}
func (*Provider) ElementType() reflect.Type {
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (i *Provider) ToProviderOutput() ProviderOutput {
return i.ToProviderOutputWithContext(context.Background())
}
func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutput {
return pulumi.ToOutputWithContext(ctx, i).(ProviderOutput)
}
type ProviderOutput struct{ *pulumi.OutputState }
func (ProviderOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Provider)(nil)).Elem()
}
func (o ProviderOutput) ToProviderOutput() ProviderOutput {
return o
}
func (o ProviderOutput) ToProviderOutputWithContext(ctx context.Context) ProviderOutput {
return o
}
// API token generated in Dokploy under *Settings > Profile > API/CLI*. May also be set with the `DOKPLOY_API_KEY` environment variable.
func (o ProviderOutput) ApiKey() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.ApiKey }).(pulumi.StringPtrOutput)
}
// Base URL of the Dokploy instance, for example `https://dokploy.example.com`. A trailing `/api` is optional. May also be set with the `DOKPLOY_HOST` environment variable.
func (o ProviderOutput) Host() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.Host }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ProviderInput)(nil)).Elem(), &Provider{})
pulumi.RegisterOutputType(ProviderOutput{})
pulumi.RegisterOutputType(ProviderTerraformConfigResultOutput{})
}