@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
284 lines • 12.1 kB
JavaScript
;
// *** 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.AccountConnector = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* Description
*
* ## Example Usage
*
* ### Developer Connect Account Connector Github
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const my_account_connector = new gcp.developerconnect.AccountConnector("my-account-connector", {
* location: "us-central1",
* accountConnectorId: "my-ac",
* providerOauthConfig: {
* systemProviderId: "GITHUB",
* scopes: ["repo"],
* },
* });
* ```
* ### Developer Connect Account Connector Gitlab
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const my_account_connector = new gcp.developerconnect.AccountConnector("my-account-connector", {
* location: "us-central1",
* accountConnectorId: "my-ac",
* providerOauthConfig: {
* systemProviderId: "GITLAB",
* scopes: ["api"],
* },
* });
* ```
* ### Developer Connect Account Connector Ghe
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const gheAcClientId = new gcp.secretmanager.Secret("ghe_ac_client_id", {
* secretId: "ghe-ac-id",
* replication: {
* auto: {},
* },
* });
* const gheAcClientIdVersion = new gcp.secretmanager.SecretVersion("ghe_ac_client_id_version", {
* secret: gheAcClientId.name,
* secretData: "dummy-client-id",
* });
* const gheAcClientSecret = new gcp.secretmanager.Secret("ghe_ac_client_secret", {
* secretId: "ghe-ac-sec",
* replication: {
* auto: {},
* },
* });
* const gheAcClientSecretVersion = new gcp.secretmanager.SecretVersion("ghe_ac_client_secret_version", {
* secret: gheAcClientSecret.name,
* secretData: "dummy-client-secret",
* });
* const my_account_connector = new gcp.developerconnect.AccountConnector("my-account-connector", {
* location: "us-central1",
* accountConnectorId: "my-ac",
* customOauthConfig: {
* authUri: "https://ghe.proctor-staging-test.com/login/oauth/authorize",
* clientId: gheAcClientIdVersion.secretData,
* clientSecret: gheAcClientSecretVersion.secretData,
* tokenUri: "https://ghe.proctor-staging-test.com/login/oauth/access_token",
* hostUri: "https://ghe.proctor-staging-test.com",
* scmProvider: "GITHUB_ENTERPRISE",
* scopes: ["repo"],
* },
* });
* ```
* ### Developer Connect Account Connector Gle
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const gleAcClientId = new gcp.secretmanager.Secret("gle_ac_client_id", {
* secretId: "gle-ac-id",
* replication: {
* auto: {},
* },
* });
* const gleAcClientIdVersion = new gcp.secretmanager.SecretVersion("gle_ac_client_id_version", {
* secret: gleAcClientId.name,
* secretData: "dummy-client-id",
* });
* const gleAcClientSecret = new gcp.secretmanager.Secret("gle_ac_client_secret", {
* secretId: "gle-ac-sec",
* replication: {
* auto: {},
* },
* });
* const gleAcClientSecretVersion = new gcp.secretmanager.SecretVersion("gle_ac_client_secret_version", {
* secret: gleAcClientSecret.name,
* secretData: "dummy-client-secret",
* });
* const my_account_connector = new gcp.developerconnect.AccountConnector("my-account-connector", {
* location: "us-central1",
* accountConnectorId: "my-ac",
* customOauthConfig: {
* authUri: "https://gle-us-central1.gcb-test.com/oauth/authorize",
* clientId: gleAcClientIdVersion.secretData,
* clientSecret: gleAcClientSecretVersion.secretData,
* tokenUri: "https://gle-us-central1.gcb-test.com/oauth/token",
* hostUri: "https://gle-us-central1.gcb-test.com",
* scmProvider: "GITLAB_ENTERPRISE",
* scopes: ["api"],
* },
* });
* ```
* ### Developer Connect Account Connector Bbdc
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const bbdcAcPrivClientId = new gcp.secretmanager.Secret("bbdc_ac_priv_client_id", {
* secretId: "bbdc-ac-id",
* replication: {
* auto: {},
* },
* });
* const bbdcAcPrivClientIdVersion = new gcp.secretmanager.SecretVersion("bbdc_ac_priv_client_id_version", {
* secret: bbdcAcPrivClientId.name,
* secretData: "dummy-client-id",
* });
* const bbdcAcPrivClientSecret = new gcp.secretmanager.Secret("bbdc_ac_priv_client_secret", {
* secretId: "bbdc-ac-sec",
* replication: {
* auto: {},
* },
* });
* const bbdcAcPrivClientSecretVersion = new gcp.secretmanager.SecretVersion("bbdc_ac_priv_client_secret_version", {
* secret: bbdcAcPrivClientSecret.name,
* secretData: "dummy-client-secret",
* });
* const my_account_connector = new gcp.developerconnect.AccountConnector("my-account-connector", {
* location: "us-central1",
* accountConnectorId: "my-ac",
* customOauthConfig: {
* authUri: "https://bitbucket-us-central.gcb-test.com/rest/oauth2/latest/authorize",
* clientId: bbdcAcPrivClientIdVersion.secretData,
* clientSecret: bbdcAcPrivClientSecretVersion.secretData,
* tokenUri: "https://bitbucket-us-central.gcb-test.com/rest/oauth2/latest/token",
* hostUri: "https://bitbucket-us-central.gcb-test.com",
* scmProvider: "BITBUCKET_DATA_CENTER",
* scopes: ["REPO_ADMIN"],
* },
* });
* ```
*
* ## Import
*
* AccountConnector can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/accountConnectors/{{account_connector_id}}`
* * `{{project}}/{{location}}/{{account_connector_id}}`
* * `{{location}}/{{account_connector_id}}`
*
* When using the `pulumi import` command, AccountConnector can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:developerconnect/accountConnector:AccountConnector default projects/{{project}}/locations/{{location}}/accountConnectors/{{account_connector_id}}
* $ pulumi import gcp:developerconnect/accountConnector:AccountConnector default {{project}}/{{location}}/{{account_connector_id}}
* $ pulumi import gcp:developerconnect/accountConnector:AccountConnector default {{location}}/{{account_connector_id}}
* ```
*/
class AccountConnector extends pulumi.CustomResource {
/**
* Get an existing AccountConnector 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 AccountConnector(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:developerconnect/accountConnector:AccountConnector';
/**
* Returns true if the given object is an instance of AccountConnector. 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'] === AccountConnector.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountConnectorId"] = state?.accountConnectorId;
resourceInputs["annotations"] = state?.annotations;
resourceInputs["createTime"] = state?.createTime;
resourceInputs["customOauthConfig"] = state?.customOauthConfig;
resourceInputs["deletionPolicy"] = state?.deletionPolicy;
resourceInputs["effectiveAnnotations"] = state?.effectiveAnnotations;
resourceInputs["effectiveLabels"] = state?.effectiveLabels;
resourceInputs["etag"] = state?.etag;
resourceInputs["labels"] = state?.labels;
resourceInputs["location"] = state?.location;
resourceInputs["name"] = state?.name;
resourceInputs["oauthStartUri"] = state?.oauthStartUri;
resourceInputs["project"] = state?.project;
resourceInputs["providerOauthConfig"] = state?.providerOauthConfig;
resourceInputs["proxyConfig"] = state?.proxyConfig;
resourceInputs["pulumiLabels"] = state?.pulumiLabels;
resourceInputs["updateTime"] = state?.updateTime;
}
else {
const args = argsOrState;
if (args?.accountConnectorId === undefined && !opts.urn) {
throw new Error("Missing required property 'accountConnectorId'");
}
if (args?.location === undefined && !opts.urn) {
throw new Error("Missing required property 'location'");
}
resourceInputs["accountConnectorId"] = args?.accountConnectorId;
resourceInputs["annotations"] = args?.annotations;
resourceInputs["customOauthConfig"] = args?.customOauthConfig;
resourceInputs["deletionPolicy"] = args?.deletionPolicy;
resourceInputs["etag"] = args?.etag;
resourceInputs["labels"] = args?.labels;
resourceInputs["location"] = args?.location;
resourceInputs["project"] = args?.project;
resourceInputs["providerOauthConfig"] = args?.providerOauthConfig;
resourceInputs["proxyConfig"] = args?.proxyConfig;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["effectiveAnnotations"] = undefined /*out*/;
resourceInputs["effectiveLabels"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["oauthStartUri"] = 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(AccountConnector.__pulumiType, name, resourceInputs, opts);
}
}
exports.AccountConnector = AccountConnector;
//# sourceMappingURL=accountConnector.js.map