diff --git a/CHANGELOG.md b/CHANGELOG.md index 30bfbc29..b037dccd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## HEAD (Unreleased) +* Add Terraform resources to .NET SDK ([#121](https://github.com/pulumi/pulumi-docker/pull/121)). + ## 1.0.0 (2019-12-06) * Regenerate SDK against tf2pulumi 0.6.0 * Add ability to skip push on image build diff --git a/Makefile b/Makefile index e93d04e2..7505e747 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ TESTPARALLELISM := 4 build:: go install -ldflags "-X github.com/pulumi/pulumi-docker/pkg/version.Version=${VERSION}" ${PROJECT}/cmd/${TFGEN} go install -ldflags "-X github.com/pulumi/pulumi-docker/pkg/version.Version=${VERSION}" ${PROJECT}/cmd/${PROVIDER} - for LANGUAGE in "nodejs" "python" "go" ; do \ + for LANGUAGE in "nodejs" "python" "go" "dotnet" ; do \ $(TFGEN) $$LANGUAGE --overlays overlays/$$LANGUAGE/ --out ${PACKDIR}/$$LANGUAGE/ || exit 3 ; \ done cd ${PACKDIR}/nodejs/ && \ diff --git a/examples/examples_test.go b/examples/examples_test.go index 6ee0e5b5..f03b79f4 100644 --- a/examples/examples_test.go +++ b/examples/examples_test.go @@ -96,6 +96,21 @@ func TestNginxPy(t *testing.T) { integration.ProgramTest(t, &opts) } +func TestNginxCs(t *testing.T) { + cwd, err := os.Getwd() + if !assert.NoError(t, err) { + t.FailNow() + } + + opts := base.With(integration.ProgramTestOptions{ + Dependencies: []string{ + "Pulumi.Docker", + }, + Dir: path.Join(cwd, "nginx-cs"), + }) + integration.ProgramTest(t, &opts) +} + func TestDotNet(t *testing.T) { cwd, err := os.Getwd() if !assert.NoError(t, err) { diff --git a/examples/nginx-cs/NginxDocker.csproj b/examples/nginx-cs/NginxDocker.csproj new file mode 100644 index 00000000..b68c4e61 --- /dev/null +++ b/examples/nginx-cs/NginxDocker.csproj @@ -0,0 +1,9 @@ + + + + Exe + netcoreapp3.0 + enable + + + diff --git a/examples/nginx-cs/Program.cs b/examples/nginx-cs/Program.cs new file mode 100644 index 00000000..973faf28 --- /dev/null +++ b/examples/nginx-cs/Program.cs @@ -0,0 +1,48 @@ +using System.Collections.Generic; +using System.Threading.Tasks; + +using Pulumi; +using Pulumi.Docker; +using Pulumi.Docker.Inputs; + +class Program +{ + static Task Main() + { + return Deployment.RunAsync(() => + { + // Get a reference to the remote image "nginx:1.15.6". Without specifying the repository, the Docker provider will + // try to download it from the public Docker Hub. + var remoteImage = new RemoteImage("nginx-image", new RemoteImageArgs + { + Name = "nginx:1.15.6", + KeepLocally = true, // don't delete the image from the local cache when deleting this resource + }); + + // Launch a container using the nginx image we just downloaded. + var container = new Container("nginx", new ContainerArgs + { + Image = remoteImage.Name, + Ports = + { + new ContainerPortsArgs + { + Internal = 80, + // external: defaults to an open ephemeral port + // protocol: defaults to TCP + // ip: defaults to 0.0.0.0 + }, + }, + }); + + var endpoints = container.Ports.Apply(ports => $"{ports![0].Ip}:{ports![0].External}"); + return new Dictionary + { + // Since the container is auto-named, export the name. + { "name", container.Name }, + // Since the provider picked a random ephemeral port for this container, export the endpoint. + { "endpoints", endpoints }, + }; + }); + } +} diff --git a/examples/nginx-cs/Pulumi.yaml b/examples/nginx-cs/Pulumi.yaml new file mode 100644 index 00000000..ca8b43c7 --- /dev/null +++ b/examples/nginx-cs/Pulumi.yaml @@ -0,0 +1,3 @@ +name: nginx-cs +description: "Nginx Docker image" +runtime: dotnet diff --git a/go.mod b/go.mod index 072469ac..f8d33ae9 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/opencontainers/image-spec v1.0.1 // indirect github.com/pkg/errors v0.8.1 github.com/pulumi/pulumi v1.6.2-0.20191205121639-7b3ec744f467 - github.com/pulumi/pulumi-terraform-bridge v1.4.2 + github.com/pulumi/pulumi-terraform-bridge v1.5.3-0.20191213094732-8f69405b5c5c github.com/stretchr/testify v1.4.1-0.20191106224347-f1bd0923b832 github.com/terraform-providers/terraform-provider-docker v1.2.1-0.20191125182715-0de84e769ddc github.com/vmihailenco/msgpack v4.0.1+incompatible // indirect diff --git a/go.sum b/go.sum index e18accc7..cf2364c1 100644 --- a/go.sum +++ b/go.sum @@ -409,8 +409,8 @@ github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R github.com/pulumi/pulumi v1.6.0/go.mod h1:gJBsD+SkjIhWRWPY+0ID9QM6sngLsMGQH8KiknlH0lU= github.com/pulumi/pulumi v1.6.2-0.20191205121639-7b3ec744f467 h1:gaSct0YDP8ki2lCAc/3c5C3AVZPYykgvOiy+QzMgd04= github.com/pulumi/pulumi v1.6.2-0.20191205121639-7b3ec744f467/go.mod h1:wWGvPIg2xvpYNJbIWjJsusLEBpApiR/Yp3FMhUMxp9I= -github.com/pulumi/pulumi-terraform-bridge v1.4.2 h1:S2iRH7ZHR2AY+XLt4i84is3fovBmNTxHB0FmdM6isQs= -github.com/pulumi/pulumi-terraform-bridge v1.4.2/go.mod h1:dSbi1sxIj9D4VYdX+HEWCUkPEsh4hAj6pKhXC4Z9FzE= +github.com/pulumi/pulumi-terraform-bridge v1.5.3-0.20191213094732-8f69405b5c5c h1:KQ5iIL+K4j3xhWQCRai+XlkxKIxQFdUHE/V44/1UpZs= +github.com/pulumi/pulumi-terraform-bridge v1.5.3-0.20191213094732-8f69405b5c5c/go.mod h1:dSbi1sxIj9D4VYdX+HEWCUkPEsh4hAj6pKhXC4Z9FzE= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/reconquest/loreley v0.0.0-20160708080500-2ab6b7470a54/go.mod h1:1NF/j951kWm+ZnRXpOkBqweImgwhlzFVwTA4A0V7TEU= github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w8= diff --git a/resources.go b/resources.go index 301b437e..fcb3fb67 100644 --- a/resources.go +++ b/resources.go @@ -97,7 +97,10 @@ func Provider() tfbridge.ProviderInfo { }, }, Resources: map[string]*tfbridge.ResourceInfo{ - "docker_config": {Tok: dockerResource(dockerMod, "Config")}, + "docker_config": { + Tok: dockerResource(dockerMod, "Config"), + CSharpName: "ServiceConfig", + }, "docker_container": { Tok: dockerResource(dockerMod, "Container"), DeleteBeforeReplace: true, @@ -144,6 +147,22 @@ func Provider() tfbridge.ProviderInfo { "pulumi": ">=1.0.0,<2.0.0", }, }, + CSharp: &tfbridge.CSharpInfo{ + PackageReferences: map[string]string{ + "Pulumi": "1.7.0-preview", + "Semver": "2.0.5", + "System.Collections.Immutable": "1.6.0", + }, + Namespaces: map[string]string{ + dockerPkg: "Docker", + }, + Overlay: &tfbridge.OverlayInfo{ + DestFiles: []string{ + "Docker.cs", + "Image.cs", + }, + }, + }, } // For all resources with name properties, we will add an auto-name property. Make sure to skip those that diff --git a/sdk/dotnet/Config/Config.cs b/sdk/dotnet/Config/Config.cs new file mode 100644 index 00000000..f68bf3bf --- /dev/null +++ b/sdk/dotnet/Config/Config.cs @@ -0,0 +1,51 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System.Collections.Immutable; + +namespace Pulumi.Docker +{ + public static class Config + { + private static readonly Pulumi.Config __config = new Pulumi.Config("docker"); + + /// + /// PEM-encoded content of Docker host CA certificate + /// + public static string? CaMaterial { get; set; } = __config.Get("caMaterial") ?? Utilities.GetEnv("DOCKER_CA_MATERIAL"); + + /// + /// PEM-encoded content of Docker client certificate + /// + public static string? CertMaterial { get; set; } = __config.Get("certMaterial") ?? Utilities.GetEnv("DOCKER_CERT_MATERIAL"); + + /// + /// Path to directory with Docker TLS config + /// + public static string? CertPath { get; set; } = __config.Get("certPath") ?? Utilities.GetEnv("DOCKER_CERT_PATH"); + + /// + /// The Docker daemon address + /// + public static string? Host { get; set; } = __config.Get("host") ?? Utilities.GetEnv("DOCKER_HOST") ?? "unix:///var/run/docker.sock"; + + /// + /// PEM-encoded content of Docker client private key + /// + public static string? KeyMaterial { get; set; } = __config.Get("keyMaterial") ?? Utilities.GetEnv("DOCKER_KEY_MATERIAL"); + + public static ImmutableArray RegistryAuth { get; set; } = __config.GetObject>("registryAuth"); + + } + namespace ConfigTypes + { + + public class RegistryAuth + { + public string Address { get; set; } = null!; + public string? ConfigFile { get; set; } + public string? Password { get; set; } + public string? Username { get; set; } + } + } +} diff --git a/sdk/dotnet/Config/README.md b/sdk/dotnet/Config/README.md new file mode 100644 index 00000000..7745bbfe --- /dev/null +++ b/sdk/dotnet/Config/README.md @@ -0,0 +1,4 @@ +> This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-docker) +> distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature, +> first check the [`pulumi/pulumi-docker` repo](https://github.com/pulumi/pulumi-docker/issues); however, if that doesn't turn up anything, +> please consult the source [`terraform-providers/terraform-provider-docker` repo](https://github.com/terraform-providers/terraform-provider-docker/issues). diff --git a/sdk/dotnet/Container.cs b/sdk/dotnet/Container.cs new file mode 100644 index 00000000..9f8e2377 --- /dev/null +++ b/sdk/dotnet/Container.cs @@ -0,0 +1,2588 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Docker +{ + /// + /// Manages the lifecycle of a Docker container. + /// + /// > This content is derived from https://github.com/terraform-providers/terraform-provider-docker/blob/master/website/docs/r/container.html.markdown. + /// + public partial class Container : Pulumi.CustomResource + { + /// + /// If true attach to the container after its creation and waits the end of his execution. + /// + [Output("attach")] + public Output Attach { get; private set; } = null!; + + /// + /// The network bridge of the container as read from its NetworkSettings. + /// + [Output("bridge")] + public Output Bridge { get; private set; } = null!; + + /// + /// See Capabilities below for details. + /// + [Output("capabilities")] + public Output Capabilities { get; private set; } = null!; + + /// + /// The command to use to start the + /// container. For example, to run `/usr/bin/myprogram -f baz.conf` set the + /// command to be `["/usr/bin/myprogram", "-f", "baz.conf"]`. + /// + [Output("command")] + public Output> Command { get; private set; } = null!; + + /// + /// The logs of the container if its execution is done (`attach` must be disabled). + /// + [Output("containerLogs")] + public Output ContainerLogs { get; private set; } = null!; + + /// + /// A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. `0-1`. + /// + [Output("cpuSet")] + public Output CpuSet { get; private set; } = null!; + + /// + /// CPU shares (relative weight) for the container. + /// + [Output("cpuShares")] + public Output CpuShares { get; private set; } = null!; + + /// + /// If defined will attempt to stop the container before destroying. Container will be destroyed after `n` seconds or on successful stop. + /// + [Output("destroyGraceSeconds")] + public Output DestroyGraceSeconds { get; private set; } = null!; + + /// + /// See Devices below for details. + /// + [Output("devices")] + public Output> Devices { get; private set; } = null!; + + /// + /// Set of DNS servers. + /// + [Output("dns")] + public Output> Dns { get; private set; } = null!; + + /// + /// Set of DNS options used by the DNS provider(s), see `resolv.conf` documentation for valid list of options. + /// + [Output("dnsOpts")] + public Output> DnsOpts { get; private set; } = null!; + + /// + /// Set of DNS search domains that are used when bare unqualified hostnames are used inside of the container. + /// + [Output("dnsSearches")] + public Output> DnsSearches { get; private set; } = null!; + + /// + /// Domain name of the container. + /// + [Output("domainname")] + public Output Domainname { get; private set; } = null!; + + /// + /// The command to use as the + /// Entrypoint for the container. The Entrypoint allows you to configure a + /// container to run as an executable. For example, to run `/usr/bin/myprogram` + /// when starting a container, set the entrypoint to be + /// `["/usr/bin/myprogram"]`. + /// + [Output("entrypoints")] + public Output> Entrypoints { get; private set; } = null!; + + /// + /// Environment variables to set. + /// + [Output("envs")] + public Output> Envs { get; private set; } = null!; + + /// + /// The exit code of the container if its execution is done (`must_run` must be disabled). + /// + [Output("exitCode")] + public Output ExitCode { get; private set; } = null!; + + /// + /// *Deprecated:* Use `network_data` instead. The network gateway of the container as read from its + /// NetworkSettings. + /// + [Output("gateway")] + public Output Gateway { get; private set; } = null!; + + /// + /// Add additional groups to run as. + /// + [Output("groupAdds")] + public Output> GroupAdds { get; private set; } = null!; + + /// + /// See Healthcheck below for details. + /// + [Output("healthcheck")] + public Output Healthcheck { get; private set; } = null!; + + /// + /// Hostname to add. + /// + [Output("hosts")] + public Output> Hosts { get; private set; } = null!; + + /// + /// Hostname of the container. + /// + [Output("hostname")] + public Output Hostname { get; private set; } = null!; + + /// + /// The ID of the image to back this container. + /// The easiest way to get this value is to use the `docker..RemoteImage` resource + /// as is shown in the example above. + /// + [Output("image")] + public Output Image { get; private set; } = null!; + + /// + /// *Deprecated:* Use `network_data` instead. The IP address of the container's first network it. + /// + [Output("ipAddress")] + public Output IpAddress { get; private set; } = null!; + + /// + /// *Deprecated:* Use `network_data` instead. The IP prefix length of the container as read from its + /// NetworkSettings. + /// + [Output("ipPrefixLength")] + public Output IpPrefixLength { get; private set; } = null!; + + /// + /// IPC sharing mode for the container. Possible values are: `none`, `private`, `shareable`, `container:<name|id>` or `host`. + /// + [Output("ipcMode")] + public Output IpcMode { get; private set; } = null!; + + /// + /// Adding labels. + /// + [Output("labels")] + public Output?> Labels { get; private set; } = null!; + + /// + /// Set of links for link based + /// connectivity between containers that are running on the same host. + /// + [Output("links")] + public Output> Links { get; private set; } = null!; + + /// + /// The logging driver to use for the container. + /// Defaults to "json-file". + /// + [Output("logDriver")] + public Output LogDriver { get; private set; } = null!; + + /// + /// Key/value pairs to use as options for + /// the logging driver. + /// + [Output("logOpts")] + public Output?> LogOpts { get; private set; } = null!; + + /// + /// Save the container logs (`attach` must be enabled). + /// + [Output("logs")] + public Output Logs { get; private set; } = null!; + + /// + /// The maximum amount of times to an attempt + /// a restart when `restart` is set to "on-failure" + /// * `working_dir`- (Optional, string) The working directory for commands to run in + /// + [Output("maxRetryCount")] + public Output MaxRetryCount { get; private set; } = null!; + + /// + /// The memory limit for the container in MBs. + /// + [Output("memory")] + public Output Memory { get; private set; } = null!; + + [Output("memorySwap")] + public Output MemorySwap { get; private set; } = null!; + + /// + /// See Mounts below for details. + /// + [Output("mounts")] + public Output> Mounts { get; private set; } = null!; + + [Output("mustRun")] + public Output MustRun { get; private set; } = null!; + + [Output("name")] + public Output Name { get; private set; } = null!; + + /// + /// Network aliases of the container for user-defined networks only. *Deprecated:* use `networks_advanced` instead. + /// + [Output("networkAliases")] + public Output> NetworkAliases { get; private set; } = null!; + + /// + /// (Map of a block) The IP addresses of the container on each + /// network. Key are the network names, values are the IP addresses. + /// + [Output("networkDatas")] + public Output> NetworkDatas { get; private set; } = null!; + + /// + /// Network mode of the container. + /// + [Output("networkMode")] + public Output NetworkMode { get; private set; } = null!; + + /// + /// Id of the networks in which the + /// container is. *Deprecated:* use `networks_advanced` instead. + /// + [Output("networks")] + public Output> Networks { get; private set; } = null!; + + /// + /// See Networks Advanced below for details. If this block has priority to the deprecated `network_alias` and `network` properties. + /// + [Output("networksAdvanced")] + public Output> NetworksAdvanced { get; private set; } = null!; + + /// + /// The PID (Process) Namespace mode for the container. Either `container:<name|id>` or `host`. + /// + [Output("pidMode")] + public Output PidMode { get; private set; } = null!; + + /// + /// See Ports below for details. + /// + [Output("ports")] + public Output> Ports { get; private set; } = null!; + + /// + /// Run container in privileged mode. + /// + [Output("privileged")] + public Output Privileged { get; private set; } = null!; + + /// + /// Publish all ports of the container. + /// + [Output("publishAllPorts")] + public Output PublishAllPorts { get; private set; } = null!; + + /// + /// If true, this volume will be readonly. + /// Defaults to false. + /// + [Output("readOnly")] + public Output ReadOnly { get; private set; } = null!; + + /// + /// The restart policy for the container. Must be + /// one of "no", "on-failure", "always", "unless-stopped". + /// + [Output("restart")] + public Output Restart { get; private set; } = null!; + + [Output("rm")] + public Output Rm { get; private set; } = null!; + + /// + /// Size of `/dev/shm` in MBs. + /// + [Output("shmSize")] + public Output ShmSize { get; private set; } = null!; + + /// + /// If true, then the Docker container will be + /// started after creation. If false, then the container is only created. + /// + [Output("start")] + public Output Start { get; private set; } = null!; + + /// + /// A map of kernel parameters (sysctls) to set in the container. + /// + [Output("sysctls")] + public Output?> Sysctls { get; private set; } = null!; + + /// + /// A map of container directories which should be replaced by `tmpfs mounts`, and their corresponding mount options. + /// + [Output("tmpfs")] + public Output?> Tmpfs { get; private set; } = null!; + + /// + /// See Ulimits below for + /// details. + /// + [Output("ulimits")] + public Output> Ulimits { get; private set; } = null!; + + /// + /// See File Upload below for details. + /// + [Output("uploads")] + public Output> Uploads { get; private set; } = null!; + + /// + /// User used for run the first process. Format is + /// `user` or `user:group` which user and group can be passed literraly or + /// by name. + /// + [Output("user")] + public Output User { get; private set; } = null!; + + /// + /// Sets the usernamespace mode for the container when usernamespace remapping option is enabled. + /// + [Output("usernsMode")] + public Output UsernsMode { get; private set; } = null!; + + /// + /// See Volumes below for details. + /// + [Output("volumes")] + public Output> Volumes { get; private set; } = null!; + + [Output("workingDir")] + public Output WorkingDir { get; private set; } = null!; + + + /// + /// Create a Container resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public Container(string name, ContainerArgs args, CustomResourceOptions? options = null) + : base("docker:index/container:Container", name, args ?? ResourceArgs.Empty, MakeResourceOptions(options, "")) + { + } + + private Container(string name, Input id, ContainerState? state = null, CustomResourceOptions? options = null) + : base("docker:index/container:Container", name, state, MakeResourceOptions(options, id)) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + }; + var merged = CustomResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + /// + /// Get an existing Container resource's state with the given name, ID, and optional extra + /// properties used to qualify the lookup. + /// + /// + /// The unique name of the resulting resource. + /// The unique provider ID of the resource to lookup. + /// Any extra arguments used during the lookup. + /// A bag of options that control this resource's behavior + public static Container Get(string name, Input id, ContainerState? state = null, CustomResourceOptions? options = null) + { + return new Container(name, id, state, options); + } + } + + public sealed class ContainerArgs : Pulumi.ResourceArgs + { + /// + /// If true attach to the container after its creation and waits the end of his execution. + /// + [Input("attach")] + public Input? Attach { get; set; } + + /// + /// See Capabilities below for details. + /// + [Input("capabilities")] + public Input? Capabilities { get; set; } + + [Input("command")] + private InputList? _command; + + /// + /// The command to use to start the + /// container. For example, to run `/usr/bin/myprogram -f baz.conf` set the + /// command to be `["/usr/bin/myprogram", "-f", "baz.conf"]`. + /// + public InputList Command + { + get => _command ?? (_command = new InputList()); + set => _command = value; + } + + /// + /// A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. `0-1`. + /// + [Input("cpuSet")] + public Input? CpuSet { get; set; } + + /// + /// CPU shares (relative weight) for the container. + /// + [Input("cpuShares")] + public Input? CpuShares { get; set; } + + /// + /// If defined will attempt to stop the container before destroying. Container will be destroyed after `n` seconds or on successful stop. + /// + [Input("destroyGraceSeconds")] + public Input? DestroyGraceSeconds { get; set; } + + [Input("devices")] + private InputList? _devices; + + /// + /// See Devices below for details. + /// + public InputList Devices + { + get => _devices ?? (_devices = new InputList()); + set => _devices = value; + } + + [Input("dns")] + private InputList? _dns; + + /// + /// Set of DNS servers. + /// + public InputList Dns + { + get => _dns ?? (_dns = new InputList()); + set => _dns = value; + } + + [Input("dnsOpts")] + private InputList? _dnsOpts; + + /// + /// Set of DNS options used by the DNS provider(s), see `resolv.conf` documentation for valid list of options. + /// + public InputList DnsOpts + { + get => _dnsOpts ?? (_dnsOpts = new InputList()); + set => _dnsOpts = value; + } + + [Input("dnsSearches")] + private InputList? _dnsSearches; + + /// + /// Set of DNS search domains that are used when bare unqualified hostnames are used inside of the container. + /// + public InputList DnsSearches + { + get => _dnsSearches ?? (_dnsSearches = new InputList()); + set => _dnsSearches = value; + } + + /// + /// Domain name of the container. + /// + [Input("domainname")] + public Input? Domainname { get; set; } + + [Input("entrypoints")] + private InputList? _entrypoints; + + /// + /// The command to use as the + /// Entrypoint for the container. The Entrypoint allows you to configure a + /// container to run as an executable. For example, to run `/usr/bin/myprogram` + /// when starting a container, set the entrypoint to be + /// `["/usr/bin/myprogram"]`. + /// + public InputList Entrypoints + { + get => _entrypoints ?? (_entrypoints = new InputList()); + set => _entrypoints = value; + } + + [Input("envs")] + private InputList? _envs; + + /// + /// Environment variables to set. + /// + public InputList Envs + { + get => _envs ?? (_envs = new InputList()); + set => _envs = value; + } + + [Input("groupAdds")] + private InputList? _groupAdds; + + /// + /// Add additional groups to run as. + /// + public InputList GroupAdds + { + get => _groupAdds ?? (_groupAdds = new InputList()); + set => _groupAdds = value; + } + + /// + /// See Healthcheck below for details. + /// + [Input("healthcheck")] + public Input? Healthcheck { get; set; } + + [Input("hosts")] + private InputList? _hosts; + + /// + /// Hostname to add. + /// + public InputList Hosts + { + get => _hosts ?? (_hosts = new InputList()); + set => _hosts = value; + } + + /// + /// Hostname of the container. + /// + [Input("hostname")] + public Input? Hostname { get; set; } + + /// + /// The ID of the image to back this container. + /// The easiest way to get this value is to use the `docker..RemoteImage` resource + /// as is shown in the example above. + /// + [Input("image", required: true)] + public Input Image { get; set; } = null!; + + /// + /// IPC sharing mode for the container. Possible values are: `none`, `private`, `shareable`, `container:<name|id>` or `host`. + /// + [Input("ipcMode")] + public Input? IpcMode { get; set; } + + [Input("labels")] + private InputMap? _labels; + + /// + /// Adding labels. + /// + public InputMap Labels + { + get => _labels ?? (_labels = new InputMap()); + set => _labels = value; + } + + [Input("links")] + private InputList? _links; + + /// + /// Set of links for link based + /// connectivity between containers that are running on the same host. + /// + public InputList Links + { + get => _links ?? (_links = new InputList()); + set => _links = value; + } + + /// + /// The logging driver to use for the container. + /// Defaults to "json-file". + /// + [Input("logDriver")] + public Input? LogDriver { get; set; } + + [Input("logOpts")] + private InputMap? _logOpts; + + /// + /// Key/value pairs to use as options for + /// the logging driver. + /// + public InputMap LogOpts + { + get => _logOpts ?? (_logOpts = new InputMap()); + set => _logOpts = value; + } + + /// + /// Save the container logs (`attach` must be enabled). + /// + [Input("logs")] + public Input? Logs { get; set; } + + /// + /// The maximum amount of times to an attempt + /// a restart when `restart` is set to "on-failure" + /// * `working_dir`- (Optional, string) The working directory for commands to run in + /// + [Input("maxRetryCount")] + public Input? MaxRetryCount { get; set; } + + /// + /// The memory limit for the container in MBs. + /// + [Input("memory")] + public Input? Memory { get; set; } + + [Input("memorySwap")] + public Input? MemorySwap { get; set; } + + [Input("mounts")] + private InputList? _mounts; + + /// + /// See Mounts below for details. + /// + public InputList Mounts + { + get => _mounts ?? (_mounts = new InputList()); + set => _mounts = value; + } + + [Input("mustRun")] + public Input? MustRun { get; set; } + + [Input("name")] + public Input? Name { get; set; } + + [Input("networkAliases")] + private InputList? _networkAliases; + + /// + /// Network aliases of the container for user-defined networks only. *Deprecated:* use `networks_advanced` instead. + /// + public InputList NetworkAliases + { + get => _networkAliases ?? (_networkAliases = new InputList()); + set => _networkAliases = value; + } + + /// + /// Network mode of the container. + /// + [Input("networkMode")] + public Input? NetworkMode { get; set; } + + [Input("networks")] + private InputList? _networks; + + /// + /// Id of the networks in which the + /// container is. *Deprecated:* use `networks_advanced` instead. + /// + public InputList Networks + { + get => _networks ?? (_networks = new InputList()); + set => _networks = value; + } + + [Input("networksAdvanced")] + private InputList? _networksAdvanced; + + /// + /// See Networks Advanced below for details. If this block has priority to the deprecated `network_alias` and `network` properties. + /// + public InputList NetworksAdvanced + { + get => _networksAdvanced ?? (_networksAdvanced = new InputList()); + set => _networksAdvanced = value; + } + + /// + /// The PID (Process) Namespace mode for the container. Either `container:<name|id>` or `host`. + /// + [Input("pidMode")] + public Input? PidMode { get; set; } + + [Input("ports")] + private InputList? _ports; + + /// + /// See Ports below for details. + /// + public InputList Ports + { + get => _ports ?? (_ports = new InputList()); + set => _ports = value; + } + + /// + /// Run container in privileged mode. + /// + [Input("privileged")] + public Input? Privileged { get; set; } + + /// + /// Publish all ports of the container. + /// + [Input("publishAllPorts")] + public Input? PublishAllPorts { get; set; } + + /// + /// If true, this volume will be readonly. + /// Defaults to false. + /// + [Input("readOnly")] + public Input? ReadOnly { get; set; } + + /// + /// The restart policy for the container. Must be + /// one of "no", "on-failure", "always", "unless-stopped". + /// + [Input("restart")] + public Input? Restart { get; set; } + + [Input("rm")] + public Input? Rm { get; set; } + + /// + /// Size of `/dev/shm` in MBs. + /// + [Input("shmSize")] + public Input? ShmSize { get; set; } + + /// + /// If true, then the Docker container will be + /// started after creation. If false, then the container is only created. + /// + [Input("start")] + public Input? Start { get; set; } + + [Input("sysctls")] + private InputMap? _sysctls; + + /// + /// A map of kernel parameters (sysctls) to set in the container. + /// + public InputMap Sysctls + { + get => _sysctls ?? (_sysctls = new InputMap()); + set => _sysctls = value; + } + + [Input("tmpfs")] + private InputMap? _tmpfs; + + /// + /// A map of container directories which should be replaced by `tmpfs mounts`, and their corresponding mount options. + /// + public InputMap Tmpfs + { + get => _tmpfs ?? (_tmpfs = new InputMap()); + set => _tmpfs = value; + } + + [Input("ulimits")] + private InputList? _ulimits; + + /// + /// See Ulimits below for + /// details. + /// + public InputList Ulimits + { + get => _ulimits ?? (_ulimits = new InputList()); + set => _ulimits = value; + } + + [Input("uploads")] + private InputList? _uploads; + + /// + /// See File Upload below for details. + /// + public InputList Uploads + { + get => _uploads ?? (_uploads = new InputList()); + set => _uploads = value; + } + + /// + /// User used for run the first process. Format is + /// `user` or `user:group` which user and group can be passed literraly or + /// by name. + /// + [Input("user")] + public Input? User { get; set; } + + /// + /// Sets the usernamespace mode for the container when usernamespace remapping option is enabled. + /// + [Input("usernsMode")] + public Input? UsernsMode { get; set; } + + [Input("volumes")] + private InputList? _volumes; + + /// + /// See Volumes below for details. + /// + public InputList Volumes + { + get => _volumes ?? (_volumes = new InputList()); + set => _volumes = value; + } + + [Input("workingDir")] + public Input? WorkingDir { get; set; } + + public ContainerArgs() + { + } + } + + public sealed class ContainerState : Pulumi.ResourceArgs + { + /// + /// If true attach to the container after its creation and waits the end of his execution. + /// + [Input("attach")] + public Input? Attach { get; set; } + + /// + /// The network bridge of the container as read from its NetworkSettings. + /// + [Input("bridge")] + public Input? Bridge { get; set; } + + /// + /// See Capabilities below for details. + /// + [Input("capabilities")] + public Input? Capabilities { get; set; } + + [Input("command")] + private InputList? _command; + + /// + /// The command to use to start the + /// container. For example, to run `/usr/bin/myprogram -f baz.conf` set the + /// command to be `["/usr/bin/myprogram", "-f", "baz.conf"]`. + /// + public InputList Command + { + get => _command ?? (_command = new InputList()); + set => _command = value; + } + + /// + /// The logs of the container if its execution is done (`attach` must be disabled). + /// + [Input("containerLogs")] + public Input? ContainerLogs { get; set; } + + /// + /// A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. `0-1`. + /// + [Input("cpuSet")] + public Input? CpuSet { get; set; } + + /// + /// CPU shares (relative weight) for the container. + /// + [Input("cpuShares")] + public Input? CpuShares { get; set; } + + /// + /// If defined will attempt to stop the container before destroying. Container will be destroyed after `n` seconds or on successful stop. + /// + [Input("destroyGraceSeconds")] + public Input? DestroyGraceSeconds { get; set; } + + [Input("devices")] + private InputList? _devices; + + /// + /// See Devices below for details. + /// + public InputList Devices + { + get => _devices ?? (_devices = new InputList()); + set => _devices = value; + } + + [Input("dns")] + private InputList? _dns; + + /// + /// Set of DNS servers. + /// + public InputList Dns + { + get => _dns ?? (_dns = new InputList()); + set => _dns = value; + } + + [Input("dnsOpts")] + private InputList? _dnsOpts; + + /// + /// Set of DNS options used by the DNS provider(s), see `resolv.conf` documentation for valid list of options. + /// + public InputList DnsOpts + { + get => _dnsOpts ?? (_dnsOpts = new InputList()); + set => _dnsOpts = value; + } + + [Input("dnsSearches")] + private InputList? _dnsSearches; + + /// + /// Set of DNS search domains that are used when bare unqualified hostnames are used inside of the container. + /// + public InputList DnsSearches + { + get => _dnsSearches ?? (_dnsSearches = new InputList()); + set => _dnsSearches = value; + } + + /// + /// Domain name of the container. + /// + [Input("domainname")] + public Input? Domainname { get; set; } + + [Input("entrypoints")] + private InputList? _entrypoints; + + /// + /// The command to use as the + /// Entrypoint for the container. The Entrypoint allows you to configure a + /// container to run as an executable. For example, to run `/usr/bin/myprogram` + /// when starting a container, set the entrypoint to be + /// `["/usr/bin/myprogram"]`. + /// + public InputList Entrypoints + { + get => _entrypoints ?? (_entrypoints = new InputList()); + set => _entrypoints = value; + } + + [Input("envs")] + private InputList? _envs; + + /// + /// Environment variables to set. + /// + public InputList Envs + { + get => _envs ?? (_envs = new InputList()); + set => _envs = value; + } + + /// + /// The exit code of the container if its execution is done (`must_run` must be disabled). + /// + [Input("exitCode")] + public Input? ExitCode { get; set; } + + /// + /// *Deprecated:* Use `network_data` instead. The network gateway of the container as read from its + /// NetworkSettings. + /// + [Input("gateway")] + public Input? Gateway { get; set; } + + [Input("groupAdds")] + private InputList? _groupAdds; + + /// + /// Add additional groups to run as. + /// + public InputList GroupAdds + { + get => _groupAdds ?? (_groupAdds = new InputList()); + set => _groupAdds = value; + } + + /// + /// See Healthcheck below for details. + /// + [Input("healthcheck")] + public Input? Healthcheck { get; set; } + + [Input("hosts")] + private InputList? _hosts; + + /// + /// Hostname to add. + /// + public InputList Hosts + { + get => _hosts ?? (_hosts = new InputList()); + set => _hosts = value; + } + + /// + /// Hostname of the container. + /// + [Input("hostname")] + public Input? Hostname { get; set; } + + /// + /// The ID of the image to back this container. + /// The easiest way to get this value is to use the `docker..RemoteImage` resource + /// as is shown in the example above. + /// + [Input("image")] + public Input? Image { get; set; } + + /// + /// *Deprecated:* Use `network_data` instead. The IP address of the container's first network it. + /// + [Input("ipAddress")] + public Input? IpAddress { get; set; } + + /// + /// *Deprecated:* Use `network_data` instead. The IP prefix length of the container as read from its + /// NetworkSettings. + /// + [Input("ipPrefixLength")] + public Input? IpPrefixLength { get; set; } + + /// + /// IPC sharing mode for the container. Possible values are: `none`, `private`, `shareable`, `container:<name|id>` or `host`. + /// + [Input("ipcMode")] + public Input? IpcMode { get; set; } + + [Input("labels")] + private InputMap? _labels; + + /// + /// Adding labels. + /// + public InputMap Labels + { + get => _labels ?? (_labels = new InputMap()); + set => _labels = value; + } + + [Input("links")] + private InputList? _links; + + /// + /// Set of links for link based + /// connectivity between containers that are running on the same host. + /// + public InputList Links + { + get => _links ?? (_links = new InputList()); + set => _links = value; + } + + /// + /// The logging driver to use for the container. + /// Defaults to "json-file". + /// + [Input("logDriver")] + public Input? LogDriver { get; set; } + + [Input("logOpts")] + private InputMap? _logOpts; + + /// + /// Key/value pairs to use as options for + /// the logging driver. + /// + public InputMap LogOpts + { + get => _logOpts ?? (_logOpts = new InputMap()); + set => _logOpts = value; + } + + /// + /// Save the container logs (`attach` must be enabled). + /// + [Input("logs")] + public Input? Logs { get; set; } + + /// + /// The maximum amount of times to an attempt + /// a restart when `restart` is set to "on-failure" + /// * `working_dir`- (Optional, string) The working directory for commands to run in + /// + [Input("maxRetryCount")] + public Input? MaxRetryCount { get; set; } + + /// + /// The memory limit for the container in MBs. + /// + [Input("memory")] + public Input? Memory { get; set; } + + [Input("memorySwap")] + public Input? MemorySwap { get; set; } + + [Input("mounts")] + private InputList? _mounts; + + /// + /// See Mounts below for details. + /// + public InputList Mounts + { + get => _mounts ?? (_mounts = new InputList()); + set => _mounts = value; + } + + [Input("mustRun")] + public Input? MustRun { get; set; } + + [Input("name")] + public Input? Name { get; set; } + + [Input("networkAliases")] + private InputList? _networkAliases; + + /// + /// Network aliases of the container for user-defined networks only. *Deprecated:* use `networks_advanced` instead. + /// + public InputList NetworkAliases + { + get => _networkAliases ?? (_networkAliases = new InputList()); + set => _networkAliases = value; + } + + [Input("networkDatas")] + private InputList? _networkDatas; + + /// + /// (Map of a block) The IP addresses of the container on each + /// network. Key are the network names, values are the IP addresses. + /// + public InputList NetworkDatas + { + get => _networkDatas ?? (_networkDatas = new InputList()); + set => _networkDatas = value; + } + + /// + /// Network mode of the container. + /// + [Input("networkMode")] + public Input? NetworkMode { get; set; } + + [Input("networks")] + private InputList? _networks; + + /// + /// Id of the networks in which the + /// container is. *Deprecated:* use `networks_advanced` instead. + /// + public InputList Networks + { + get => _networks ?? (_networks = new InputList()); + set => _networks = value; + } + + [Input("networksAdvanced")] + private InputList? _networksAdvanced; + + /// + /// See Networks Advanced below for details. If this block has priority to the deprecated `network_alias` and `network` properties. + /// + public InputList NetworksAdvanced + { + get => _networksAdvanced ?? (_networksAdvanced = new InputList()); + set => _networksAdvanced = value; + } + + /// + /// The PID (Process) Namespace mode for the container. Either `container:<name|id>` or `host`. + /// + [Input("pidMode")] + public Input? PidMode { get; set; } + + [Input("ports")] + private InputList? _ports; + + /// + /// See Ports below for details. + /// + public InputList Ports + { + get => _ports ?? (_ports = new InputList()); + set => _ports = value; + } + + /// + /// Run container in privileged mode. + /// + [Input("privileged")] + public Input? Privileged { get; set; } + + /// + /// Publish all ports of the container. + /// + [Input("publishAllPorts")] + public Input? PublishAllPorts { get; set; } + + /// + /// If true, this volume will be readonly. + /// Defaults to false. + /// + [Input("readOnly")] + public Input? ReadOnly { get; set; } + + /// + /// The restart policy for the container. Must be + /// one of "no", "on-failure", "always", "unless-stopped". + /// + [Input("restart")] + public Input? Restart { get; set; } + + [Input("rm")] + public Input? Rm { get; set; } + + /// + /// Size of `/dev/shm` in MBs. + /// + [Input("shmSize")] + public Input? ShmSize { get; set; } + + /// + /// If true, then the Docker container will be + /// started after creation. If false, then the container is only created. + /// + [Input("start")] + public Input? Start { get; set; } + + [Input("sysctls")] + private InputMap? _sysctls; + + /// + /// A map of kernel parameters (sysctls) to set in the container. + /// + public InputMap Sysctls + { + get => _sysctls ?? (_sysctls = new InputMap()); + set => _sysctls = value; + } + + [Input("tmpfs")] + private InputMap? _tmpfs; + + /// + /// A map of container directories which should be replaced by `tmpfs mounts`, and their corresponding mount options. + /// + public InputMap Tmpfs + { + get => _tmpfs ?? (_tmpfs = new InputMap()); + set => _tmpfs = value; + } + + [Input("ulimits")] + private InputList? _ulimits; + + /// + /// See Ulimits below for + /// details. + /// + public InputList Ulimits + { + get => _ulimits ?? (_ulimits = new InputList()); + set => _ulimits = value; + } + + [Input("uploads")] + private InputList? _uploads; + + /// + /// See File Upload below for details. + /// + public InputList Uploads + { + get => _uploads ?? (_uploads = new InputList()); + set => _uploads = value; + } + + /// + /// User used for run the first process. Format is + /// `user` or `user:group` which user and group can be passed literraly or + /// by name. + /// + [Input("user")] + public Input? User { get; set; } + + /// + /// Sets the usernamespace mode for the container when usernamespace remapping option is enabled. + /// + [Input("usernsMode")] + public Input? UsernsMode { get; set; } + + [Input("volumes")] + private InputList? _volumes; + + /// + /// See Volumes below for details. + /// + public InputList Volumes + { + get => _volumes ?? (_volumes = new InputList()); + set => _volumes = value; + } + + [Input("workingDir")] + public Input? WorkingDir { get; set; } + + public ContainerState() + { + } + } + + namespace Inputs + { + + public sealed class ContainerCapabilitiesArgs : Pulumi.ResourceArgs + { + [Input("adds")] + private InputList? _adds; + + /// + /// list of linux capabilities to add. + /// + public InputList Adds + { + get => _adds ?? (_adds = new InputList()); + set => _adds = value; + } + + [Input("drops")] + private InputList? _drops; + + /// + /// list of linux capabilities to drop. + /// + public InputList Drops + { + get => _drops ?? (_drops = new InputList()); + set => _drops = value; + } + + public ContainerCapabilitiesArgs() + { + } + } + + public sealed class ContainerCapabilitiesGetArgs : Pulumi.ResourceArgs + { + [Input("adds")] + private InputList? _adds; + + /// + /// list of linux capabilities to add. + /// + public InputList Adds + { + get => _adds ?? (_adds = new InputList()); + set => _adds = value; + } + + [Input("drops")] + private InputList? _drops; + + /// + /// list of linux capabilities to drop. + /// + public InputList Drops + { + get => _drops ?? (_drops = new InputList()); + set => _drops = value; + } + + public ContainerCapabilitiesGetArgs() + { + } + } + + public sealed class ContainerDevicesArgs : Pulumi.ResourceArgs + { + /// + /// The path in the container where the + /// device will be binded. + /// + [Input("containerPath")] + public Input? ContainerPath { get; set; } + + /// + /// The path on the host where the device + /// is located. + /// + [Input("hostPath", required: true)] + public Input HostPath { get; set; } = null!; + + /// + /// The cgroup permissions given to the + /// container to access the device. + /// Defaults to `rwm`. + /// + [Input("permissions")] + public Input? Permissions { get; set; } + + public ContainerDevicesArgs() + { + } + } + + public sealed class ContainerDevicesGetArgs : Pulumi.ResourceArgs + { + /// + /// The path in the container where the + /// device will be binded. + /// + [Input("containerPath")] + public Input? ContainerPath { get; set; } + + /// + /// The path on the host where the device + /// is located. + /// + [Input("hostPath", required: true)] + public Input HostPath { get; set; } = null!; + + /// + /// The cgroup permissions given to the + /// container to access the device. + /// Defaults to `rwm`. + /// + [Input("permissions")] + public Input? Permissions { get; set; } + + public ContainerDevicesGetArgs() + { + } + } + + public sealed class ContainerHealthcheckArgs : Pulumi.ResourceArgs + { + [Input("interval")] + public Input? Interval { get; set; } + + [Input("retries")] + public Input? Retries { get; set; } + + [Input("startPeriod")] + public Input? StartPeriod { get; set; } + + [Input("tests", required: true)] + private InputList? _tests; + public InputList Tests + { + get => _tests ?? (_tests = new InputList()); + set => _tests = value; + } + + [Input("timeout")] + public Input? Timeout { get; set; } + + public ContainerHealthcheckArgs() + { + } + } + + public sealed class ContainerHealthcheckGetArgs : Pulumi.ResourceArgs + { + [Input("interval")] + public Input? Interval { get; set; } + + [Input("retries")] + public Input? Retries { get; set; } + + [Input("startPeriod")] + public Input? StartPeriod { get; set; } + + [Input("tests", required: true)] + private InputList? _tests; + public InputList Tests + { + get => _tests ?? (_tests = new InputList()); + set => _tests = value; + } + + [Input("timeout")] + public Input? Timeout { get; set; } + + public ContainerHealthcheckGetArgs() + { + } + } + + public sealed class ContainerHostsArgs : Pulumi.ResourceArgs + { + /// + /// Hostname to add. + /// + [Input("host", required: true)] + public Input Host { get; set; } = null!; + + /// + /// IP address this hostname should resolve to. + /// + [Input("ip", required: true)] + public Input Ip { get; set; } = null!; + + public ContainerHostsArgs() + { + } + } + + public sealed class ContainerHostsGetArgs : Pulumi.ResourceArgs + { + /// + /// Hostname to add. + /// + [Input("host", required: true)] + public Input Host { get; set; } = null!; + + /// + /// IP address this hostname should resolve to. + /// + [Input("ip", required: true)] + public Input Ip { get; set; } = null!; + + public ContainerHostsGetArgs() + { + } + } + + public sealed class ContainerMountsArgs : Pulumi.ResourceArgs + { + /// + /// Optional configuration for the `bind` type. + /// + [Input("bindOptions")] + public Input? BindOptions { get; set; } + + /// + /// If true, this volume will be readonly. + /// Defaults to false. + /// + [Input("readOnly")] + public Input? ReadOnly { get; set; } + + /// + /// The mount source (e.g., a volume name, a host path) + /// + [Input("source")] + public Input? Source { get; set; } + + /// + /// The container path. + /// + [Input("target", required: true)] + public Input Target { get; set; } = null!; + + /// + /// Optional configuration for the `tmpf` type. + /// + [Input("tmpfsOptions")] + public Input? TmpfsOptions { get; set; } + + /// + /// The mount type: valid values are `bind|volume|tmpfs`. + /// + [Input("type", required: true)] + public Input Type { get; set; } = null!; + + /// + /// Optional configuration for the `volume` type. + /// + [Input("volumeOptions")] + public Input? VolumeOptions { get; set; } + + public ContainerMountsArgs() + { + } + } + + public sealed class ContainerMountsBindOptionsArgs : Pulumi.ResourceArgs + { + /// + /// A propagation mode with the value. + /// + [Input("propagation")] + public Input? Propagation { get; set; } + + public ContainerMountsBindOptionsArgs() + { + } + } + + public sealed class ContainerMountsBindOptionsGetArgs : Pulumi.ResourceArgs + { + /// + /// A propagation mode with the value. + /// + [Input("propagation")] + public Input? Propagation { get; set; } + + public ContainerMountsBindOptionsGetArgs() + { + } + } + + public sealed class ContainerMountsGetArgs : Pulumi.ResourceArgs + { + /// + /// Optional configuration for the `bind` type. + /// + [Input("bindOptions")] + public Input? BindOptions { get; set; } + + /// + /// If true, this volume will be readonly. + /// Defaults to false. + /// + [Input("readOnly")] + public Input? ReadOnly { get; set; } + + /// + /// The mount source (e.g., a volume name, a host path) + /// + [Input("source")] + public Input? Source { get; set; } + + /// + /// The container path. + /// + [Input("target", required: true)] + public Input Target { get; set; } = null!; + + /// + /// Optional configuration for the `tmpf` type. + /// + [Input("tmpfsOptions")] + public Input? TmpfsOptions { get; set; } + + /// + /// The mount type: valid values are `bind|volume|tmpfs`. + /// + [Input("type", required: true)] + public Input Type { get; set; } = null!; + + /// + /// Optional configuration for the `volume` type. + /// + [Input("volumeOptions")] + public Input? VolumeOptions { get; set; } + + public ContainerMountsGetArgs() + { + } + } + + public sealed class ContainerMountsTmpfsOptionsArgs : Pulumi.ResourceArgs + { + /// + /// The permission mode for the tmpfs mount in an integer. + /// + [Input("mode")] + public Input? Mode { get; set; } + + /// + /// The size for the tmpfs mount in bytes. + /// + [Input("sizeBytes")] + public Input? SizeBytes { get; set; } + + public ContainerMountsTmpfsOptionsArgs() + { + } + } + + public sealed class ContainerMountsTmpfsOptionsGetArgs : Pulumi.ResourceArgs + { + /// + /// The permission mode for the tmpfs mount in an integer. + /// + [Input("mode")] + public Input? Mode { get; set; } + + /// + /// The size for the tmpfs mount in bytes. + /// + [Input("sizeBytes")] + public Input? SizeBytes { get; set; } + + public ContainerMountsTmpfsOptionsGetArgs() + { + } + } + + public sealed class ContainerMountsVolumeOptionsArgs : Pulumi.ResourceArgs + { + [Input("driverName")] + public Input? DriverName { get; set; } + + [Input("driverOptions")] + private InputMap? _driverOptions; + + /// + /// Options for the driver. + /// + public InputMap DriverOptions + { + get => _driverOptions ?? (_driverOptions = new InputMap()); + set => _driverOptions = value; + } + + [Input("labels")] + private InputMap? _labels; + + /// + /// Adding labels. + /// + public InputMap Labels + { + get => _labels ?? (_labels = new InputMap()); + set => _labels = value; + } + + /// + /// Whether to populate volume with data from the target. + /// + [Input("noCopy")] + public Input? NoCopy { get; set; } + + public ContainerMountsVolumeOptionsArgs() + { + } + } + + public sealed class ContainerMountsVolumeOptionsGetArgs : Pulumi.ResourceArgs + { + [Input("driverName")] + public Input? DriverName { get; set; } + + [Input("driverOptions")] + private InputMap? _driverOptions; + + /// + /// Options for the driver. + /// + public InputMap DriverOptions + { + get => _driverOptions ?? (_driverOptions = new InputMap()); + set => _driverOptions = value; + } + + [Input("labels")] + private InputMap? _labels; + + /// + /// Adding labels. + /// + public InputMap Labels + { + get => _labels ?? (_labels = new InputMap()); + set => _labels = value; + } + + /// + /// Whether to populate volume with data from the target. + /// + [Input("noCopy")] + public Input? NoCopy { get; set; } + + public ContainerMountsVolumeOptionsGetArgs() + { + } + } + + public sealed class ContainerNetworkDatasGetArgs : Pulumi.ResourceArgs + { + /// + /// *Deprecated:* Use `network_data` instead. The network gateway of the container as read from its + /// NetworkSettings. + /// + [Input("gateway")] + public Input? Gateway { get; set; } + + /// + /// *Deprecated:* Use `network_data` instead. The IP address of the container's first network it. + /// + [Input("ipAddress")] + public Input? IpAddress { get; set; } + + /// + /// *Deprecated:* Use `network_data` instead. The IP prefix length of the container as read from its + /// NetworkSettings. + /// + [Input("ipPrefixLength")] + public Input? IpPrefixLength { get; set; } + + [Input("networkName")] + public Input? NetworkName { get; set; } + + public ContainerNetworkDatasGetArgs() + { + } + } + + public sealed class ContainerNetworksAdvancedArgs : Pulumi.ResourceArgs + { + [Input("aliases")] + private InputList? _aliases; + + /// + /// The network aliases of the container in the specific network. + /// + public InputList Aliases + { + get => _aliases ?? (_aliases = new InputList()); + set => _aliases = value; + } + + /// + /// The IPV4 address of the container in the specific network. + /// + [Input("ipv4Address")] + public Input? Ipv4Address { get; set; } + + /// + /// The IPV6 address of the container in the specific network. + /// + [Input("ipv6Address")] + public Input? Ipv6Address { get; set; } + + [Input("name", required: true)] + public Input Name { get; set; } = null!; + + public ContainerNetworksAdvancedArgs() + { + } + } + + public sealed class ContainerNetworksAdvancedGetArgs : Pulumi.ResourceArgs + { + [Input("aliases")] + private InputList? _aliases; + + /// + /// The network aliases of the container in the specific network. + /// + public InputList Aliases + { + get => _aliases ?? (_aliases = new InputList()); + set => _aliases = value; + } + + /// + /// The IPV4 address of the container in the specific network. + /// + [Input("ipv4Address")] + public Input? Ipv4Address { get; set; } + + /// + /// The IPV6 address of the container in the specific network. + /// + [Input("ipv6Address")] + public Input? Ipv6Address { get; set; } + + [Input("name", required: true)] + public Input Name { get; set; } = null!; + + public ContainerNetworksAdvancedGetArgs() + { + } + } + + public sealed class ContainerPortsArgs : Pulumi.ResourceArgs + { + /// + /// Port exposed out of the container. If not given a free random port `>= 32768` will be used. + /// + [Input("external")] + public Input? External { get; set; } + + /// + /// Port within the container. + /// + [Input("internal", required: true)] + public Input Internal { get; set; } = null!; + + /// + /// IP address this hostname should resolve to. + /// + [Input("ip")] + public Input? Ip { get; set; } + + /// + /// Protocol that can be used over this port, + /// defaults to `tcp`. + /// + [Input("protocol")] + public Input? Protocol { get; set; } + + public ContainerPortsArgs() + { + } + } + + public sealed class ContainerPortsGetArgs : Pulumi.ResourceArgs + { + /// + /// Port exposed out of the container. If not given a free random port `>= 32768` will be used. + /// + [Input("external")] + public Input? External { get; set; } + + /// + /// Port within the container. + /// + [Input("internal", required: true)] + public Input Internal { get; set; } = null!; + + /// + /// IP address this hostname should resolve to. + /// + [Input("ip")] + public Input? Ip { get; set; } + + /// + /// Protocol that can be used over this port, + /// defaults to `tcp`. + /// + [Input("protocol")] + public Input? Protocol { get; set; } + + public ContainerPortsGetArgs() + { + } + } + + public sealed class ContainerUlimitsArgs : Pulumi.ResourceArgs + { + [Input("hard", required: true)] + public Input Hard { get; set; } = null!; + + [Input("name", required: true)] + public Input Name { get; set; } = null!; + + [Input("soft", required: true)] + public Input Soft { get; set; } = null!; + + public ContainerUlimitsArgs() + { + } + } + + public sealed class ContainerUlimitsGetArgs : Pulumi.ResourceArgs + { + [Input("hard", required: true)] + public Input Hard { get; set; } = null!; + + [Input("name", required: true)] + public Input Name { get; set; } = null!; + + [Input("soft", required: true)] + public Input Soft { get; set; } = null!; + + public ContainerUlimitsGetArgs() + { + } + } + + public sealed class ContainerUploadsArgs : Pulumi.ResourceArgs + { + /// + /// Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text. + /// + [Input("content")] + public Input? Content { get; set; } + + [Input("contentBase64")] + public Input? ContentBase64 { get; set; } + + /// + /// If true, the file will be uploaded with user + /// executable permission. + /// Defaults to false. + /// + [Input("executable")] + public Input? Executable { get; set; } + + /// + /// path to a file in the container. + /// + [Input("file", required: true)] + public Input File { get; set; } = null!; + + public ContainerUploadsArgs() + { + } + } + + public sealed class ContainerUploadsGetArgs : Pulumi.ResourceArgs + { + /// + /// Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text. + /// + [Input("content")] + public Input? Content { get; set; } + + [Input("contentBase64")] + public Input? ContentBase64 { get; set; } + + /// + /// If true, the file will be uploaded with user + /// executable permission. + /// Defaults to false. + /// + [Input("executable")] + public Input? Executable { get; set; } + + /// + /// path to a file in the container. + /// + [Input("file", required: true)] + public Input File { get; set; } = null!; + + public ContainerUploadsGetArgs() + { + } + } + + public sealed class ContainerVolumesArgs : Pulumi.ResourceArgs + { + /// + /// The path in the container where the + /// device will be binded. + /// + [Input("containerPath")] + public Input? ContainerPath { get; set; } + + /// + /// The container where the volume is + /// coming from. + /// + [Input("fromContainer")] + public Input? FromContainer { get; set; } + + /// + /// The path on the host where the device + /// is located. + /// + [Input("hostPath")] + public Input? HostPath { get; set; } + + /// + /// If true, this volume will be readonly. + /// Defaults to false. + /// + [Input("readOnly")] + public Input? ReadOnly { get; set; } + + /// + /// The name of the docker volume which + /// should be mounted. + /// + [Input("volumeName")] + public Input? VolumeName { get; set; } + + public ContainerVolumesArgs() + { + } + } + + public sealed class ContainerVolumesGetArgs : Pulumi.ResourceArgs + { + /// + /// The path in the container where the + /// device will be binded. + /// + [Input("containerPath")] + public Input? ContainerPath { get; set; } + + /// + /// The container where the volume is + /// coming from. + /// + [Input("fromContainer")] + public Input? FromContainer { get; set; } + + /// + /// The path on the host where the device + /// is located. + /// + [Input("hostPath")] + public Input? HostPath { get; set; } + + /// + /// If true, this volume will be readonly. + /// Defaults to false. + /// + [Input("readOnly")] + public Input? ReadOnly { get; set; } + + /// + /// The name of the docker volume which + /// should be mounted. + /// + [Input("volumeName")] + public Input? VolumeName { get; set; } + + public ContainerVolumesGetArgs() + { + } + } + } + + namespace Outputs + { + + [OutputType] + public sealed class ContainerCapabilities + { + /// + /// list of linux capabilities to add. + /// + public readonly ImmutableArray Adds; + /// + /// list of linux capabilities to drop. + /// + public readonly ImmutableArray Drops; + + [OutputConstructor] + private ContainerCapabilities( + ImmutableArray adds, + ImmutableArray drops) + { + Adds = adds; + Drops = drops; + } + } + + [OutputType] + public sealed class ContainerDevices + { + /// + /// The path in the container where the + /// device will be binded. + /// + public readonly string? ContainerPath; + /// + /// The path on the host where the device + /// is located. + /// + public readonly string HostPath; + /// + /// The cgroup permissions given to the + /// container to access the device. + /// Defaults to `rwm`. + /// + public readonly string? Permissions; + + [OutputConstructor] + private ContainerDevices( + string? containerPath, + string hostPath, + string? permissions) + { + ContainerPath = containerPath; + HostPath = hostPath; + Permissions = permissions; + } + } + + [OutputType] + public sealed class ContainerHealthcheck + { + public readonly string? Interval; + public readonly int? Retries; + public readonly string? StartPeriod; + public readonly ImmutableArray Tests; + public readonly string? Timeout; + + [OutputConstructor] + private ContainerHealthcheck( + string? interval, + int? retries, + string? startPeriod, + ImmutableArray tests, + string? timeout) + { + Interval = interval; + Retries = retries; + StartPeriod = startPeriod; + Tests = tests; + Timeout = timeout; + } + } + + [OutputType] + public sealed class ContainerHosts + { + /// + /// Hostname to add. + /// + public readonly string Host; + /// + /// IP address this hostname should resolve to. + /// + public readonly string Ip; + + [OutputConstructor] + private ContainerHosts( + string host, + string ip) + { + Host = host; + Ip = ip; + } + } + + [OutputType] + public sealed class ContainerMounts + { + /// + /// Optional configuration for the `bind` type. + /// + public readonly ContainerMountsBindOptions? BindOptions; + /// + /// If true, this volume will be readonly. + /// Defaults to false. + /// + public readonly bool? ReadOnly; + /// + /// The mount source (e.g., a volume name, a host path) + /// + public readonly string? Source; + /// + /// The container path. + /// + public readonly string Target; + /// + /// Optional configuration for the `tmpf` type. + /// + public readonly ContainerMountsTmpfsOptions? TmpfsOptions; + /// + /// The mount type: valid values are `bind|volume|tmpfs`. + /// + public readonly string Type; + /// + /// Optional configuration for the `volume` type. + /// + public readonly ContainerMountsVolumeOptions? VolumeOptions; + + [OutputConstructor] + private ContainerMounts( + ContainerMountsBindOptions? bindOptions, + bool? readOnly, + string? source, + string target, + ContainerMountsTmpfsOptions? tmpfsOptions, + string type, + ContainerMountsVolumeOptions? volumeOptions) + { + BindOptions = bindOptions; + ReadOnly = readOnly; + Source = source; + Target = target; + TmpfsOptions = tmpfsOptions; + Type = type; + VolumeOptions = volumeOptions; + } + } + + [OutputType] + public sealed class ContainerMountsBindOptions + { + /// + /// A propagation mode with the value. + /// + public readonly string? Propagation; + + [OutputConstructor] + private ContainerMountsBindOptions(string? propagation) + { + Propagation = propagation; + } + } + + [OutputType] + public sealed class ContainerMountsTmpfsOptions + { + /// + /// The permission mode for the tmpfs mount in an integer. + /// + public readonly int? Mode; + /// + /// The size for the tmpfs mount in bytes. + /// + public readonly int? SizeBytes; + + [OutputConstructor] + private ContainerMountsTmpfsOptions( + int? mode, + int? sizeBytes) + { + Mode = mode; + SizeBytes = sizeBytes; + } + } + + [OutputType] + public sealed class ContainerMountsVolumeOptions + { + public readonly string? DriverName; + /// + /// Options for the driver. + /// + public readonly ImmutableDictionary? DriverOptions; + /// + /// Adding labels. + /// + public readonly ImmutableDictionary? Labels; + /// + /// Whether to populate volume with data from the target. + /// + public readonly bool? NoCopy; + + [OutputConstructor] + private ContainerMountsVolumeOptions( + string? driverName, + ImmutableDictionary? driverOptions, + ImmutableDictionary? labels, + bool? noCopy) + { + DriverName = driverName; + DriverOptions = driverOptions; + Labels = labels; + NoCopy = noCopy; + } + } + + [OutputType] + public sealed class ContainerNetworkDatas + { + /// + /// *Deprecated:* Use `network_data` instead. The network gateway of the container as read from its + /// NetworkSettings. + /// + public readonly string Gateway; + /// + /// *Deprecated:* Use `network_data` instead. The IP address of the container's first network it. + /// + public readonly string IpAddress; + /// + /// *Deprecated:* Use `network_data` instead. The IP prefix length of the container as read from its + /// NetworkSettings. + /// + public readonly int IpPrefixLength; + public readonly string NetworkName; + + [OutputConstructor] + private ContainerNetworkDatas( + string gateway, + string ipAddress, + int ipPrefixLength, + string networkName) + { + Gateway = gateway; + IpAddress = ipAddress; + IpPrefixLength = ipPrefixLength; + NetworkName = networkName; + } + } + + [OutputType] + public sealed class ContainerNetworksAdvanced + { + /// + /// The network aliases of the container in the specific network. + /// + public readonly ImmutableArray Aliases; + /// + /// The IPV4 address of the container in the specific network. + /// + public readonly string? Ipv4Address; + /// + /// The IPV6 address of the container in the specific network. + /// + public readonly string? Ipv6Address; + public readonly string Name; + + [OutputConstructor] + private ContainerNetworksAdvanced( + ImmutableArray aliases, + string? ipv4Address, + string? ipv6Address, + string name) + { + Aliases = aliases; + Ipv4Address = ipv4Address; + Ipv6Address = ipv6Address; + Name = name; + } + } + + [OutputType] + public sealed class ContainerPorts + { + /// + /// Port exposed out of the container. If not given a free random port `>= 32768` will be used. + /// + public readonly int External; + /// + /// Port within the container. + /// + public readonly int Internal; + /// + /// IP address this hostname should resolve to. + /// + public readonly string? Ip; + /// + /// Protocol that can be used over this port, + /// defaults to `tcp`. + /// + public readonly string? Protocol; + + [OutputConstructor] + private ContainerPorts( + int external, + int @internal, + string? ip, + string? protocol) + { + External = external; + Internal = @internal; + Ip = ip; + Protocol = protocol; + } + } + + [OutputType] + public sealed class ContainerUlimits + { + public readonly int Hard; + public readonly string Name; + public readonly int Soft; + + [OutputConstructor] + private ContainerUlimits( + int hard, + string name, + int soft) + { + Hard = hard; + Name = name; + Soft = soft; + } + } + + [OutputType] + public sealed class ContainerUploads + { + /// + /// Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text. + /// + public readonly string? Content; + public readonly string? ContentBase64; + /// + /// If true, the file will be uploaded with user + /// executable permission. + /// Defaults to false. + /// + public readonly bool? Executable; + /// + /// path to a file in the container. + /// + public readonly string File; + + [OutputConstructor] + private ContainerUploads( + string? content, + string? contentBase64, + bool? executable, + string file) + { + Content = content; + ContentBase64 = contentBase64; + Executable = executable; + File = file; + } + } + + [OutputType] + public sealed class ContainerVolumes + { + /// + /// The path in the container where the + /// device will be binded. + /// + public readonly string? ContainerPath; + /// + /// The container where the volume is + /// coming from. + /// + public readonly string? FromContainer; + /// + /// The path on the host where the device + /// is located. + /// + public readonly string? HostPath; + /// + /// If true, this volume will be readonly. + /// Defaults to false. + /// + public readonly bool? ReadOnly; + /// + /// The name of the docker volume which + /// should be mounted. + /// + public readonly string? VolumeName; + + [OutputConstructor] + private ContainerVolumes( + string? containerPath, + string? fromContainer, + string? hostPath, + bool? readOnly, + string? volumeName) + { + ContainerPath = containerPath; + FromContainer = fromContainer; + HostPath = hostPath; + ReadOnly = readOnly; + VolumeName = volumeName; + } + } + } +} diff --git a/sdk/dotnet/GetNetwork.cs b/sdk/dotnet/GetNetwork.cs new file mode 100644 index 00000000..74861e8a --- /dev/null +++ b/sdk/dotnet/GetNetwork.cs @@ -0,0 +1,145 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Docker +{ + public static partial class Invokes + { + /// + /// Finds a specific docker network and returns information about it. + /// + /// > This content is derived from https://github.com/terraform-providers/terraform-provider-docker/blob/master/website/docs/d/network.html.markdown. + /// + public static Task GetNetwork(GetNetworkArgs? args = null, InvokeOptions? options = null) + => Pulumi.Deployment.Instance.InvokeAsync("docker:index/getNetwork:getNetwork", args ?? InvokeArgs.Empty, options.WithVersion()); + } + + public sealed class GetNetworkArgs : Pulumi.InvokeArgs + { + /// + /// The id of the Docker network. + /// + [Input("id")] + public string? Id { get; set; } + + [Input("ipamConfigs")] + private List? _ipamConfigs; + public List IpamConfigs + { + get => _ipamConfigs ?? (_ipamConfigs = new List()); + set => _ipamConfigs = value; + } + + /// + /// The name of the Docker network. + /// + [Input("name")] + public string? Name { get; set; } + + public GetNetworkArgs() + { + } + } + + [OutputType] + public sealed class GetNetworkResult + { + /// + /// (Optional, string) The driver of the Docker network. + /// Possible values are `bridge`, `host`, `overlay`, `macvlan`. + /// See [docker docs][networkdocs] for more details. + /// + public readonly string Driver; + public readonly string? Id; + public readonly bool Internal; + public readonly ImmutableArray IpamConfigs; + public readonly string? Name; + /// + /// (Optional, map) Only available with bridge networks. See + /// [docker docs][bridgeoptionsdocs] for more details. + /// * `internal` (Optional, bool) Boolean flag for whether the network is internal. + /// * `ipam_config` (Optional, map) See IPAM below for details. + /// * `scope` (Optional, string) Scope of the network. One of `swarm`, `global`, or `local`. + /// + public readonly ImmutableDictionary Options; + public readonly string Scope; + + [OutputConstructor] + private GetNetworkResult( + string driver, + string? id, + bool @internal, + ImmutableArray ipamConfigs, + string? name, + ImmutableDictionary options, + string scope) + { + Driver = driver; + Id = id; + Internal = @internal; + IpamConfigs = ipamConfigs; + Name = name; + Options = options; + Scope = scope; + } + } + + namespace Inputs + { + + public sealed class GetNetworkIpamConfigsArgs : Pulumi.InvokeArgs + { + [Input("auxAddress")] + private Dictionary? _auxAddress; + public Dictionary AuxAddress + { + get => _auxAddress ?? (_auxAddress = new Dictionary()); + set => _auxAddress = value; + } + + [Input("gateway")] + public string? Gateway { get; set; } + + [Input("ipRange")] + public string? IpRange { get; set; } + + [Input("subnet")] + public string? Subnet { get; set; } + + public GetNetworkIpamConfigsArgs() + { + } + } + } + + namespace Outputs + { + + [OutputType] + public sealed class GetNetworkIpamConfigsResult + { + public readonly ImmutableDictionary? AuxAddress; + public readonly string? Gateway; + public readonly string? IpRange; + public readonly string? Subnet; + + [OutputConstructor] + private GetNetworkIpamConfigsResult( + ImmutableDictionary? auxAddress, + string? gateway, + string? ipRange, + string? subnet) + { + AuxAddress = auxAddress; + Gateway = gateway; + IpRange = ipRange; + Subnet = subnet; + } + } + } +} diff --git a/sdk/dotnet/GetRegistryImage.cs b/sdk/dotnet/GetRegistryImage.cs new file mode 100644 index 00000000..0be13d70 --- /dev/null +++ b/sdk/dotnet/GetRegistryImage.cs @@ -0,0 +1,58 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Docker +{ + public static partial class Invokes + { + /// + /// Reads the image metadata from a Docker Registry. Used in conjunction with the + /// [docker\_image](https://www.terraform.io/docs/providers/docker/r/image.html) resource to keep an image up + /// to date on the latest available version of the tag. + /// + /// > This content is derived from https://github.com/terraform-providers/terraform-provider-docker/blob/master/website/docs/d/registry_image.html.markdown. + /// + public static Task GetRegistryImage(GetRegistryImageArgs? args = null, InvokeOptions? options = null) + => Pulumi.Deployment.Instance.InvokeAsync("docker:index/getRegistryImage:getRegistryImage", args ?? InvokeArgs.Empty, options.WithVersion()); + } + + public sealed class GetRegistryImageArgs : Pulumi.InvokeArgs + { + /// + /// The name of the Docker image, including any tags. e.g. `alpine:latest` + /// + [Input("name")] + public string? Name { get; set; } + + public GetRegistryImageArgs() + { + } + } + + [OutputType] + public sealed class GetRegistryImageResult + { + public readonly string? Name; + public readonly string Sha256Digest; + /// + /// id is the provider-assigned unique ID for this managed resource. + /// + public readonly string Id; + + [OutputConstructor] + private GetRegistryImageResult( + string? name, + string sha256Digest, + string id) + { + Name = name; + Sha256Digest = sha256Digest; + Id = id; + } + } +} diff --git a/sdk/dotnet/Network.cs b/sdk/dotnet/Network.cs new file mode 100644 index 00000000..f39b2d66 --- /dev/null +++ b/sdk/dotnet/Network.cs @@ -0,0 +1,422 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Docker +{ + /// + /// Manages a Docker Network. This can be used alongside + /// [docker\_container](https://www.terraform.io/docs/providers/docker/r/container.html) + /// to create virtual networks within the docker environment. + /// + /// > This content is derived from https://github.com/terraform-providers/terraform-provider-docker/blob/master/website/docs/r/network.html.markdown. + /// + public partial class Network : Pulumi.CustomResource + { + /// + /// Enable manual container attachment to the network. + /// Defaults to `false`. + /// + [Output("attachable")] + public Output Attachable { get; private set; } = null!; + + /// + /// Requests daemon to check for networks + /// with same name. + /// + [Output("checkDuplicate")] + public Output CheckDuplicate { get; private set; } = null!; + + /// + /// Name of the network driver to use. Defaults to + /// `bridge` driver. + /// + [Output("driver")] + public Output Driver { get; private set; } = null!; + + /// + /// Create swarm routing-mesh network. + /// Defaults to `false`. + /// + [Output("ingress")] + public Output Ingress { get; private set; } = null!; + + /// + /// Restrict external access to the network. + /// Defaults to `false`. + /// + [Output("internal")] + public Output Internal { get; private set; } = null!; + + /// + /// See IPAM config below for + /// details. + /// + [Output("ipamConfigs")] + public Output> IpamConfigs { get; private set; } = null!; + + /// + /// Driver used by the custom IP scheme of the + /// network. + /// + [Output("ipamDriver")] + public Output IpamDriver { get; private set; } = null!; + + /// + /// Enable IPv6 networking. + /// Defaults to `false`. + /// + [Output("ipv6")] + public Output Ipv6 { get; private set; } = null!; + + /// + /// User-defined key/value metadata. + /// + [Output("labels")] + public Output?> Labels { get; private set; } = null!; + + /// + /// The name of the Docker network. + /// + [Output("name")] + public Output Name { get; private set; } = null!; + + /// + /// Network specific options to be used by + /// the drivers. + /// + [Output("options")] + public Output> Options { get; private set; } = null!; + + [Output("scope")] + public Output Scope { get; private set; } = null!; + + + /// + /// Create a Network resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public Network(string name, NetworkArgs? args = null, CustomResourceOptions? options = null) + : base("docker:index/network:Network", name, args ?? ResourceArgs.Empty, MakeResourceOptions(options, "")) + { + } + + private Network(string name, Input id, NetworkState? state = null, CustomResourceOptions? options = null) + : base("docker:index/network:Network", name, state, MakeResourceOptions(options, id)) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + }; + var merged = CustomResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + /// + /// Get an existing Network resource's state with the given name, ID, and optional extra + /// properties used to qualify the lookup. + /// + /// + /// The unique name of the resulting resource. + /// The unique provider ID of the resource to lookup. + /// Any extra arguments used during the lookup. + /// A bag of options that control this resource's behavior + public static Network Get(string name, Input id, NetworkState? state = null, CustomResourceOptions? options = null) + { + return new Network(name, id, state, options); + } + } + + public sealed class NetworkArgs : Pulumi.ResourceArgs + { + /// + /// Enable manual container attachment to the network. + /// Defaults to `false`. + /// + [Input("attachable")] + public Input? Attachable { get; set; } + + /// + /// Requests daemon to check for networks + /// with same name. + /// + [Input("checkDuplicate")] + public Input? CheckDuplicate { get; set; } + + /// + /// Name of the network driver to use. Defaults to + /// `bridge` driver. + /// + [Input("driver")] + public Input? Driver { get; set; } + + /// + /// Create swarm routing-mesh network. + /// Defaults to `false`. + /// + [Input("ingress")] + public Input? Ingress { get; set; } + + /// + /// Restrict external access to the network. + /// Defaults to `false`. + /// + [Input("internal")] + public Input? Internal { get; set; } + + [Input("ipamConfigs")] + private InputList? _ipamConfigs; + + /// + /// See IPAM config below for + /// details. + /// + public InputList IpamConfigs + { + get => _ipamConfigs ?? (_ipamConfigs = new InputList()); + set => _ipamConfigs = value; + } + + /// + /// Driver used by the custom IP scheme of the + /// network. + /// + [Input("ipamDriver")] + public Input? IpamDriver { get; set; } + + /// + /// Enable IPv6 networking. + /// Defaults to `false`. + /// + [Input("ipv6")] + public Input? Ipv6 { get; set; } + + [Input("labels")] + private InputMap? _labels; + + /// + /// User-defined key/value metadata. + /// + public InputMap Labels + { + get => _labels ?? (_labels = new InputMap()); + set => _labels = value; + } + + /// + /// The name of the Docker network. + /// + [Input("name")] + public Input? Name { get; set; } + + [Input("options")] + private InputMap? _options; + + /// + /// Network specific options to be used by + /// the drivers. + /// + public InputMap Options + { + get => _options ?? (_options = new InputMap()); + set => _options = value; + } + + public NetworkArgs() + { + } + } + + public sealed class NetworkState : Pulumi.ResourceArgs + { + /// + /// Enable manual container attachment to the network. + /// Defaults to `false`. + /// + [Input("attachable")] + public Input? Attachable { get; set; } + + /// + /// Requests daemon to check for networks + /// with same name. + /// + [Input("checkDuplicate")] + public Input? CheckDuplicate { get; set; } + + /// + /// Name of the network driver to use. Defaults to + /// `bridge` driver. + /// + [Input("driver")] + public Input? Driver { get; set; } + + /// + /// Create swarm routing-mesh network. + /// Defaults to `false`. + /// + [Input("ingress")] + public Input? Ingress { get; set; } + + /// + /// Restrict external access to the network. + /// Defaults to `false`. + /// + [Input("internal")] + public Input? Internal { get; set; } + + [Input("ipamConfigs")] + private InputList? _ipamConfigs; + + /// + /// See IPAM config below for + /// details. + /// + public InputList IpamConfigs + { + get => _ipamConfigs ?? (_ipamConfigs = new InputList()); + set => _ipamConfigs = value; + } + + /// + /// Driver used by the custom IP scheme of the + /// network. + /// + [Input("ipamDriver")] + public Input? IpamDriver { get; set; } + + /// + /// Enable IPv6 networking. + /// Defaults to `false`. + /// + [Input("ipv6")] + public Input? Ipv6 { get; set; } + + [Input("labels")] + private InputMap? _labels; + + /// + /// User-defined key/value metadata. + /// + public InputMap Labels + { + get => _labels ?? (_labels = new InputMap()); + set => _labels = value; + } + + /// + /// The name of the Docker network. + /// + [Input("name")] + public Input? Name { get; set; } + + [Input("options")] + private InputMap? _options; + + /// + /// Network specific options to be used by + /// the drivers. + /// + public InputMap Options + { + get => _options ?? (_options = new InputMap()); + set => _options = value; + } + + [Input("scope")] + public Input? Scope { get; set; } + + public NetworkState() + { + } + } + + namespace Inputs + { + + public sealed class NetworkIpamConfigsArgs : Pulumi.ResourceArgs + { + [Input("auxAddress")] + private InputMap? _auxAddress; + public InputMap AuxAddress + { + get => _auxAddress ?? (_auxAddress = new InputMap()); + set => _auxAddress = value; + } + + [Input("gateway")] + public Input? Gateway { get; set; } + + [Input("ipRange")] + public Input? IpRange { get; set; } + + [Input("subnet")] + public Input? Subnet { get; set; } + + public NetworkIpamConfigsArgs() + { + } + } + + public sealed class NetworkIpamConfigsGetArgs : Pulumi.ResourceArgs + { + [Input("auxAddress")] + private InputMap? _auxAddress; + public InputMap AuxAddress + { + get => _auxAddress ?? (_auxAddress = new InputMap()); + set => _auxAddress = value; + } + + [Input("gateway")] + public Input? Gateway { get; set; } + + [Input("ipRange")] + public Input? IpRange { get; set; } + + [Input("subnet")] + public Input? Subnet { get; set; } + + public NetworkIpamConfigsGetArgs() + { + } + } + } + + namespace Outputs + { + + [OutputType] + public sealed class NetworkIpamConfigs + { + public readonly ImmutableDictionary? AuxAddress; + public readonly string? Gateway; + public readonly string? IpRange; + public readonly string? Subnet; + + [OutputConstructor] + private NetworkIpamConfigs( + ImmutableDictionary? auxAddress, + string? gateway, + string? ipRange, + string? subnet) + { + AuxAddress = auxAddress; + Gateway = gateway; + IpRange = ipRange; + Subnet = subnet; + } + } + } +} diff --git a/sdk/dotnet/Provider.cs b/sdk/dotnet/Provider.cs new file mode 100644 index 00000000..51f9f767 --- /dev/null +++ b/sdk/dotnet/Provider.cs @@ -0,0 +1,118 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Docker +{ + /// + /// The provider type for the docker 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. + /// + /// > This content is derived from https://github.com/terraform-providers/terraform-provider-docker/blob/master/website/docs/index.html.markdown. + /// + public partial class Provider : Pulumi.ProviderResource + { + /// + /// Create a Provider resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public Provider(string name, ProviderArgs? args = null, ResourceOptions? options = null) + : base("docker", name, args ?? ResourceArgs.Empty, MakeResourceOptions(options, "")) + { + } + + private static ResourceOptions MakeResourceOptions(ResourceOptions? options, Input? id) + { + var defaultOptions = new ResourceOptions + { + Version = Utilities.Version, + }; + var merged = ResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + } + + public sealed class ProviderArgs : Pulumi.ResourceArgs + { + /// + /// PEM-encoded content of Docker host CA certificate + /// + [Input("caMaterial")] + public Input? CaMaterial { get; set; } + + /// + /// PEM-encoded content of Docker client certificate + /// + [Input("certMaterial")] + public Input? CertMaterial { get; set; } + + /// + /// Path to directory with Docker TLS config + /// + [Input("certPath")] + public Input? CertPath { get; set; } + + /// + /// The Docker daemon address + /// + [Input("host")] + public Input? Host { get; set; } + + /// + /// PEM-encoded content of Docker client private key + /// + [Input("keyMaterial")] + public Input? KeyMaterial { get; set; } + + [Input("registryAuth", json: true)] + private InputList? _registryAuth; + public InputList RegistryAuth + { + get => _registryAuth ?? (_registryAuth = new InputList()); + set => _registryAuth = value; + } + + public ProviderArgs() + { + CaMaterial = Utilities.GetEnv("DOCKER_CA_MATERIAL"); + CertMaterial = Utilities.GetEnv("DOCKER_CERT_MATERIAL"); + CertPath = Utilities.GetEnv("DOCKER_CERT_PATH"); + Host = Utilities.GetEnv("DOCKER_HOST") ?? "unix:///var/run/docker.sock"; + KeyMaterial = Utilities.GetEnv("DOCKER_KEY_MATERIAL"); + } + } + + namespace Inputs + { + + public sealed class ProviderRegistryAuthArgs : Pulumi.ResourceArgs + { + [Input("address", required: true)] + public Input Address { get; set; } = null!; + + [Input("configFile")] + public Input? ConfigFile { get; set; } + + [Input("password")] + public Input? Password { get; set; } + + [Input("username")] + public Input? Username { get; set; } + + public ProviderRegistryAuthArgs() + { + } + } + } +} diff --git a/sdk/dotnet/Pulumi.Docker.csproj b/sdk/dotnet/Pulumi.Docker.csproj index 5200744d..4565ceef 100644 --- a/sdk/dotnet/Pulumi.Docker.csproj +++ b/sdk/dotnet/Pulumi.Docker.csproj @@ -4,7 +4,7 @@ true Pulumi Corp. Pulumi Corp. - A Pulumi package for interacting with Docker in Pulumi programs. + A Pulumi package for interacting with Docker in Pulumi programs Apache-2.0 https://pulumi.io https://github.com/pulumi/pulumi-docker @@ -25,7 +25,7 @@ - + diff --git a/sdk/dotnet/Pulumi.yaml b/sdk/dotnet/Pulumi.yaml new file mode 100644 index 00000000..be890e77 --- /dev/null +++ b/sdk/dotnet/Pulumi.yaml @@ -0,0 +1,3 @@ +name: docker +description: A Pulumi resource provider for docker. +language: dotnet diff --git a/sdk/dotnet/README.md b/sdk/dotnet/README.md new file mode 100644 index 00000000..7745bbfe --- /dev/null +++ b/sdk/dotnet/README.md @@ -0,0 +1,4 @@ +> This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-docker) +> distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature, +> first check the [`pulumi/pulumi-docker` repo](https://github.com/pulumi/pulumi-docker/issues); however, if that doesn't turn up anything, +> please consult the source [`terraform-providers/terraform-provider-docker` repo](https://github.com/terraform-providers/terraform-provider-docker/issues). diff --git a/sdk/dotnet/RemoteImage.cs b/sdk/dotnet/RemoteImage.cs new file mode 100644 index 00000000..665eca65 --- /dev/null +++ b/sdk/dotnet/RemoteImage.cs @@ -0,0 +1,184 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Docker +{ + /// + /// Pulls a Docker image to a given Docker host from a Docker Registry. + /// + /// This resource will *not* pull new layers of the image automatically unless used in + /// conjunction with [`docker..getRegistryImage`](https://www.terraform.io/docs/providers/docker/d/registry_image.html) + /// data source to update the `pull_triggers` field. + /// + /// > This content is derived from https://github.com/terraform-providers/terraform-provider-docker/blob/master/website/docs/r/image.html.markdown. + /// + public partial class RemoteImage : Pulumi.CustomResource + { + /// + /// If true, then the Docker image won't be + /// deleted on destroy operation. If this is false, it will delete the image from + /// the docker local storage on destroy operation. + /// + [Output("keepLocally")] + public Output KeepLocally { get; private set; } = null!; + + [Output("latest")] + public Output Latest { get; private set; } = null!; + + /// + /// The name of the Docker image, including any tags or SHA256 repo digests. + /// + [Output("name")] + public Output Name { get; private set; } = null!; + + /// + /// **Deprecated**, use `pull_triggers` instead. + /// + [Output("pullTrigger")] + public Output PullTrigger { get; private set; } = null!; + + /// + /// List of values which cause an + /// image pull when changed. This is used to store the image digest from the + /// registry when using the `docker..getRegistryImage` [data source](https://www.terraform.io/docs/providers/docker/d/registry_image.html) + /// to trigger an image update. + /// + [Output("pullTriggers")] + public Output> PullTriggers { get; private set; } = null!; + + + /// + /// Create a RemoteImage resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public RemoteImage(string name, RemoteImageArgs args, CustomResourceOptions? options = null) + : base("docker:index/remoteImage:RemoteImage", name, args ?? ResourceArgs.Empty, MakeResourceOptions(options, "")) + { + } + + private RemoteImage(string name, Input id, RemoteImageState? state = null, CustomResourceOptions? options = null) + : base("docker:index/remoteImage:RemoteImage", name, state, MakeResourceOptions(options, id)) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + }; + var merged = CustomResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + /// + /// Get an existing RemoteImage resource's state with the given name, ID, and optional extra + /// properties used to qualify the lookup. + /// + /// + /// The unique name of the resulting resource. + /// The unique provider ID of the resource to lookup. + /// Any extra arguments used during the lookup. + /// A bag of options that control this resource's behavior + public static RemoteImage Get(string name, Input id, RemoteImageState? state = null, CustomResourceOptions? options = null) + { + return new RemoteImage(name, id, state, options); + } + } + + public sealed class RemoteImageArgs : Pulumi.ResourceArgs + { + /// + /// If true, then the Docker image won't be + /// deleted on destroy operation. If this is false, it will delete the image from + /// the docker local storage on destroy operation. + /// + [Input("keepLocally")] + public Input? KeepLocally { get; set; } + + /// + /// The name of the Docker image, including any tags or SHA256 repo digests. + /// + [Input("name", required: true)] + public Input Name { get; set; } = null!; + + /// + /// **Deprecated**, use `pull_triggers` instead. + /// + [Input("pullTrigger")] + public Input? PullTrigger { get; set; } + + [Input("pullTriggers")] + private InputList? _pullTriggers; + + /// + /// List of values which cause an + /// image pull when changed. This is used to store the image digest from the + /// registry when using the `docker..getRegistryImage` [data source](https://www.terraform.io/docs/providers/docker/d/registry_image.html) + /// to trigger an image update. + /// + public InputList PullTriggers + { + get => _pullTriggers ?? (_pullTriggers = new InputList()); + set => _pullTriggers = value; + } + + public RemoteImageArgs() + { + } + } + + public sealed class RemoteImageState : Pulumi.ResourceArgs + { + /// + /// If true, then the Docker image won't be + /// deleted on destroy operation. If this is false, it will delete the image from + /// the docker local storage on destroy operation. + /// + [Input("keepLocally")] + public Input? KeepLocally { get; set; } + + [Input("latest")] + public Input? Latest { get; set; } + + /// + /// The name of the Docker image, including any tags or SHA256 repo digests. + /// + [Input("name")] + public Input? Name { get; set; } + + /// + /// **Deprecated**, use `pull_triggers` instead. + /// + [Input("pullTrigger")] + public Input? PullTrigger { get; set; } + + [Input("pullTriggers")] + private InputList? _pullTriggers; + + /// + /// List of values which cause an + /// image pull when changed. This is used to store the image digest from the + /// registry when using the `docker..getRegistryImage` [data source](https://www.terraform.io/docs/providers/docker/d/registry_image.html) + /// to trigger an image update. + /// + public InputList PullTriggers + { + get => _pullTriggers ?? (_pullTriggers = new InputList()); + set => _pullTriggers = value; + } + + public RemoteImageState() + { + } + } +} diff --git a/sdk/dotnet/Secret.cs b/sdk/dotnet/Secret.cs new file mode 100644 index 00000000..4c33a790 --- /dev/null +++ b/sdk/dotnet/Secret.cs @@ -0,0 +1,141 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Docker +{ + /// + /// Manages the secrets of a Docker service in a swarm. + /// + /// > This content is derived from https://github.com/terraform-providers/terraform-provider-docker/blob/master/website/docs/r/secret.html.markdown. + /// + public partial class Secret : Pulumi.CustomResource + { + /// + /// The base64 encoded data of the secret. + /// + [Output("data")] + public Output Data { get; private set; } = null!; + + /// + /// User-defined key/value metadata. + /// + [Output("labels")] + public Output?> Labels { get; private set; } = null!; + + /// + /// The name of the Docker secret. + /// + [Output("name")] + public Output Name { get; private set; } = null!; + + + /// + /// Create a Secret resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public Secret(string name, SecretArgs args, CustomResourceOptions? options = null) + : base("docker:index/secret:Secret", name, args ?? ResourceArgs.Empty, MakeResourceOptions(options, "")) + { + } + + private Secret(string name, Input id, SecretState? state = null, CustomResourceOptions? options = null) + : base("docker:index/secret:Secret", name, state, MakeResourceOptions(options, id)) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + }; + var merged = CustomResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + /// + /// Get an existing Secret resource's state with the given name, ID, and optional extra + /// properties used to qualify the lookup. + /// + /// + /// The unique name of the resulting resource. + /// The unique provider ID of the resource to lookup. + /// Any extra arguments used during the lookup. + /// A bag of options that control this resource's behavior + public static Secret Get(string name, Input id, SecretState? state = null, CustomResourceOptions? options = null) + { + return new Secret(name, id, state, options); + } + } + + public sealed class SecretArgs : Pulumi.ResourceArgs + { + /// + /// The base64 encoded data of the secret. + /// + [Input("data", required: true)] + public Input Data { get; set; } = null!; + + [Input("labels")] + private InputMap? _labels; + + /// + /// User-defined key/value metadata. + /// + public InputMap Labels + { + get => _labels ?? (_labels = new InputMap()); + set => _labels = value; + } + + /// + /// The name of the Docker secret. + /// + [Input("name")] + public Input? Name { get; set; } + + public SecretArgs() + { + } + } + + public sealed class SecretState : Pulumi.ResourceArgs + { + /// + /// The base64 encoded data of the secret. + /// + [Input("data")] + public Input? Data { get; set; } + + [Input("labels")] + private InputMap? _labels; + + /// + /// User-defined key/value metadata. + /// + public InputMap Labels + { + get => _labels ?? (_labels = new InputMap()); + set => _labels = value; + } + + /// + /// The name of the Docker secret. + /// + [Input("name")] + public Input? Name { get; set; } + + public SecretState() + { + } + } +} diff --git a/sdk/dotnet/Service.cs b/sdk/dotnet/Service.cs new file mode 100644 index 00000000..dad12942 --- /dev/null +++ b/sdk/dotnet/Service.cs @@ -0,0 +1,2468 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Docker +{ + /// + /// > This content is derived from https://github.com/terraform-providers/terraform-provider-docker/blob/master/website/docs/r/service.html.markdown. + /// + public partial class Service : Pulumi.CustomResource + { + /// + /// See Auth below for details. + /// + [Output("auth")] + public Output Auth { get; private set; } = null!; + + /// + /// See Converge Config below for details. + /// + [Output("convergeConfig")] + public Output ConvergeConfig { get; private set; } = null!; + + /// + /// See EndpointSpec below for details. + /// + [Output("endpointSpec")] + public Output EndpointSpec { get; private set; } = null!; + + /// + /// User-defined key/value metadata + /// + [Output("labels")] + public Output> Labels { get; private set; } = null!; + + /// + /// The mode of resolution to use for internal load balancing between tasks. `(vip|dnsrr)`. Default: `vip`. + /// + [Output("mode")] + public Output Mode { get; private set; } = null!; + + /// + /// A random name for the port. + /// + [Output("name")] + public Output Name { get; private set; } = null!; + + /// + /// See RollbackConfig below for details. + /// + [Output("rollbackConfig")] + public Output RollbackConfig { get; private set; } = null!; + + /// + /// See TaskSpec below for details. + /// + [Output("taskSpec")] + public Output TaskSpec { get; private set; } = null!; + + /// + /// See UpdateConfig below for details. + /// + [Output("updateConfig")] + public Output UpdateConfig { get; private set; } = null!; + + + /// + /// Create a Service resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public Service(string name, ServiceArgs args, CustomResourceOptions? options = null) + : base("docker:index/service:Service", name, args ?? ResourceArgs.Empty, MakeResourceOptions(options, "")) + { + } + + private Service(string name, Input id, ServiceState? state = null, CustomResourceOptions? options = null) + : base("docker:index/service:Service", name, state, MakeResourceOptions(options, id)) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + }; + var merged = CustomResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + /// + /// Get an existing Service resource's state with the given name, ID, and optional extra + /// properties used to qualify the lookup. + /// + /// + /// The unique name of the resulting resource. + /// The unique provider ID of the resource to lookup. + /// Any extra arguments used during the lookup. + /// A bag of options that control this resource's behavior + public static Service Get(string name, Input id, ServiceState? state = null, CustomResourceOptions? options = null) + { + return new Service(name, id, state, options); + } + } + + public sealed class ServiceArgs : Pulumi.ResourceArgs + { + /// + /// See Auth below for details. + /// + [Input("auth")] + public Input? Auth { get; set; } + + /// + /// See Converge Config below for details. + /// + [Input("convergeConfig")] + public Input? ConvergeConfig { get; set; } + + /// + /// See EndpointSpec below for details. + /// + [Input("endpointSpec")] + public Input? EndpointSpec { get; set; } + + [Input("labels")] + private InputMap? _labels; + + /// + /// User-defined key/value metadata + /// + public InputMap Labels + { + get => _labels ?? (_labels = new InputMap()); + set => _labels = value; + } + + /// + /// The mode of resolution to use for internal load balancing between tasks. `(vip|dnsrr)`. Default: `vip`. + /// + [Input("mode")] + public Input? Mode { get; set; } + + /// + /// A random name for the port. + /// + [Input("name")] + public Input? Name { get; set; } + + /// + /// See RollbackConfig below for details. + /// + [Input("rollbackConfig")] + public Input? RollbackConfig { get; set; } + + /// + /// See TaskSpec below for details. + /// + [Input("taskSpec", required: true)] + public Input TaskSpec { get; set; } = null!; + + /// + /// See UpdateConfig below for details. + /// + [Input("updateConfig")] + public Input? UpdateConfig { get; set; } + + public ServiceArgs() + { + } + } + + public sealed class ServiceState : Pulumi.ResourceArgs + { + /// + /// See Auth below for details. + /// + [Input("auth")] + public Input? Auth { get; set; } + + /// + /// See Converge Config below for details. + /// + [Input("convergeConfig")] + public Input? ConvergeConfig { get; set; } + + /// + /// See EndpointSpec below for details. + /// + [Input("endpointSpec")] + public Input? EndpointSpec { get; set; } + + [Input("labels")] + private InputMap? _labels; + + /// + /// User-defined key/value metadata + /// + public InputMap Labels + { + get => _labels ?? (_labels = new InputMap()); + set => _labels = value; + } + + /// + /// The mode of resolution to use for internal load balancing between tasks. `(vip|dnsrr)`. Default: `vip`. + /// + [Input("mode")] + public Input? Mode { get; set; } + + /// + /// A random name for the port. + /// + [Input("name")] + public Input? Name { get; set; } + + /// + /// See RollbackConfig below for details. + /// + [Input("rollbackConfig")] + public Input? RollbackConfig { get; set; } + + /// + /// See TaskSpec below for details. + /// + [Input("taskSpec")] + public Input? TaskSpec { get; set; } + + /// + /// See UpdateConfig below for details. + /// + [Input("updateConfig")] + public Input? UpdateConfig { get; set; } + + public ServiceState() + { + } + } + + namespace Inputs + { + + public sealed class ServiceAuthArgs : Pulumi.ResourceArgs + { + /// + /// The password to use for authenticating to the registry. If this is blank, the `DOCKER_REGISTRY_PASS` is also be checked. + /// + [Input("password")] + public Input? Password { get; set; } + + /// + /// The address of the registry server + /// + [Input("serverAddress", required: true)] + public Input ServerAddress { get; set; } = null!; + + /// + /// The username to use for authenticating to the registry. If this is blank, the `DOCKER_REGISTRY_USER` is also be checked. + /// + [Input("username")] + public Input? Username { get; set; } + + public ServiceAuthArgs() + { + } + } + + public sealed class ServiceAuthGetArgs : Pulumi.ResourceArgs + { + /// + /// The password to use for authenticating to the registry. If this is blank, the `DOCKER_REGISTRY_PASS` is also be checked. + /// + [Input("password")] + public Input? Password { get; set; } + + /// + /// The address of the registry server + /// + [Input("serverAddress", required: true)] + public Input ServerAddress { get; set; } = null!; + + /// + /// The username to use for authenticating to the registry. If this is blank, the `DOCKER_REGISTRY_USER` is also be checked. + /// + [Input("username")] + public Input? Username { get; set; } + + public ServiceAuthGetArgs() + { + } + } + + public sealed class ServiceConvergeConfigArgs : Pulumi.ResourceArgs + { + [Input("delay")] + public Input? Delay { get; set; } + + [Input("timeout")] + public Input? Timeout { get; set; } + + public ServiceConvergeConfigArgs() + { + } + } + + public sealed class ServiceConvergeConfigGetArgs : Pulumi.ResourceArgs + { + [Input("delay")] + public Input? Delay { get; set; } + + [Input("timeout")] + public Input? Timeout { get; set; } + + public ServiceConvergeConfigGetArgs() + { + } + } + + public sealed class ServiceEndpointSpecArgs : Pulumi.ResourceArgs + { + /// + /// The mode of resolution to use for internal load balancing between tasks. `(vip|dnsrr)`. Default: `vip`. + /// + [Input("mode")] + public Input? Mode { get; set; } + + [Input("ports")] + private InputList? _ports; + + /// + /// See Ports below for details. + /// + public InputList Ports + { + get => _ports ?? (_ports = new InputList()); + set => _ports = value; + } + + public ServiceEndpointSpecArgs() + { + } + } + + public sealed class ServiceEndpointSpecGetArgs : Pulumi.ResourceArgs + { + /// + /// The mode of resolution to use for internal load balancing between tasks. `(vip|dnsrr)`. Default: `vip`. + /// + [Input("mode")] + public Input? Mode { get; set; } + + [Input("ports")] + private InputList? _ports; + + /// + /// See Ports below for details. + /// + public InputList Ports + { + get => _ports ?? (_ports = new InputList()); + set => _ports = value; + } + + public ServiceEndpointSpecGetArgs() + { + } + } + + public sealed class ServiceEndpointSpecPortsArgs : Pulumi.ResourceArgs + { + /// + /// A random name for the port. + /// + [Input("name")] + public Input? Name { get; set; } + + /// + /// Protocol that can be used over this port: `tcp|udp|sctp`. Default: `tcp`. + /// + [Input("protocol")] + public Input? Protocol { get; set; } + + /// + /// Represents the mode in which the port is to be published: `ingress|host` + /// + [Input("publishMode")] + public Input? PublishMode { get; set; } + + /// + /// The port on the swarm hosts. If not set the value of `target_port` will be used. + /// + [Input("publishedPort")] + public Input? PublishedPort { get; set; } + + /// + /// Port inside the container. + /// + [Input("targetPort", required: true)] + public Input TargetPort { get; set; } = null!; + + public ServiceEndpointSpecPortsArgs() + { + } + } + + public sealed class ServiceEndpointSpecPortsGetArgs : Pulumi.ResourceArgs + { + /// + /// A random name for the port. + /// + [Input("name")] + public Input? Name { get; set; } + + /// + /// Protocol that can be used over this port: `tcp|udp|sctp`. Default: `tcp`. + /// + [Input("protocol")] + public Input? Protocol { get; set; } + + /// + /// Represents the mode in which the port is to be published: `ingress|host` + /// + [Input("publishMode")] + public Input? PublishMode { get; set; } + + /// + /// The port on the swarm hosts. If not set the value of `target_port` will be used. + /// + [Input("publishedPort")] + public Input? PublishedPort { get; set; } + + /// + /// Port inside the container. + /// + [Input("targetPort", required: true)] + public Input TargetPort { get; set; } = null!; + + public ServiceEndpointSpecPortsGetArgs() + { + } + } + + public sealed class ServiceModeArgs : Pulumi.ResourceArgs + { + [Input("global")] + public Input? Global { get; set; } + + [Input("replicated")] + public Input? Replicated { get; set; } + + public ServiceModeArgs() + { + } + } + + public sealed class ServiceModeGetArgs : Pulumi.ResourceArgs + { + [Input("global")] + public Input? Global { get; set; } + + [Input("replicated")] + public Input? Replicated { get; set; } + + public ServiceModeGetArgs() + { + } + } + + public sealed class ServiceModeReplicatedArgs : Pulumi.ResourceArgs + { + [Input("replicas")] + public Input? Replicas { get; set; } + + public ServiceModeReplicatedArgs() + { + } + } + + public sealed class ServiceModeReplicatedGetArgs : Pulumi.ResourceArgs + { + [Input("replicas")] + public Input? Replicas { get; set; } + + public ServiceModeReplicatedGetArgs() + { + } + } + + public sealed class ServiceRollbackConfigArgs : Pulumi.ResourceArgs + { + [Input("delay")] + public Input? Delay { get; set; } + + [Input("failureAction")] + public Input? FailureAction { get; set; } + + [Input("maxFailureRatio")] + public Input? MaxFailureRatio { get; set; } + + [Input("monitor")] + public Input? Monitor { get; set; } + + [Input("order")] + public Input? Order { get; set; } + + [Input("parallelism")] + public Input? Parallelism { get; set; } + + public ServiceRollbackConfigArgs() + { + } + } + + public sealed class ServiceRollbackConfigGetArgs : Pulumi.ResourceArgs + { + [Input("delay")] + public Input? Delay { get; set; } + + [Input("failureAction")] + public Input? FailureAction { get; set; } + + [Input("maxFailureRatio")] + public Input? MaxFailureRatio { get; set; } + + [Input("monitor")] + public Input? Monitor { get; set; } + + [Input("order")] + public Input? Order { get; set; } + + [Input("parallelism")] + public Input? Parallelism { get; set; } + + public ServiceRollbackConfigGetArgs() + { + } + } + + public sealed class ServiceTaskSpecArgs : Pulumi.ResourceArgs + { + [Input("containerSpec", required: true)] + public Input ContainerSpec { get; set; } = null!; + + [Input("forceUpdate")] + public Input? ForceUpdate { get; set; } + + [Input("logDriver")] + public Input? LogDriver { get; set; } + + [Input("networks")] + private InputList? _networks; + public InputList Networks + { + get => _networks ?? (_networks = new InputList()); + set => _networks = value; + } + + [Input("placement")] + public Input? Placement { get; set; } + + [Input("resources")] + public Input? Resources { get; set; } + + [Input("restartPolicy")] + public Input? RestartPolicy { get; set; } + + [Input("runtime")] + public Input? Runtime { get; set; } + + public ServiceTaskSpecArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecArgs : Pulumi.ResourceArgs + { + [Input("args")] + private InputList? _args; + public InputList Args + { + get => _args ?? (_args = new InputList()); + set => _args = value; + } + + [Input("commands")] + private InputList? _commands; + public InputList Commands + { + get => _commands ?? (_commands = new InputList()); + set => _commands = value; + } + + [Input("configs")] + private InputList? _configs; + public InputList Configs + { + get => _configs ?? (_configs = new InputList()); + set => _configs = value; + } + + [Input("dir")] + public Input? Dir { get; set; } + + [Input("dnsConfig")] + public Input? DnsConfig { get; set; } + + [Input("env")] + private InputMap? _env; + public InputMap Env + { + get => _env ?? (_env = new InputMap()); + set => _env = value; + } + + [Input("groups")] + private InputList? _groups; + public InputList Groups + { + get => _groups ?? (_groups = new InputList()); + set => _groups = value; + } + + [Input("healthcheck")] + public Input? Healthcheck { get; set; } + + [Input("hostname")] + public Input? Hostname { get; set; } + + [Input("hosts")] + private InputList? _hosts; + public InputList Hosts + { + get => _hosts ?? (_hosts = new InputList()); + set => _hosts = value; + } + + [Input("image", required: true)] + public Input Image { get; set; } = null!; + + [Input("isolation")] + public Input? Isolation { get; set; } + + [Input("labels")] + private InputMap? _labels; + public InputMap Labels + { + get => _labels ?? (_labels = new InputMap()); + set => _labels = value; + } + + [Input("mounts")] + private InputList? _mounts; + public InputList Mounts + { + get => _mounts ?? (_mounts = new InputList()); + set => _mounts = value; + } + + [Input("privileges")] + public Input? Privileges { get; set; } + + [Input("readOnly")] + public Input? ReadOnly { get; set; } + + [Input("secrets")] + private InputList? _secrets; + public InputList Secrets + { + get => _secrets ?? (_secrets = new InputList()); + set => _secrets = value; + } + + [Input("stopGracePeriod")] + public Input? StopGracePeriod { get; set; } + + [Input("stopSignal")] + public Input? StopSignal { get; set; } + + [Input("user")] + public Input? User { get; set; } + + public ServiceTaskSpecContainerSpecArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecConfigsArgs : Pulumi.ResourceArgs + { + /// + /// ConfigID represents the ID of the specific config. + /// + [Input("configId", required: true)] + public Input ConfigId { get; set; } = null!; + + /// + /// The name of the config that this references, but internally it is just provided for lookup/display purposes + /// + [Input("configName")] + public Input? ConfigName { get; set; } + + /// + /// Represents the final filename in the filesystem. The specific target file that the config data is written within the docker container, e.g. `/root/config/config.json` + /// + [Input("fileName", required: true)] + public Input FileName { get; set; } = null!; + + public ServiceTaskSpecContainerSpecConfigsArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecConfigsGetArgs : Pulumi.ResourceArgs + { + /// + /// ConfigID represents the ID of the specific config. + /// + [Input("configId", required: true)] + public Input ConfigId { get; set; } = null!; + + /// + /// The name of the config that this references, but internally it is just provided for lookup/display purposes + /// + [Input("configName")] + public Input? ConfigName { get; set; } + + /// + /// Represents the final filename in the filesystem. The specific target file that the config data is written within the docker container, e.g. `/root/config/config.json` + /// + [Input("fileName", required: true)] + public Input FileName { get; set; } = null!; + + public ServiceTaskSpecContainerSpecConfigsGetArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecDnsConfigArgs : Pulumi.ResourceArgs + { + [Input("nameservers", required: true)] + private InputList? _nameservers; + public InputList Nameservers + { + get => _nameservers ?? (_nameservers = new InputList()); + set => _nameservers = value; + } + + [Input("options")] + private InputList? _options; + + /// + /// The options for the logging driver, e.g. + /// + public InputList Options + { + get => _options ?? (_options = new InputList()); + set => _options = value; + } + + [Input("searches")] + private InputList? _searches; + public InputList Searches + { + get => _searches ?? (_searches = new InputList()); + set => _searches = value; + } + + public ServiceTaskSpecContainerSpecDnsConfigArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecDnsConfigGetArgs : Pulumi.ResourceArgs + { + [Input("nameservers", required: true)] + private InputList? _nameservers; + public InputList Nameservers + { + get => _nameservers ?? (_nameservers = new InputList()); + set => _nameservers = value; + } + + [Input("options")] + private InputList? _options; + + /// + /// The options for the logging driver, e.g. + /// + public InputList Options + { + get => _options ?? (_options = new InputList()); + set => _options = value; + } + + [Input("searches")] + private InputList? _searches; + public InputList Searches + { + get => _searches ?? (_searches = new InputList()); + set => _searches = value; + } + + public ServiceTaskSpecContainerSpecDnsConfigGetArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecGetArgs : Pulumi.ResourceArgs + { + [Input("args")] + private InputList? _args; + public InputList Args + { + get => _args ?? (_args = new InputList()); + set => _args = value; + } + + [Input("commands")] + private InputList? _commands; + public InputList Commands + { + get => _commands ?? (_commands = new InputList()); + set => _commands = value; + } + + [Input("configs")] + private InputList? _configs; + public InputList Configs + { + get => _configs ?? (_configs = new InputList()); + set => _configs = value; + } + + [Input("dir")] + public Input? Dir { get; set; } + + [Input("dnsConfig")] + public Input? DnsConfig { get; set; } + + [Input("env")] + private InputMap? _env; + public InputMap Env + { + get => _env ?? (_env = new InputMap()); + set => _env = value; + } + + [Input("groups")] + private InputList? _groups; + public InputList Groups + { + get => _groups ?? (_groups = new InputList()); + set => _groups = value; + } + + [Input("healthcheck")] + public Input? Healthcheck { get; set; } + + [Input("hostname")] + public Input? Hostname { get; set; } + + [Input("hosts")] + private InputList? _hosts; + public InputList Hosts + { + get => _hosts ?? (_hosts = new InputList()); + set => _hosts = value; + } + + [Input("image", required: true)] + public Input Image { get; set; } = null!; + + [Input("isolation")] + public Input? Isolation { get; set; } + + [Input("labels")] + private InputMap? _labels; + public InputMap Labels + { + get => _labels ?? (_labels = new InputMap()); + set => _labels = value; + } + + [Input("mounts")] + private InputList? _mounts; + public InputList Mounts + { + get => _mounts ?? (_mounts = new InputList()); + set => _mounts = value; + } + + [Input("privileges")] + public Input? Privileges { get; set; } + + [Input("readOnly")] + public Input? ReadOnly { get; set; } + + [Input("secrets")] + private InputList? _secrets; + public InputList Secrets + { + get => _secrets ?? (_secrets = new InputList()); + set => _secrets = value; + } + + [Input("stopGracePeriod")] + public Input? StopGracePeriod { get; set; } + + [Input("stopSignal")] + public Input? StopSignal { get; set; } + + [Input("user")] + public Input? User { get; set; } + + public ServiceTaskSpecContainerSpecGetArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecHealthcheckArgs : Pulumi.ResourceArgs + { + [Input("interval")] + public Input? Interval { get; set; } + + [Input("retries")] + public Input? Retries { get; set; } + + [Input("startPeriod")] + public Input? StartPeriod { get; set; } + + [Input("tests", required: true)] + private InputList? _tests; + public InputList Tests + { + get => _tests ?? (_tests = new InputList()); + set => _tests = value; + } + + [Input("timeout")] + public Input? Timeout { get; set; } + + public ServiceTaskSpecContainerSpecHealthcheckArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecHealthcheckGetArgs : Pulumi.ResourceArgs + { + [Input("interval")] + public Input? Interval { get; set; } + + [Input("retries")] + public Input? Retries { get; set; } + + [Input("startPeriod")] + public Input? StartPeriod { get; set; } + + [Input("tests", required: true)] + private InputList? _tests; + public InputList Tests + { + get => _tests ?? (_tests = new InputList()); + set => _tests = value; + } + + [Input("timeout")] + public Input? Timeout { get; set; } + + public ServiceTaskSpecContainerSpecHealthcheckGetArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecHostsArgs : Pulumi.ResourceArgs + { + [Input("host", required: true)] + public Input Host { get; set; } = null!; + + [Input("ip", required: true)] + public Input Ip { get; set; } = null!; + + public ServiceTaskSpecContainerSpecHostsArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecHostsGetArgs : Pulumi.ResourceArgs + { + [Input("host", required: true)] + public Input Host { get; set; } = null!; + + [Input("ip", required: true)] + public Input Ip { get; set; } = null!; + + public ServiceTaskSpecContainerSpecHostsGetArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecMountsArgs : Pulumi.ResourceArgs + { + [Input("bindOptions")] + public Input? BindOptions { get; set; } + + [Input("readOnly")] + public Input? ReadOnly { get; set; } + + [Input("source")] + public Input? Source { get; set; } + + [Input("target", required: true)] + public Input Target { get; set; } = null!; + + [Input("tmpfsOptions")] + public Input? TmpfsOptions { get; set; } + + [Input("type", required: true)] + public Input Type { get; set; } = null!; + + [Input("volumeOptions")] + public Input? VolumeOptions { get; set; } + + public ServiceTaskSpecContainerSpecMountsArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecMountsBindOptionsArgs : Pulumi.ResourceArgs + { + [Input("propagation")] + public Input? Propagation { get; set; } + + public ServiceTaskSpecContainerSpecMountsBindOptionsArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecMountsBindOptionsGetArgs : Pulumi.ResourceArgs + { + [Input("propagation")] + public Input? Propagation { get; set; } + + public ServiceTaskSpecContainerSpecMountsBindOptionsGetArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecMountsGetArgs : Pulumi.ResourceArgs + { + [Input("bindOptions")] + public Input? BindOptions { get; set; } + + [Input("readOnly")] + public Input? ReadOnly { get; set; } + + [Input("source")] + public Input? Source { get; set; } + + [Input("target", required: true)] + public Input Target { get; set; } = null!; + + [Input("tmpfsOptions")] + public Input? TmpfsOptions { get; set; } + + [Input("type", required: true)] + public Input Type { get; set; } = null!; + + [Input("volumeOptions")] + public Input? VolumeOptions { get; set; } + + public ServiceTaskSpecContainerSpecMountsGetArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecMountsTmpfsOptionsArgs : Pulumi.ResourceArgs + { + /// + /// The mode of resolution to use for internal load balancing between tasks. `(vip|dnsrr)`. Default: `vip`. + /// + [Input("mode")] + public Input? Mode { get; set; } + + [Input("sizeBytes")] + public Input? SizeBytes { get; set; } + + public ServiceTaskSpecContainerSpecMountsTmpfsOptionsArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecMountsTmpfsOptionsGetArgs : Pulumi.ResourceArgs + { + /// + /// The mode of resolution to use for internal load balancing between tasks. `(vip|dnsrr)`. Default: `vip`. + /// + [Input("mode")] + public Input? Mode { get; set; } + + [Input("sizeBytes")] + public Input? SizeBytes { get; set; } + + public ServiceTaskSpecContainerSpecMountsTmpfsOptionsGetArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecMountsVolumeOptionsArgs : Pulumi.ResourceArgs + { + [Input("driverName")] + public Input? DriverName { get; set; } + + [Input("driverOptions")] + private InputMap? _driverOptions; + public InputMap DriverOptions + { + get => _driverOptions ?? (_driverOptions = new InputMap()); + set => _driverOptions = value; + } + + [Input("labels")] + private InputMap? _labels; + public InputMap Labels + { + get => _labels ?? (_labels = new InputMap()); + set => _labels = value; + } + + [Input("noCopy")] + public Input? NoCopy { get; set; } + + public ServiceTaskSpecContainerSpecMountsVolumeOptionsArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecMountsVolumeOptionsGetArgs : Pulumi.ResourceArgs + { + [Input("driverName")] + public Input? DriverName { get; set; } + + [Input("driverOptions")] + private InputMap? _driverOptions; + public InputMap DriverOptions + { + get => _driverOptions ?? (_driverOptions = new InputMap()); + set => _driverOptions = value; + } + + [Input("labels")] + private InputMap? _labels; + public InputMap Labels + { + get => _labels ?? (_labels = new InputMap()); + set => _labels = value; + } + + [Input("noCopy")] + public Input? NoCopy { get; set; } + + public ServiceTaskSpecContainerSpecMountsVolumeOptionsGetArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecPrivilegesArgs : Pulumi.ResourceArgs + { + [Input("credentialSpec")] + public Input? CredentialSpec { get; set; } + + [Input("seLinuxContext")] + public Input? SeLinuxContext { get; set; } + + public ServiceTaskSpecContainerSpecPrivilegesArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecPrivilegesCredentialSpecArgs : Pulumi.ResourceArgs + { + [Input("file")] + public Input? File { get; set; } + + [Input("registry")] + public Input? Registry { get; set; } + + public ServiceTaskSpecContainerSpecPrivilegesCredentialSpecArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecPrivilegesCredentialSpecGetArgs : Pulumi.ResourceArgs + { + [Input("file")] + public Input? File { get; set; } + + [Input("registry")] + public Input? Registry { get; set; } + + public ServiceTaskSpecContainerSpecPrivilegesCredentialSpecGetArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecPrivilegesGetArgs : Pulumi.ResourceArgs + { + [Input("credentialSpec")] + public Input? CredentialSpec { get; set; } + + [Input("seLinuxContext")] + public Input? SeLinuxContext { get; set; } + + public ServiceTaskSpecContainerSpecPrivilegesGetArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecPrivilegesSeLinuxContextArgs : Pulumi.ResourceArgs + { + [Input("disable")] + public Input? Disable { get; set; } + + [Input("level")] + public Input? Level { get; set; } + + [Input("role")] + public Input? Role { get; set; } + + [Input("type")] + public Input? Type { get; set; } + + [Input("user")] + public Input? User { get; set; } + + public ServiceTaskSpecContainerSpecPrivilegesSeLinuxContextArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecPrivilegesSeLinuxContextGetArgs : Pulumi.ResourceArgs + { + [Input("disable")] + public Input? Disable { get; set; } + + [Input("level")] + public Input? Level { get; set; } + + [Input("role")] + public Input? Role { get; set; } + + [Input("type")] + public Input? Type { get; set; } + + [Input("user")] + public Input? User { get; set; } + + public ServiceTaskSpecContainerSpecPrivilegesSeLinuxContextGetArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecSecretsArgs : Pulumi.ResourceArgs + { + /// + /// Represents the final filename in the filesystem. The specific target file that the config data is written within the docker container, e.g. `/root/config/config.json` + /// + [Input("fileName", required: true)] + public Input FileName { get; set; } = null!; + + [Input("secretId", required: true)] + public Input SecretId { get; set; } = null!; + + [Input("secretName")] + public Input? SecretName { get; set; } + + public ServiceTaskSpecContainerSpecSecretsArgs() + { + } + } + + public sealed class ServiceTaskSpecContainerSpecSecretsGetArgs : Pulumi.ResourceArgs + { + /// + /// Represents the final filename in the filesystem. The specific target file that the config data is written within the docker container, e.g. `/root/config/config.json` + /// + [Input("fileName", required: true)] + public Input FileName { get; set; } = null!; + + [Input("secretId", required: true)] + public Input SecretId { get; set; } = null!; + + [Input("secretName")] + public Input? SecretName { get; set; } + + public ServiceTaskSpecContainerSpecSecretsGetArgs() + { + } + } + + public sealed class ServiceTaskSpecGetArgs : Pulumi.ResourceArgs + { + [Input("containerSpec", required: true)] + public Input ContainerSpec { get; set; } = null!; + + [Input("forceUpdate")] + public Input? ForceUpdate { get; set; } + + [Input("logDriver")] + public Input? LogDriver { get; set; } + + [Input("networks")] + private InputList? _networks; + public InputList Networks + { + get => _networks ?? (_networks = new InputList()); + set => _networks = value; + } + + [Input("placement")] + public Input? Placement { get; set; } + + [Input("resources")] + public Input? Resources { get; set; } + + [Input("restartPolicy")] + public Input? RestartPolicy { get; set; } + + [Input("runtime")] + public Input? Runtime { get; set; } + + public ServiceTaskSpecGetArgs() + { + } + } + + public sealed class ServiceTaskSpecLogDriverArgs : Pulumi.ResourceArgs + { + /// + /// A random name for the port. + /// + [Input("name", required: true)] + public Input Name { get; set; } = null!; + + [Input("options")] + private InputMap? _options; + + /// + /// The options for the logging driver, e.g. + /// + public InputMap Options + { + get => _options ?? (_options = new InputMap()); + set => _options = value; + } + + public ServiceTaskSpecLogDriverArgs() + { + } + } + + public sealed class ServiceTaskSpecLogDriverGetArgs : Pulumi.ResourceArgs + { + /// + /// A random name for the port. + /// + [Input("name", required: true)] + public Input Name { get; set; } = null!; + + [Input("options")] + private InputMap? _options; + + /// + /// The options for the logging driver, e.g. + /// + public InputMap Options + { + get => _options ?? (_options = new InputMap()); + set => _options = value; + } + + public ServiceTaskSpecLogDriverGetArgs() + { + } + } + + public sealed class ServiceTaskSpecPlacementArgs : Pulumi.ResourceArgs + { + [Input("constraints")] + private InputList? _constraints; + public InputList Constraints + { + get => _constraints ?? (_constraints = new InputList()); + set => _constraints = value; + } + + [Input("platforms")] + private InputList? _platforms; + public InputList Platforms + { + get => _platforms ?? (_platforms = new InputList()); + set => _platforms = value; + } + + [Input("prefs")] + private InputList? _prefs; + public InputList Prefs + { + get => _prefs ?? (_prefs = new InputList()); + set => _prefs = value; + } + + public ServiceTaskSpecPlacementArgs() + { + } + } + + public sealed class ServiceTaskSpecPlacementGetArgs : Pulumi.ResourceArgs + { + [Input("constraints")] + private InputList? _constraints; + public InputList Constraints + { + get => _constraints ?? (_constraints = new InputList()); + set => _constraints = value; + } + + [Input("platforms")] + private InputList? _platforms; + public InputList Platforms + { + get => _platforms ?? (_platforms = new InputList()); + set => _platforms = value; + } + + [Input("prefs")] + private InputList? _prefs; + public InputList Prefs + { + get => _prefs ?? (_prefs = new InputList()); + set => _prefs = value; + } + + public ServiceTaskSpecPlacementGetArgs() + { + } + } + + public sealed class ServiceTaskSpecPlacementPlatformsArgs : Pulumi.ResourceArgs + { + [Input("architecture", required: true)] + public Input Architecture { get; set; } = null!; + + [Input("os", required: true)] + public Input Os { get; set; } = null!; + + public ServiceTaskSpecPlacementPlatformsArgs() + { + } + } + + public sealed class ServiceTaskSpecPlacementPlatformsGetArgs : Pulumi.ResourceArgs + { + [Input("architecture", required: true)] + public Input Architecture { get; set; } = null!; + + [Input("os", required: true)] + public Input Os { get; set; } = null!; + + public ServiceTaskSpecPlacementPlatformsGetArgs() + { + } + } + + public sealed class ServiceTaskSpecResourcesArgs : Pulumi.ResourceArgs + { + [Input("limits")] + public Input? Limits { get; set; } + + [Input("reservation")] + public Input? Reservation { get; set; } + + public ServiceTaskSpecResourcesArgs() + { + } + } + + public sealed class ServiceTaskSpecResourcesGetArgs : Pulumi.ResourceArgs + { + [Input("limits")] + public Input? Limits { get; set; } + + [Input("reservation")] + public Input? Reservation { get; set; } + + public ServiceTaskSpecResourcesGetArgs() + { + } + } + + public sealed class ServiceTaskSpecResourcesLimitsArgs : Pulumi.ResourceArgs + { + [Input("genericResources")] + public Input? GenericResources { get; set; } + + [Input("memoryBytes")] + public Input? MemoryBytes { get; set; } + + [Input("nanoCpus")] + public Input? NanoCpus { get; set; } + + public ServiceTaskSpecResourcesLimitsArgs() + { + } + } + + public sealed class ServiceTaskSpecResourcesLimitsGenericResourcesArgs : Pulumi.ResourceArgs + { + [Input("discreteResourcesSpecs")] + private InputList? _discreteResourcesSpecs; + public InputList DiscreteResourcesSpecs + { + get => _discreteResourcesSpecs ?? (_discreteResourcesSpecs = new InputList()); + set => _discreteResourcesSpecs = value; + } + + [Input("namedResourcesSpecs")] + private InputList? _namedResourcesSpecs; + public InputList NamedResourcesSpecs + { + get => _namedResourcesSpecs ?? (_namedResourcesSpecs = new InputList()); + set => _namedResourcesSpecs = value; + } + + public ServiceTaskSpecResourcesLimitsGenericResourcesArgs() + { + } + } + + public sealed class ServiceTaskSpecResourcesLimitsGenericResourcesGetArgs : Pulumi.ResourceArgs + { + [Input("discreteResourcesSpecs")] + private InputList? _discreteResourcesSpecs; + public InputList DiscreteResourcesSpecs + { + get => _discreteResourcesSpecs ?? (_discreteResourcesSpecs = new InputList()); + set => _discreteResourcesSpecs = value; + } + + [Input("namedResourcesSpecs")] + private InputList? _namedResourcesSpecs; + public InputList NamedResourcesSpecs + { + get => _namedResourcesSpecs ?? (_namedResourcesSpecs = new InputList()); + set => _namedResourcesSpecs = value; + } + + public ServiceTaskSpecResourcesLimitsGenericResourcesGetArgs() + { + } + } + + public sealed class ServiceTaskSpecResourcesLimitsGetArgs : Pulumi.ResourceArgs + { + [Input("genericResources")] + public Input? GenericResources { get; set; } + + [Input("memoryBytes")] + public Input? MemoryBytes { get; set; } + + [Input("nanoCpus")] + public Input? NanoCpus { get; set; } + + public ServiceTaskSpecResourcesLimitsGetArgs() + { + } + } + + public sealed class ServiceTaskSpecResourcesReservationArgs : Pulumi.ResourceArgs + { + [Input("genericResources")] + public Input? GenericResources { get; set; } + + [Input("memoryBytes")] + public Input? MemoryBytes { get; set; } + + [Input("nanoCpus")] + public Input? NanoCpus { get; set; } + + public ServiceTaskSpecResourcesReservationArgs() + { + } + } + + public sealed class ServiceTaskSpecResourcesReservationGenericResourcesArgs : Pulumi.ResourceArgs + { + [Input("discreteResourcesSpecs")] + private InputList? _discreteResourcesSpecs; + public InputList DiscreteResourcesSpecs + { + get => _discreteResourcesSpecs ?? (_discreteResourcesSpecs = new InputList()); + set => _discreteResourcesSpecs = value; + } + + [Input("namedResourcesSpecs")] + private InputList? _namedResourcesSpecs; + public InputList NamedResourcesSpecs + { + get => _namedResourcesSpecs ?? (_namedResourcesSpecs = new InputList()); + set => _namedResourcesSpecs = value; + } + + public ServiceTaskSpecResourcesReservationGenericResourcesArgs() + { + } + } + + public sealed class ServiceTaskSpecResourcesReservationGenericResourcesGetArgs : Pulumi.ResourceArgs + { + [Input("discreteResourcesSpecs")] + private InputList? _discreteResourcesSpecs; + public InputList DiscreteResourcesSpecs + { + get => _discreteResourcesSpecs ?? (_discreteResourcesSpecs = new InputList()); + set => _discreteResourcesSpecs = value; + } + + [Input("namedResourcesSpecs")] + private InputList? _namedResourcesSpecs; + public InputList NamedResourcesSpecs + { + get => _namedResourcesSpecs ?? (_namedResourcesSpecs = new InputList()); + set => _namedResourcesSpecs = value; + } + + public ServiceTaskSpecResourcesReservationGenericResourcesGetArgs() + { + } + } + + public sealed class ServiceTaskSpecResourcesReservationGetArgs : Pulumi.ResourceArgs + { + [Input("genericResources")] + public Input? GenericResources { get; set; } + + [Input("memoryBytes")] + public Input? MemoryBytes { get; set; } + + [Input("nanoCpus")] + public Input? NanoCpus { get; set; } + + public ServiceTaskSpecResourcesReservationGetArgs() + { + } + } + + public sealed class ServiceTaskSpecRestartPolicyArgs : Pulumi.ResourceArgs + { + [Input("condition")] + public Input? Condition { get; set; } + + [Input("delay")] + public Input? Delay { get; set; } + + [Input("maxAttempts")] + public Input? MaxAttempts { get; set; } + + [Input("window")] + public Input? Window { get; set; } + + public ServiceTaskSpecRestartPolicyArgs() + { + } + } + + public sealed class ServiceTaskSpecRestartPolicyGetArgs : Pulumi.ResourceArgs + { + [Input("condition")] + public Input? Condition { get; set; } + + [Input("delay")] + public Input? Delay { get; set; } + + [Input("maxAttempts")] + public Input? MaxAttempts { get; set; } + + [Input("window")] + public Input? Window { get; set; } + + public ServiceTaskSpecRestartPolicyGetArgs() + { + } + } + + public sealed class ServiceUpdateConfigArgs : Pulumi.ResourceArgs + { + [Input("delay")] + public Input? Delay { get; set; } + + [Input("failureAction")] + public Input? FailureAction { get; set; } + + [Input("maxFailureRatio")] + public Input? MaxFailureRatio { get; set; } + + [Input("monitor")] + public Input? Monitor { get; set; } + + [Input("order")] + public Input? Order { get; set; } + + [Input("parallelism")] + public Input? Parallelism { get; set; } + + public ServiceUpdateConfigArgs() + { + } + } + + public sealed class ServiceUpdateConfigGetArgs : Pulumi.ResourceArgs + { + [Input("delay")] + public Input? Delay { get; set; } + + [Input("failureAction")] + public Input? FailureAction { get; set; } + + [Input("maxFailureRatio")] + public Input? MaxFailureRatio { get; set; } + + [Input("monitor")] + public Input? Monitor { get; set; } + + [Input("order")] + public Input? Order { get; set; } + + [Input("parallelism")] + public Input? Parallelism { get; set; } + + public ServiceUpdateConfigGetArgs() + { + } + } + } + + namespace Outputs + { + + [OutputType] + public sealed class ServiceAuth + { + /// + /// The password to use for authenticating to the registry. If this is blank, the `DOCKER_REGISTRY_PASS` is also be checked. + /// + public readonly string? Password; + /// + /// The address of the registry server + /// + public readonly string ServerAddress; + /// + /// The username to use for authenticating to the registry. If this is blank, the `DOCKER_REGISTRY_USER` is also be checked. + /// + public readonly string? Username; + + [OutputConstructor] + private ServiceAuth( + string? password, + string serverAddress, + string? username) + { + Password = password; + ServerAddress = serverAddress; + Username = username; + } + } + + [OutputType] + public sealed class ServiceConvergeConfig + { + public readonly string? Delay; + public readonly string? Timeout; + + [OutputConstructor] + private ServiceConvergeConfig( + string? delay, + string? timeout) + { + Delay = delay; + Timeout = timeout; + } + } + + [OutputType] + public sealed class ServiceEndpointSpec + { + /// + /// The mode of resolution to use for internal load balancing between tasks. `(vip|dnsrr)`. Default: `vip`. + /// + public readonly string Mode; + /// + /// See Ports below for details. + /// + public readonly ImmutableArray Ports; + + [OutputConstructor] + private ServiceEndpointSpec( + string mode, + ImmutableArray ports) + { + Mode = mode; + Ports = ports; + } + } + + [OutputType] + public sealed class ServiceEndpointSpecPorts + { + /// + /// A random name for the port. + /// + public readonly string? Name; + /// + /// Protocol that can be used over this port: `tcp|udp|sctp`. Default: `tcp`. + /// + public readonly string? Protocol; + /// + /// Represents the mode in which the port is to be published: `ingress|host` + /// + public readonly string? PublishMode; + /// + /// The port on the swarm hosts. If not set the value of `target_port` will be used. + /// + public readonly int? PublishedPort; + /// + /// Port inside the container. + /// + public readonly int TargetPort; + + [OutputConstructor] + private ServiceEndpointSpecPorts( + string? name, + string? protocol, + string? publishMode, + int? publishedPort, + int targetPort) + { + Name = name; + Protocol = protocol; + PublishMode = publishMode; + PublishedPort = publishedPort; + TargetPort = targetPort; + } + } + + [OutputType] + public sealed class ServiceMode + { + public readonly bool? Global; + public readonly ServiceModeReplicated Replicated; + + [OutputConstructor] + private ServiceMode( + bool? global, + ServiceModeReplicated replicated) + { + Global = global; + Replicated = replicated; + } + } + + [OutputType] + public sealed class ServiceModeReplicated + { + public readonly int? Replicas; + + [OutputConstructor] + private ServiceModeReplicated(int? replicas) + { + Replicas = replicas; + } + } + + [OutputType] + public sealed class ServiceRollbackConfig + { + public readonly string? Delay; + public readonly string? FailureAction; + public readonly string? MaxFailureRatio; + public readonly string? Monitor; + public readonly string? Order; + public readonly int? Parallelism; + + [OutputConstructor] + private ServiceRollbackConfig( + string? delay, + string? failureAction, + string? maxFailureRatio, + string? monitor, + string? order, + int? parallelism) + { + Delay = delay; + FailureAction = failureAction; + MaxFailureRatio = maxFailureRatio; + Monitor = monitor; + Order = order; + Parallelism = parallelism; + } + } + + [OutputType] + public sealed class ServiceTaskSpec + { + public readonly ServiceTaskSpecContainerSpec ContainerSpec; + public readonly int ForceUpdate; + public readonly ServiceTaskSpecLogDriver? LogDriver; + public readonly ImmutableArray Networks; + public readonly ServiceTaskSpecPlacement Placement; + public readonly ServiceTaskSpecResources Resources; + public readonly ServiceTaskSpecRestartPolicy RestartPolicy; + public readonly string Runtime; + + [OutputConstructor] + private ServiceTaskSpec( + ServiceTaskSpecContainerSpec containerSpec, + int forceUpdate, + ServiceTaskSpecLogDriver? logDriver, + ImmutableArray networks, + ServiceTaskSpecPlacement placement, + ServiceTaskSpecResources resources, + ServiceTaskSpecRestartPolicy restartPolicy, + string runtime) + { + ContainerSpec = containerSpec; + ForceUpdate = forceUpdate; + LogDriver = logDriver; + Networks = networks; + Placement = placement; + Resources = resources; + RestartPolicy = restartPolicy; + Runtime = runtime; + } + } + + [OutputType] + public sealed class ServiceTaskSpecContainerSpec + { + public readonly ImmutableArray Args; + public readonly ImmutableArray Commands; + public readonly ImmutableArray Configs; + public readonly string? Dir; + public readonly ServiceTaskSpecContainerSpecDnsConfig DnsConfig; + public readonly ImmutableDictionary? Env; + public readonly ImmutableArray Groups; + public readonly ServiceTaskSpecContainerSpecHealthcheck Healthcheck; + public readonly string? Hostname; + public readonly ImmutableArray Hosts; + public readonly string Image; + public readonly string? Isolation; + public readonly ImmutableDictionary? Labels; + public readonly ImmutableArray Mounts; + public readonly ServiceTaskSpecContainerSpecPrivileges? Privileges; + public readonly bool? ReadOnly; + public readonly ImmutableArray Secrets; + public readonly string StopGracePeriod; + public readonly string? StopSignal; + public readonly string? User; + + [OutputConstructor] + private ServiceTaskSpecContainerSpec( + ImmutableArray args, + ImmutableArray commands, + ImmutableArray configs, + string? dir, + ServiceTaskSpecContainerSpecDnsConfig dnsConfig, + ImmutableDictionary? env, + ImmutableArray groups, + ServiceTaskSpecContainerSpecHealthcheck healthcheck, + string? hostname, + ImmutableArray hosts, + string image, + string? isolation, + ImmutableDictionary? labels, + ImmutableArray mounts, + ServiceTaskSpecContainerSpecPrivileges? privileges, + bool? readOnly, + ImmutableArray secrets, + string stopGracePeriod, + string? stopSignal, + string? user) + { + Args = args; + Commands = commands; + Configs = configs; + Dir = dir; + DnsConfig = dnsConfig; + Env = env; + Groups = groups; + Healthcheck = healthcheck; + Hostname = hostname; + Hosts = hosts; + Image = image; + Isolation = isolation; + Labels = labels; + Mounts = mounts; + Privileges = privileges; + ReadOnly = readOnly; + Secrets = secrets; + StopGracePeriod = stopGracePeriod; + StopSignal = stopSignal; + User = user; + } + } + + [OutputType] + public sealed class ServiceTaskSpecContainerSpecConfigs + { + /// + /// ConfigID represents the ID of the specific config. + /// + public readonly string ConfigId; + /// + /// The name of the config that this references, but internally it is just provided for lookup/display purposes + /// + public readonly string? ConfigName; + /// + /// Represents the final filename in the filesystem. The specific target file that the config data is written within the docker container, e.g. `/root/config/config.json` + /// + public readonly string FileName; + + [OutputConstructor] + private ServiceTaskSpecContainerSpecConfigs( + string configId, + string? configName, + string fileName) + { + ConfigId = configId; + ConfigName = configName; + FileName = fileName; + } + } + + [OutputType] + public sealed class ServiceTaskSpecContainerSpecDnsConfig + { + public readonly ImmutableArray Nameservers; + /// + /// The options for the logging driver, e.g. + /// + public readonly ImmutableArray Options; + public readonly ImmutableArray Searches; + + [OutputConstructor] + private ServiceTaskSpecContainerSpecDnsConfig( + ImmutableArray nameservers, + ImmutableArray options, + ImmutableArray searches) + { + Nameservers = nameservers; + Options = options; + Searches = searches; + } + } + + [OutputType] + public sealed class ServiceTaskSpecContainerSpecHealthcheck + { + public readonly string? Interval; + public readonly int? Retries; + public readonly string? StartPeriod; + public readonly ImmutableArray Tests; + public readonly string? Timeout; + + [OutputConstructor] + private ServiceTaskSpecContainerSpecHealthcheck( + string? interval, + int? retries, + string? startPeriod, + ImmutableArray tests, + string? timeout) + { + Interval = interval; + Retries = retries; + StartPeriod = startPeriod; + Tests = tests; + Timeout = timeout; + } + } + + [OutputType] + public sealed class ServiceTaskSpecContainerSpecHosts + { + public readonly string Host; + public readonly string Ip; + + [OutputConstructor] + private ServiceTaskSpecContainerSpecHosts( + string host, + string ip) + { + Host = host; + Ip = ip; + } + } + + [OutputType] + public sealed class ServiceTaskSpecContainerSpecMounts + { + public readonly ServiceTaskSpecContainerSpecMountsBindOptions? BindOptions; + public readonly bool? ReadOnly; + public readonly string? Source; + public readonly string Target; + public readonly ServiceTaskSpecContainerSpecMountsTmpfsOptions? TmpfsOptions; + public readonly string Type; + public readonly ServiceTaskSpecContainerSpecMountsVolumeOptions? VolumeOptions; + + [OutputConstructor] + private ServiceTaskSpecContainerSpecMounts( + ServiceTaskSpecContainerSpecMountsBindOptions? bindOptions, + bool? readOnly, + string? source, + string target, + ServiceTaskSpecContainerSpecMountsTmpfsOptions? tmpfsOptions, + string type, + ServiceTaskSpecContainerSpecMountsVolumeOptions? volumeOptions) + { + BindOptions = bindOptions; + ReadOnly = readOnly; + Source = source; + Target = target; + TmpfsOptions = tmpfsOptions; + Type = type; + VolumeOptions = volumeOptions; + } + } + + [OutputType] + public sealed class ServiceTaskSpecContainerSpecMountsBindOptions + { + public readonly string? Propagation; + + [OutputConstructor] + private ServiceTaskSpecContainerSpecMountsBindOptions(string? propagation) + { + Propagation = propagation; + } + } + + [OutputType] + public sealed class ServiceTaskSpecContainerSpecMountsTmpfsOptions + { + /// + /// The mode of resolution to use for internal load balancing between tasks. `(vip|dnsrr)`. Default: `vip`. + /// + public readonly int? Mode; + public readonly int? SizeBytes; + + [OutputConstructor] + private ServiceTaskSpecContainerSpecMountsTmpfsOptions( + int? mode, + int? sizeBytes) + { + Mode = mode; + SizeBytes = sizeBytes; + } + } + + [OutputType] + public sealed class ServiceTaskSpecContainerSpecMountsVolumeOptions + { + public readonly string? DriverName; + public readonly ImmutableDictionary? DriverOptions; + public readonly ImmutableDictionary? Labels; + public readonly bool? NoCopy; + + [OutputConstructor] + private ServiceTaskSpecContainerSpecMountsVolumeOptions( + string? driverName, + ImmutableDictionary? driverOptions, + ImmutableDictionary? labels, + bool? noCopy) + { + DriverName = driverName; + DriverOptions = driverOptions; + Labels = labels; + NoCopy = noCopy; + } + } + + [OutputType] + public sealed class ServiceTaskSpecContainerSpecPrivileges + { + public readonly ServiceTaskSpecContainerSpecPrivilegesCredentialSpec? CredentialSpec; + public readonly ServiceTaskSpecContainerSpecPrivilegesSeLinuxContext? SeLinuxContext; + + [OutputConstructor] + private ServiceTaskSpecContainerSpecPrivileges( + ServiceTaskSpecContainerSpecPrivilegesCredentialSpec? credentialSpec, + ServiceTaskSpecContainerSpecPrivilegesSeLinuxContext? seLinuxContext) + { + CredentialSpec = credentialSpec; + SeLinuxContext = seLinuxContext; + } + } + + [OutputType] + public sealed class ServiceTaskSpecContainerSpecPrivilegesCredentialSpec + { + public readonly string? File; + public readonly string? Registry; + + [OutputConstructor] + private ServiceTaskSpecContainerSpecPrivilegesCredentialSpec( + string? file, + string? registry) + { + File = file; + Registry = registry; + } + } + + [OutputType] + public sealed class ServiceTaskSpecContainerSpecPrivilegesSeLinuxContext + { + public readonly bool? Disable; + public readonly string? Level; + public readonly string? Role; + public readonly string? Type; + public readonly string? User; + + [OutputConstructor] + private ServiceTaskSpecContainerSpecPrivilegesSeLinuxContext( + bool? disable, + string? level, + string? role, + string? type, + string? user) + { + Disable = disable; + Level = level; + Role = role; + Type = type; + User = user; + } + } + + [OutputType] + public sealed class ServiceTaskSpecContainerSpecSecrets + { + /// + /// Represents the final filename in the filesystem. The specific target file that the config data is written within the docker container, e.g. `/root/config/config.json` + /// + public readonly string FileName; + public readonly string SecretId; + public readonly string? SecretName; + + [OutputConstructor] + private ServiceTaskSpecContainerSpecSecrets( + string fileName, + string secretId, + string? secretName) + { + FileName = fileName; + SecretId = secretId; + SecretName = secretName; + } + } + + [OutputType] + public sealed class ServiceTaskSpecLogDriver + { + /// + /// A random name for the port. + /// + public readonly string Name; + /// + /// The options for the logging driver, e.g. + /// + public readonly ImmutableDictionary? Options; + + [OutputConstructor] + private ServiceTaskSpecLogDriver( + string name, + ImmutableDictionary? options) + { + Name = name; + Options = options; + } + } + + [OutputType] + public sealed class ServiceTaskSpecPlacement + { + public readonly ImmutableArray Constraints; + public readonly ImmutableArray Platforms; + public readonly ImmutableArray Prefs; + + [OutputConstructor] + private ServiceTaskSpecPlacement( + ImmutableArray constraints, + ImmutableArray platforms, + ImmutableArray prefs) + { + Constraints = constraints; + Platforms = platforms; + Prefs = prefs; + } + } + + [OutputType] + public sealed class ServiceTaskSpecPlacementPlatforms + { + public readonly string Architecture; + public readonly string Os; + + [OutputConstructor] + private ServiceTaskSpecPlacementPlatforms( + string architecture, + string os) + { + Architecture = architecture; + Os = os; + } + } + + [OutputType] + public sealed class ServiceTaskSpecResources + { + public readonly ServiceTaskSpecResourcesLimits? Limits; + public readonly ServiceTaskSpecResourcesReservation? Reservation; + + [OutputConstructor] + private ServiceTaskSpecResources( + ServiceTaskSpecResourcesLimits? limits, + ServiceTaskSpecResourcesReservation? reservation) + { + Limits = limits; + Reservation = reservation; + } + } + + [OutputType] + public sealed class ServiceTaskSpecResourcesLimits + { + public readonly ServiceTaskSpecResourcesLimitsGenericResources? GenericResources; + public readonly int? MemoryBytes; + public readonly int? NanoCpus; + + [OutputConstructor] + private ServiceTaskSpecResourcesLimits( + ServiceTaskSpecResourcesLimitsGenericResources? genericResources, + int? memoryBytes, + int? nanoCpus) + { + GenericResources = genericResources; + MemoryBytes = memoryBytes; + NanoCpus = nanoCpus; + } + } + + [OutputType] + public sealed class ServiceTaskSpecResourcesLimitsGenericResources + { + public readonly ImmutableArray DiscreteResourcesSpecs; + public readonly ImmutableArray NamedResourcesSpecs; + + [OutputConstructor] + private ServiceTaskSpecResourcesLimitsGenericResources( + ImmutableArray discreteResourcesSpecs, + ImmutableArray namedResourcesSpecs) + { + DiscreteResourcesSpecs = discreteResourcesSpecs; + NamedResourcesSpecs = namedResourcesSpecs; + } + } + + [OutputType] + public sealed class ServiceTaskSpecResourcesReservation + { + public readonly ServiceTaskSpecResourcesReservationGenericResources? GenericResources; + public readonly int? MemoryBytes; + public readonly int? NanoCpus; + + [OutputConstructor] + private ServiceTaskSpecResourcesReservation( + ServiceTaskSpecResourcesReservationGenericResources? genericResources, + int? memoryBytes, + int? nanoCpus) + { + GenericResources = genericResources; + MemoryBytes = memoryBytes; + NanoCpus = nanoCpus; + } + } + + [OutputType] + public sealed class ServiceTaskSpecResourcesReservationGenericResources + { + public readonly ImmutableArray DiscreteResourcesSpecs; + public readonly ImmutableArray NamedResourcesSpecs; + + [OutputConstructor] + private ServiceTaskSpecResourcesReservationGenericResources( + ImmutableArray discreteResourcesSpecs, + ImmutableArray namedResourcesSpecs) + { + DiscreteResourcesSpecs = discreteResourcesSpecs; + NamedResourcesSpecs = namedResourcesSpecs; + } + } + + [OutputType] + public sealed class ServiceTaskSpecRestartPolicy + { + public readonly string? Condition; + public readonly string? Delay; + public readonly int? MaxAttempts; + public readonly string? Window; + + [OutputConstructor] + private ServiceTaskSpecRestartPolicy( + string? condition, + string? delay, + int? maxAttempts, + string? window) + { + Condition = condition; + Delay = delay; + MaxAttempts = maxAttempts; + Window = window; + } + } + + [OutputType] + public sealed class ServiceUpdateConfig + { + public readonly string? Delay; + public readonly string? FailureAction; + public readonly string? MaxFailureRatio; + public readonly string? Monitor; + public readonly string? Order; + public readonly int? Parallelism; + + [OutputConstructor] + private ServiceUpdateConfig( + string? delay, + string? failureAction, + string? maxFailureRatio, + string? monitor, + string? order, + int? parallelism) + { + Delay = delay; + FailureAction = failureAction; + MaxFailureRatio = maxFailureRatio; + Monitor = monitor; + Order = order; + Parallelism = parallelism; + } + } + } +} diff --git a/sdk/dotnet/ServiceConfig.cs b/sdk/dotnet/ServiceConfig.cs new file mode 100644 index 00000000..1971cb87 --- /dev/null +++ b/sdk/dotnet/ServiceConfig.cs @@ -0,0 +1,111 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Docker +{ + /// + /// Manages the configuration of a Docker service in a swarm. + /// + /// > This content is derived from https://github.com/terraform-providers/terraform-provider-docker/blob/master/website/docs/r/config.html.markdown. + /// + public partial class ServiceConfig : Pulumi.CustomResource + { + /// + /// The base64 encoded data of the config. + /// + [Output("data")] + public Output Data { get; private set; } = null!; + + /// + /// The name of the Docker config. + /// + [Output("name")] + public Output Name { get; private set; } = null!; + + + /// + /// Create a ServiceConfig resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public ServiceConfig(string name, ServiceConfigArgs args, CustomResourceOptions? options = null) + : base("docker:index/config:Config", name, args ?? ResourceArgs.Empty, MakeResourceOptions(options, "")) + { + } + + private ServiceConfig(string name, Input id, ServiceConfigState? state = null, CustomResourceOptions? options = null) + : base("docker:index/config:Config", name, state, MakeResourceOptions(options, id)) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + }; + var merged = CustomResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + /// + /// Get an existing ServiceConfig resource's state with the given name, ID, and optional extra + /// properties used to qualify the lookup. + /// + /// + /// The unique name of the resulting resource. + /// The unique provider ID of the resource to lookup. + /// Any extra arguments used during the lookup. + /// A bag of options that control this resource's behavior + public static ServiceConfig Get(string name, Input id, ServiceConfigState? state = null, CustomResourceOptions? options = null) + { + return new ServiceConfig(name, id, state, options); + } + } + + public sealed class ServiceConfigArgs : Pulumi.ResourceArgs + { + /// + /// The base64 encoded data of the config. + /// + [Input("data", required: true)] + public Input Data { get; set; } = null!; + + /// + /// The name of the Docker config. + /// + [Input("name")] + public Input? Name { get; set; } + + public ServiceConfigArgs() + { + } + } + + public sealed class ServiceConfigState : Pulumi.ResourceArgs + { + /// + /// The base64 encoded data of the config. + /// + [Input("data")] + public Input? Data { get; set; } + + /// + /// The name of the Docker config. + /// + [Input("name")] + public Input? Name { get; set; } + + public ServiceConfigState() + { + } + } +} diff --git a/sdk/dotnet/Utilities.cs b/sdk/dotnet/Utilities.cs new file mode 100644 index 00000000..56e596da --- /dev/null +++ b/sdk/dotnet/Utilities.cs @@ -0,0 +1,74 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.IO; +using System.Reflection; +using Pulumi; + +namespace Pulumi.Docker +{ + static class Utilities + { + public static string? GetEnv(params string[] names) + { + foreach (var n in names) + { + var value = Environment.GetEnvironmentVariable(n); + if (value != null) + { + return value; + } + } + return null; + } + + static string[] trueValues = { "1", "t", "T", "true", "TRUE", "True" }; + static string[] falseValues = { "0", "f", "F", "false", "FALSE", "False" }; + public static bool? GetEnvBoolean(params string[] names) + { + var s = GetEnv(names); + if (s != null) + { + if (Array.IndexOf(trueValues, s) != -1) + { + return true; + } + if (Array.IndexOf(falseValues, s) != -1) + { + return false; + } + } + return null; + } + + public static int? GetEnvInt32(params string[] names) => int.TryParse(GetEnv(names), out int v) ? (int?)v : null; + + public static double? GetEnvDouble(params string[] names) => double.TryParse(GetEnv(names), out double v) ? (double?)v : null; + + public static InvokeOptions WithVersion(this InvokeOptions? options) + { + if (options?.Version != null) + { + return options; + } + return new InvokeOptions + { + Parent = options?.Parent, + Provider = options?.Provider, + Version = Version, + }; + } + + private readonly static string version; + public static string Version => version; + + static Utilities() + { + var assembly = typeof(Utilities).GetTypeInfo().Assembly; + using var stream = assembly.GetManifestResourceStream("Pulumi.Docker.version.txt"); + using var reader = new StreamReader(stream ?? throw new NotSupportedException("Missing embedded version.txt file")); + version = reader.ReadToEnd().Trim(); + } + } +} diff --git a/sdk/dotnet/Volume.cs b/sdk/dotnet/Volume.cs new file mode 100644 index 00000000..c6702467 --- /dev/null +++ b/sdk/dotnet/Volume.cs @@ -0,0 +1,182 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Docker +{ + /// + /// Creates and destroys a volume in Docker. This can be used alongside + /// [docker\_container](https://www.terraform.io/docs/providers/docker/r/container.html) + /// to prepare volumes that can be shared across containers. + /// + /// > This content is derived from https://github.com/terraform-providers/terraform-provider-docker/blob/master/website/docs/r/volume.html.markdown. + /// + public partial class Volume : Pulumi.CustomResource + { + /// + /// Driver type for the volume (defaults to local). + /// + [Output("driver")] + public Output Driver { get; private set; } = null!; + + /// + /// Options specific to the driver. + /// + [Output("driverOpts")] + public Output?> DriverOpts { get; private set; } = null!; + + /// + /// User-defined key/value metadata. + /// + [Output("labels")] + public Output?> Labels { get; private set; } = null!; + + [Output("mountpoint")] + public Output Mountpoint { get; private set; } = null!; + + /// + /// The name of the Docker volume (generated if not + /// provided). + /// + [Output("name")] + public Output Name { get; private set; } = null!; + + + /// + /// Create a Volume resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public Volume(string name, VolumeArgs? args = null, CustomResourceOptions? options = null) + : base("docker:index/volume:Volume", name, args ?? ResourceArgs.Empty, MakeResourceOptions(options, "")) + { + } + + private Volume(string name, Input id, VolumeState? state = null, CustomResourceOptions? options = null) + : base("docker:index/volume:Volume", name, state, MakeResourceOptions(options, id)) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + }; + var merged = CustomResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + /// + /// Get an existing Volume resource's state with the given name, ID, and optional extra + /// properties used to qualify the lookup. + /// + /// + /// The unique name of the resulting resource. + /// The unique provider ID of the resource to lookup. + /// Any extra arguments used during the lookup. + /// A bag of options that control this resource's behavior + public static Volume Get(string name, Input id, VolumeState? state = null, CustomResourceOptions? options = null) + { + return new Volume(name, id, state, options); + } + } + + public sealed class VolumeArgs : Pulumi.ResourceArgs + { + /// + /// Driver type for the volume (defaults to local). + /// + [Input("driver")] + public Input? Driver { get; set; } + + [Input("driverOpts")] + private InputMap? _driverOpts; + + /// + /// Options specific to the driver. + /// + public InputMap DriverOpts + { + get => _driverOpts ?? (_driverOpts = new InputMap()); + set => _driverOpts = value; + } + + [Input("labels")] + private InputMap? _labels; + + /// + /// User-defined key/value metadata. + /// + public InputMap Labels + { + get => _labels ?? (_labels = new InputMap()); + set => _labels = value; + } + + /// + /// The name of the Docker volume (generated if not + /// provided). + /// + [Input("name")] + public Input? Name { get; set; } + + public VolumeArgs() + { + } + } + + public sealed class VolumeState : Pulumi.ResourceArgs + { + /// + /// Driver type for the volume (defaults to local). + /// + [Input("driver")] + public Input? Driver { get; set; } + + [Input("driverOpts")] + private InputMap? _driverOpts; + + /// + /// Options specific to the driver. + /// + public InputMap DriverOpts + { + get => _driverOpts ?? (_driverOpts = new InputMap()); + set => _driverOpts = value; + } + + [Input("labels")] + private InputMap? _labels; + + /// + /// User-defined key/value metadata. + /// + public InputMap Labels + { + get => _labels ?? (_labels = new InputMap()); + set => _labels = value; + } + + [Input("mountpoint")] + public Input? Mountpoint { get; set; } + + /// + /// The name of the Docker volume (generated if not + /// provided). + /// + [Input("name")] + public Input? Name { get; set; } + + public VolumeState() + { + } + } +}