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