"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.AuthzExtension = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * AuthzExtension is a resource that allows traffic forwarding to a callout backend service to make an authorization decision.
 *
 * To get more information about AuthzExtension, see:
 *
 * * [API documentation](https://cloud.google.com/service-extensions/docs/reference/rest/v1beta1/projects.locations.authzExtensions)
 *
 * ## Example Usage
 *
 * ### Network Services Authz Extension Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const _default = new gcp.compute.RegionBackendService("default", {
 *     name: "authz-service",
 *     project: "my-project-name",
 *     region: "us-west1",
 *     protocol: "HTTP2",
 *     loadBalancingScheme: "INTERNAL_MANAGED",
 *     portName: "grpc",
 * });
 * const defaultAuthzExtension = new gcp.networkservices.AuthzExtension("default", {
 *     name: "my-authz-ext",
 *     project: "my-project-name",
 *     location: "us-west1",
 *     description: "my description",
 *     loadBalancingScheme: "INTERNAL_MANAGED",
 *     authority: "ext11.com",
 *     service: _default.selfLink,
 *     timeout: "0.1s",
 *     failOpen: false,
 *     forwardHeaders: ["Authorization"],
 * });
 * ```
 *
 * ## Import
 *
 * AuthzExtension can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/authzExtensions/{{name}}`
 *
 * * `{{project}}/{{location}}/{{name}}`
 *
 * * `{{location}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, AuthzExtension can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:networkservices/authzExtension:AuthzExtension default projects/{{project}}/locations/{{location}}/authzExtensions/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:networkservices/authzExtension:AuthzExtension default {{project}}/{{location}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:networkservices/authzExtension:AuthzExtension default {{location}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:networkservices/authzExtension:AuthzExtension default {{name}}
 * ```
 */
class AuthzExtension extends pulumi.CustomResource {
    /**
     * Get an existing AuthzExtension 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 AuthzExtension(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of AuthzExtension.  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'] === AuthzExtension.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["authority"] = state?.authority;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["description"] = state?.description;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["failOpen"] = state?.failOpen;
            resourceInputs["forwardHeaders"] = state?.forwardHeaders;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["loadBalancingScheme"] = state?.loadBalancingScheme;
            resourceInputs["location"] = state?.location;
            resourceInputs["metadata"] = state?.metadata;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["service"] = state?.service;
            resourceInputs["timeout"] = state?.timeout;
            resourceInputs["updateTime"] = state?.updateTime;
            resourceInputs["wireFormat"] = state?.wireFormat;
        }
        else {
            const args = argsOrState;
            if (args?.authority === undefined && !opts.urn) {
                throw new Error("Missing required property 'authority'");
            }
            if (args?.loadBalancingScheme === undefined && !opts.urn) {
                throw new Error("Missing required property 'loadBalancingScheme'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.service === undefined && !opts.urn) {
                throw new Error("Missing required property 'service'");
            }
            if (args?.timeout === undefined && !opts.urn) {
                throw new Error("Missing required property 'timeout'");
            }
            resourceInputs["authority"] = args?.authority;
            resourceInputs["description"] = args?.description;
            resourceInputs["failOpen"] = args?.failOpen;
            resourceInputs["forwardHeaders"] = args?.forwardHeaders;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["loadBalancingScheme"] = args?.loadBalancingScheme;
            resourceInputs["location"] = args?.location;
            resourceInputs["metadata"] = args?.metadata;
            resourceInputs["name"] = args?.name;
            resourceInputs["project"] = args?.project;
            resourceInputs["service"] = args?.service;
            resourceInputs["timeout"] = args?.timeout;
            resourceInputs["wireFormat"] = args?.wireFormat;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(AuthzExtension.__pulumiType, name, resourceInputs, opts);
    }
}
exports.AuthzExtension = AuthzExtension;
/** @internal */
AuthzExtension.__pulumiType = 'gcp:networkservices/authzExtension:AuthzExtension';
//# sourceMappingURL=authzExtension.js.map