@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
127 lines • 5.33 kB
JavaScript
;
// *** 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.AccessLevel = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* An AccessLevel is a label that can be applied to requests to GCP services,
* along with a list of requirements necessary for the label to be applied.
*
* To get more information about AccessLevel, see:
*
* * [API documentation](https://cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.accessLevels)
* * How-to Guides
* * [Access Policy Quickstart](https://cloud.google.com/access-context-manager/docs/quickstart)
*
* > **Warning:** If you are using User ADCs (Application Default Credentials) with this resource,
* you must specify a `billingProject` and set `userProjectOverride` to true
* in the provider configuration. Otherwise the ACM API will return a 403 error.
* Your account must have the `serviceusage.services.use` permission on the
* `billingProject` you defined.
*
* ## Example Usage
*
* ### Access Context Manager Access Level Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const access_policy = new gcp.accesscontextmanager.AccessPolicy("access-policy", {
* parent: "organizations/123456789",
* title: "my policy",
* });
* const access_level = new gcp.accesscontextmanager.AccessLevel("access-level", {
* parent: pulumi.interpolate`accessPolicies/${access_policy.name}`,
* name: pulumi.interpolate`accessPolicies/${access_policy.name}/accessLevels/chromeos_no_lock`,
* title: "chromeos_no_lock",
* basic: {
* conditions: [{
* devicePolicy: {
* requireScreenLock: true,
* osConstraints: [{
* osType: "DESKTOP_CHROME_OS",
* }],
* },
* regions: [
* "CH",
* "IT",
* "US",
* ],
* }],
* },
* });
* ```
*
* ## Import
*
* AccessLevel can be imported using any of these accepted formats:
*
* * `{{name}}`
*
* When using the `pulumi import` command, AccessLevel can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:accesscontextmanager/accessLevel:AccessLevel default {{name}}
* ```
*/
class AccessLevel extends pulumi.CustomResource {
/**
* Get an existing AccessLevel 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 AccessLevel(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of AccessLevel. 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'] === AccessLevel.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["basic"] = state ? state.basic : undefined;
resourceInputs["custom"] = state ? state.custom : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["parent"] = state ? state.parent : undefined;
resourceInputs["title"] = state ? state.title : undefined;
}
else {
const args = argsOrState;
if ((!args || args.parent === undefined) && !opts.urn) {
throw new Error("Missing required property 'parent'");
}
if ((!args || args.title === undefined) && !opts.urn) {
throw new Error("Missing required property 'title'");
}
resourceInputs["basic"] = args ? args.basic : undefined;
resourceInputs["custom"] = args ? args.custom : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["parent"] = args ? args.parent : undefined;
resourceInputs["title"] = args ? args.title : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AccessLevel.__pulumiType, name, resourceInputs, opts);
}
}
exports.AccessLevel = AccessLevel;
/** @internal */
AccessLevel.__pulumiType = 'gcp:accesscontextmanager/accessLevel:AccessLevel';
//# sourceMappingURL=accessLevel.js.map