UNPKG

@pulumi/openstack

Version:

A Pulumi package for creating and managing OpenStack cloud resources.

179 lines 7 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.ShareAccess = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * ## Example Usage * * ### NFS * * ```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 with security services", * neutronNetId: network1.id, * neutronSubnetId: subnet1.id, * }); * const share1 = new openstack.sharedfilesystem.Share("share_1", { * name: "nfs_share", * description: "test share description", * shareProto: "NFS", * size: 1, * shareNetworkId: sharenetwork1.id, * }); * const shareAccess1 = new openstack.sharedfilesystem.ShareAccess("share_access_1", { * shareId: share1.id, * accessType: "ip", * accessTo: "192.168.199.10", * accessLevel: "rw", * }); * ``` * * ### CIFS * * ```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_secure", * description: "share the secure love", * neutronNetId: network1.id, * neutronSubnetId: subnet1.id, * securityServiceIds: [securityservice1.id], * }); * const share1 = new openstack.sharedfilesystem.Share("share_1", { * name: "cifs_share", * shareProto: "CIFS", * size: 1, * shareNetworkId: sharenetwork1.id, * }); * const shareAccess1 = new openstack.sharedfilesystem.ShareAccess("share_access_1", { * shareId: share1.id, * accessType: "user", * accessTo: "windows", * accessLevel: "ro", * }); * const shareAccess2 = new openstack.sharedfilesystem.ShareAccess("share_access_2", { * shareId: share1.id, * accessType: "user", * accessTo: "linux", * accessLevel: "rw", * }); * export const exportLocations = share1.exportLocations; * ``` * * ## Import * * This resource can be imported by specifying the ID of the share and the ID of the * share access, separated by a slash, e.g.: * * ```sh * $ pulumi import openstack:sharedfilesystem/shareAccess:ShareAccess share_access_1 share_id/share_access_id * ``` */ class ShareAccess extends pulumi.CustomResource { /** * Get an existing ShareAccess 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 ShareAccess(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ShareAccess. 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'] === ShareAccess.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessKey"] = state ? state.accessKey : undefined; resourceInputs["accessLevel"] = state ? state.accessLevel : undefined; resourceInputs["accessTo"] = state ? state.accessTo : undefined; resourceInputs["accessType"] = state ? state.accessType : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["shareId"] = state ? state.shareId : undefined; resourceInputs["state"] = state ? state.state : undefined; } else { const args = argsOrState; if ((!args || args.accessLevel === undefined) && !opts.urn) { throw new Error("Missing required property 'accessLevel'"); } if ((!args || args.accessTo === undefined) && !opts.urn) { throw new Error("Missing required property 'accessTo'"); } if ((!args || args.accessType === undefined) && !opts.urn) { throw new Error("Missing required property 'accessType'"); } if ((!args || args.shareId === undefined) && !opts.urn) { throw new Error("Missing required property 'shareId'"); } resourceInputs["accessLevel"] = args ? args.accessLevel : undefined; resourceInputs["accessTo"] = args ? args.accessTo : undefined; resourceInputs["accessType"] = args ? args.accessType : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["shareId"] = args ? args.shareId : undefined; resourceInputs["accessKey"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["accessKey"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(ShareAccess.__pulumiType, name, resourceInputs, opts); } } exports.ShareAccess = ShareAccess; /** @internal */ ShareAccess.__pulumiType = 'openstack:sharedfilesystem/shareAccess:ShareAccess'; //# sourceMappingURL=shareAccess.js.map