UNPKG

@pulumi/openstack

Version:

A Pulumi package for creating and managing OpenStack cloud resources.

151 lines 6.29 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.ShareNetwork = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Use this resource to configure a share network. * * A share network stores network information that share servers can use when * shares are created. * * ## Example Usage * * ### Basic share network * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * * const network1 = new openstack.networking.Network("network_1", { * name: "network_1", * adminStateUp: true, * }); * const subnet1 = new openstack.networking.Subnet("subnet_1", { * name: "subnet_1", * cidr: "192.168.199.0/24", * ipVersion: 4, * networkId: network1.id, * }); * const sharenetwork1 = new openstack.sharedfilesystem.ShareNetwork("sharenetwork_1", { * name: "test_sharenetwork", * description: "test share network", * neutronNetId: network1.id, * neutronSubnetId: subnet1.id, * }); * ``` * * ### Share network with associated security services * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * * const network1 = new openstack.networking.Network("network_1", { * name: "network_1", * adminStateUp: true, * }); * const subnet1 = new openstack.networking.Subnet("subnet_1", { * name: "subnet_1", * cidr: "192.168.199.0/24", * ipVersion: 4, * networkId: network1.id, * }); * const securityservice1 = new openstack.sharedfilesystem.SecurityService("securityservice_1", { * name: "security", * description: "created by terraform", * type: "active_directory", * server: "192.168.199.10", * dnsIp: "192.168.199.10", * domain: "example.com", * ou: "CN=Computers,DC=example,DC=com", * user: "joinDomainUser", * password: "s8cret", * }); * const sharenetwork1 = new openstack.sharedfilesystem.ShareNetwork("sharenetwork_1", { * name: "test_sharenetwork", * description: "test share network with security services", * neutronNetId: network1.id, * neutronSubnetId: subnet1.id, * securityServiceIds: [securityservice1.id], * }); * ``` * * ## Import * * This resource can be imported by specifying the ID of the share network: * * ```sh * $ pulumi import openstack:sharedfilesystem/shareNetwork:ShareNetwork sharenetwork_1 id * ``` */ class ShareNetwork extends pulumi.CustomResource { /** * Get an existing ShareNetwork 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 ShareNetwork(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ShareNetwork. 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'] === ShareNetwork.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["cidr"] = state ? state.cidr : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["ipVersion"] = state ? state.ipVersion : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["networkType"] = state ? state.networkType : undefined; resourceInputs["neutronNetId"] = state ? state.neutronNetId : undefined; resourceInputs["neutronSubnetId"] = state ? state.neutronSubnetId : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["securityServiceIds"] = state ? state.securityServiceIds : undefined; resourceInputs["segmentationId"] = state ? state.segmentationId : undefined; } else { const args = argsOrState; if ((!args || args.neutronNetId === undefined) && !opts.urn) { throw new Error("Missing required property 'neutronNetId'"); } if ((!args || args.neutronSubnetId === undefined) && !opts.urn) { throw new Error("Missing required property 'neutronSubnetId'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["neutronNetId"] = args ? args.neutronNetId : undefined; resourceInputs["neutronSubnetId"] = args ? args.neutronSubnetId : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["securityServiceIds"] = args ? args.securityServiceIds : undefined; resourceInputs["cidr"] = undefined /*out*/; resourceInputs["ipVersion"] = undefined /*out*/; resourceInputs["networkType"] = undefined /*out*/; resourceInputs["projectId"] = undefined /*out*/; resourceInputs["segmentationId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ShareNetwork.__pulumiType, name, resourceInputs, opts); } } exports.ShareNetwork = ShareNetwork; /** @internal */ ShareNetwork.__pulumiType = 'openstack:sharedfilesystem/shareNetwork:ShareNetwork'; //# sourceMappingURL=shareNetwork.js.map