"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.ServicePerimeters = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Replace all existing Service Perimeters in an Access Policy with the Service Perimeters provided. This is done atomically.
 * This is a bulk edit of all Service Perimeters and may override existing Service Perimeters created by `gcp.accesscontextmanager.ServicePerimeter`,
 * thus causing a permadiff if used alongside `gcp.accesscontextmanager.ServicePerimeter` on the same parent.
 *
 * To get more information about ServicePerimeters, see:
 *
 * * [API documentation](https://cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.servicePerimeters)
 * * How-to Guides
 *     * [Guide to Ingress and Egress Rules](https://cloud.google.com/vpc-service-controls/docs/ingress-egress-rules)
 *     * [Service Perimeter Quickstart](https://cloud.google.com/vpc-service-controls/docs/quickstart)
 *
 * ## Example Usage
 *
 * ### Access Context Manager Service Perimeters 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 service_perimeter = new gcp.accesscontextmanager.ServicePerimeters("service-perimeter", {
 *     parent: pulumi.interpolate`accessPolicies/${access_policy.name}`,
 *     servicePerimeters: [
 *         {
 *             name: pulumi.interpolate`accessPolicies/${access_policy.name}/servicePerimeters/`,
 *             title: "",
 *             status: {
 *                 restrictedServices: ["storage.googleapis.com"],
 *             },
 *         },
 *         {
 *             name: pulumi.interpolate`accessPolicies/${access_policy.name}/servicePerimeters/`,
 *             title: "",
 *             status: {
 *                 restrictedServices: ["bigtable.googleapis.com"],
 *             },
 *         },
 *     ],
 * });
 * 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: false,
 *                 osConstraints: [{
 *                     osType: "DESKTOP_CHROME_OS",
 *                 }],
 *             },
 *             regions: [
 *                 "CH",
 *                 "IT",
 *                 "US",
 *             ],
 *         }],
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * ServicePerimeters can be imported using any of these accepted formats:
 *
 * * `{{parent}}/servicePerimeters`
 *
 * * `{{parent}}`
 *
 * When using the `pulumi import` command, ServicePerimeters can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:accesscontextmanager/servicePerimeters:ServicePerimeters default {{parent}}/servicePerimeters
 * ```
 *
 * ```sh
 * $ pulumi import gcp:accesscontextmanager/servicePerimeters:ServicePerimeters default {{parent}}
 * ```
 */
class ServicePerimeters extends pulumi.CustomResource {
    /**
     * Get an existing ServicePerimeters 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 ServicePerimeters(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of ServicePerimeters.  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'] === ServicePerimeters.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["parent"] = state?.parent;
            resourceInputs["servicePerimeters"] = state?.servicePerimeters;
        }
        else {
            const args = argsOrState;
            if (args?.parent === undefined && !opts.urn) {
                throw new Error("Missing required property 'parent'");
            }
            resourceInputs["parent"] = args?.parent;
            resourceInputs["servicePerimeters"] = args?.servicePerimeters;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ServicePerimeters.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ServicePerimeters = ServicePerimeters;
/** @internal */
ServicePerimeters.__pulumiType = 'gcp:accesscontextmanager/servicePerimeters:ServicePerimeters';
//# sourceMappingURL=servicePerimeters.js.map