UNPKG

@pulumi/openstack

Version:

A Pulumi package for creating and managing OpenStack cloud resources.

96 lines 3.66 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.FlavorAccess = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a project access for flavor V2 resource within OpenStack. * * > **Note:** You _must_ have admin privileges in your OpenStack cloud to use * this resource. * * *** * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * * const project1 = new openstack.identity.Project("project_1", {name: "my-project"}); * const flavor1 = new openstack.compute.Flavor("flavor_1", { * name: "my-flavor", * ram: 8096, * vcpus: 2, * disk: 20, * isPublic: false, * }); * const access1 = new openstack.compute.FlavorAccess("access_1", { * tenantId: project1.id, * flavorId: flavor1.id, * }); * ``` * * ## Import * * This resource can be imported by specifying all two arguments, separated * by a forward slash: * * ```sh * $ pulumi import openstack:compute/flavorAccess:FlavorAccess access_1 flavor_id/tenant_id * ``` */ class FlavorAccess extends pulumi.CustomResource { /** * Get an existing FlavorAccess 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 FlavorAccess(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of FlavorAccess. 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'] === FlavorAccess.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["flavorId"] = state ? state.flavorId : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["tenantId"] = state ? state.tenantId : undefined; } else { const args = argsOrState; if ((!args || args.flavorId === undefined) && !opts.urn) { throw new Error("Missing required property 'flavorId'"); } if ((!args || args.tenantId === undefined) && !opts.urn) { throw new Error("Missing required property 'tenantId'"); } resourceInputs["flavorId"] = args ? args.flavorId : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["tenantId"] = args ? args.tenantId : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(FlavorAccess.__pulumiType, name, resourceInputs, opts); } } exports.FlavorAccess = FlavorAccess; /** @internal */ FlavorAccess.__pulumiType = 'openstack:compute/flavorAccess:FlavorAccess'; //# sourceMappingURL=flavorAccess.js.map