UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

200 lines • 8.18 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! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.AppConnection = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(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}} * $ pulumi import gcp:beyondcorp/appConnection:AppConnection default {{project}}/{{region}}/{{name}} * $ pulumi import gcp:beyondcorp/appConnection:AppConnection default {{region}}/{{name}} * $ 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 }); } /** @internal */ static __pulumiType = 'gcp:beyondcorp/appConnection:AppConnection'; /** * 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["deletionPolicy"] = state?.deletionPolicy; 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["deletionPolicy"] = args?.deletionPolicy; 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; //# sourceMappingURL=appConnection.js.map