@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
187 lines • 7.48 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.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, Object.assign(Object.assign({}, 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 ? state.applicationEndpoint : undefined;
resourceInputs["connectors"] = state ? state.connectors : undefined;
resourceInputs["displayName"] = state ? state.displayName : undefined;
resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined;
resourceInputs["gateway"] = state ? state.gateway : undefined;
resourceInputs["labels"] = state ? state.labels : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["type"] = state ? state.type : undefined;
}
else {
const args = argsOrState;
if ((!args || args.applicationEndpoint === undefined) && !opts.urn) {
throw new Error("Missing required property 'applicationEndpoint'");
}
resourceInputs["applicationEndpoint"] = args ? args.applicationEndpoint : undefined;
resourceInputs["connectors"] = args ? args.connectors : undefined;
resourceInputs["displayName"] = args ? args.displayName : undefined;
resourceInputs["gateway"] = args ? args.gateway : undefined;
resourceInputs["labels"] = args ? args.labels : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["type"] = args ? args.type : undefined;
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