UNPKG

@pulumi/docker

Version:

A Pulumi package for interacting with Docker in Pulumi programs

118 lines 4.25 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Network = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * <!-- Bug: Type and Name are switched --> * `docker.Network` provides a docker network resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as docker from "@pulumi/docker"; * * const privateNetwork = new docker.Network("private_network", {name: "my_network"}); * ``` * * ## Import * * ### Example * * Assuming you created a `network` as follows * * #!/bin/bash * * docker network create foo * * prints the long ID * * 87b57a9b91ecab2db2a6dbf38df74c67d7c7108cbe479d6576574ec2cd8c2d73 * * you provide the definition for the resource as follows * * terraform * * resource "docker_network" "foo" { * * name = "foo" * * } * * then the import command is as follows * * #!/bin/bash * * ```sh * $ pulumi import docker:index/network:Network foo 87b57a9b91ecab2db2a6dbf38df74c67d7c7108cbe479d6576574ec2cd8c2d73 * ``` */ class Network extends pulumi.CustomResource { /** * Get an existing Network resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new Network(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Network. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Network.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["attachable"] = state?.attachable; resourceInputs["checkDuplicate"] = state?.checkDuplicate; resourceInputs["driver"] = state?.driver; resourceInputs["ingress"] = state?.ingress; resourceInputs["internal"] = state?.internal; resourceInputs["ipamConfigs"] = state?.ipamConfigs; resourceInputs["ipamDriver"] = state?.ipamDriver; resourceInputs["ipamOptions"] = state?.ipamOptions; resourceInputs["ipv6"] = state?.ipv6; resourceInputs["labels"] = state?.labels; resourceInputs["name"] = state?.name; resourceInputs["options"] = state?.options; resourceInputs["scope"] = state?.scope; } else { const args = argsOrState; resourceInputs["attachable"] = args?.attachable; resourceInputs["checkDuplicate"] = args?.checkDuplicate; resourceInputs["driver"] = args?.driver; resourceInputs["ingress"] = args?.ingress; resourceInputs["internal"] = args?.internal; resourceInputs["ipamConfigs"] = args?.ipamConfigs; resourceInputs["ipamDriver"] = args?.ipamDriver; resourceInputs["ipamOptions"] = args?.ipamOptions; resourceInputs["ipv6"] = args?.ipv6; resourceInputs["labels"] = args?.labels; resourceInputs["name"] = args?.name; resourceInputs["options"] = args?.options; resourceInputs["scope"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Network.__pulumiType, name, resourceInputs, opts); } } exports.Network = Network; /** @internal */ Network.__pulumiType = 'docker:index/network:Network'; //# sourceMappingURL=network.js.map