"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.AppConnection = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A BeyondCorp AppConnection resource represents a BeyondCorp protected AppConnection to a remote application.
 * It creates all the necessary GCP components needed for creating a BeyondCorp protected AppConnection.
 * Multiple connectors can be authorised for a single AppConnection.
 *
 * To get more information about AppConnection, see:
 *
 * * [API documentation](https://cloud.google.com/beyondcorp/docs/reference/rest#rest-resource:-v1.projects.locations.appconnections)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/beyondcorp-enterprise/docs/enable-app-connector)
 *
 * ## Example Usage
 *
 * ### Beyondcorp App Connection Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const serviceAccount = new gcp.serviceaccount.Account("service_account", {
 *     accountId: "my-account",
 *     displayName: "Test Service Account",
 * });
 * const appConnector = new gcp.beyondcorp.AppConnector("app_connector", {
 *     name: "my-app-connector",
 *     principalInfo: {
 *         serviceAccount: {
 *             email: serviceAccount.email,
 *         },
 *     },
 * });
 * const appConnection = new gcp.beyondcorp.AppConnection("app_connection", {
 *     name: "my-app-connection",
 *     type: "TCP_PROXY",
 *     applicationEndpoint: {
 *         host: "foo-host",
 *         port: 8080,
 *     },
 *     connectors: [appConnector.id],
 * });
 * ```
 * ### Beyondcorp App Connection Full
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const serviceAccount = new gcp.serviceaccount.Account("service_account", {
 *     accountId: "my-account",
 *     displayName: "Test Service Account",
 * });
 * const appGateway = new gcp.beyondcorp.AppGateway("app_gateway", {
 *     name: "my-app-gateway",
 *     type: "TCP_PROXY",
 *     hostType: "GCP_REGIONAL_MIG",
 * });
 * const appConnector = new gcp.beyondcorp.AppConnector("app_connector", {
 *     name: "my-app-connector",
 *     principalInfo: {
 *         serviceAccount: {
 *             email: serviceAccount.email,
 *         },
 *     },
 * });
 * const appConnection = new gcp.beyondcorp.AppConnection("app_connection", {
 *     name: "my-app-connection",
 *     type: "TCP_PROXY",
 *     displayName: "some display name",
 *     applicationEndpoint: {
 *         host: "foo-host",
 *         port: 8080,
 *     },
 *     connectors: [appConnector.id],
 *     gateway: {
 *         appGateway: appGateway.id,
 *     },
 *     labels: {
 *         foo: "bar",
 *         bar: "baz",
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * AppConnection can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{region}}/appConnections/{{name}}`
 *
 * * `{{project}}/{{region}}/{{name}}`
 *
 * * `{{region}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, AppConnection can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:beyondcorp/appConnection:AppConnection default projects/{{project}}/locations/{{region}}/appConnections/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:beyondcorp/appConnection:AppConnection default {{project}}/{{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:beyondcorp/appConnection:AppConnection default {{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:beyondcorp/appConnection:AppConnection default {{name}}
 * ```
 */
class AppConnection extends pulumi.CustomResource {
    /**
     * Get an existing AppConnection 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 AppConnection(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of AppConnection.  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'] === AppConnection.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["applicationEndpoint"] = state?.applicationEndpoint;
            resourceInputs["connectors"] = state?.connectors;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["gateway"] = state?.gateway;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["region"] = state?.region;
            resourceInputs["type"] = state?.type;
        }
        else {
            const args = argsOrState;
            if (args?.applicationEndpoint === undefined && !opts.urn) {
                throw new Error("Missing required property 'applicationEndpoint'");
            }
            resourceInputs["applicationEndpoint"] = args?.applicationEndpoint;
            resourceInputs["connectors"] = args?.connectors;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["gateway"] = args?.gateway;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["name"] = args?.name;
            resourceInputs["project"] = args?.project;
            resourceInputs["region"] = args?.region;
            resourceInputs["type"] = args?.type;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(AppConnection.__pulumiType, name, resourceInputs, opts);
    }
}
exports.AppConnection = AppConnection;
/** @internal */
AppConnection.__pulumiType = 'gcp:beyondcorp/appConnection:AppConnection';
//# sourceMappingURL=appConnection.js.map