UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

98 lines 4.08 kB
"use strict"; // *** 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! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.AccessRule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * !> **WARNING:** It has been deprecated. * * Provides an access rule resource of Scalable File Resource (SFS). * * ## Example Usage * ### Usage in VPC authorization scenarios * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const shareName = config.requireObject("shareName"); * const vpcId = config.requireObject("vpcId"); * const share_file = new huaweicloud.sfs.FileSystem("share-file", { * size: 100, * shareProto: "NFS", * }); * const rule1 = new huaweicloud.sfs.AccessRule("rule1", { * sfsId: share_file.id, * accessTo: vpcId, * }); * ``` * * ## Import * * SFS access rule can be imported by specifying the SFS ID and access rule ID separated by a slash, e.g.bash * * ```sh * $ pulumi import huaweicloud:Sfs/accessRule:AccessRule huaweicloud_sfs_access_rule <sfs_id>/<rule_id> * ``` */ class AccessRule extends pulumi.CustomResource { /** * Get an existing AccessRule 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 AccessRule(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of AccessRule. 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'] === AccessRule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; 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["sfsId"] = state ? state.sfsId : undefined; resourceInputs["status"] = state ? state.status : undefined; } else { const args = argsOrState; if ((!args || args.accessTo === undefined) && !opts.urn) { throw new Error("Missing required property 'accessTo'"); } if ((!args || args.sfsId === undefined) && !opts.urn) { throw new Error("Missing required property 'sfsId'"); } 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["sfsId"] = args ? args.sfsId : undefined; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AccessRule.__pulumiType, name, resourceInputs, opts); } } exports.AccessRule = AccessRule; /** @internal */ AccessRule.__pulumiType = 'huaweicloud:Sfs/accessRule:AccessRule'; //# sourceMappingURL=accessRule.js.map