@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
145 lines • 5.88 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.SyncAuthorization = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* Authorize the Synchronizer to download environment data from the control plane.
*
* To get more information about SyncAuthorization, see:
*
* * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations#getsyncauthorization)
* * How-to Guides
* * [Enable Synchronizer access](https://cloud.google.com/apigee/docs/hybrid/v1.8/synchronizer-access#enable-synchronizer-access)
*
* ## Example Usage
*
* ### Apigee Sync Authorization Basic Test
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const project = new gcp.organizations.Project("project", {
* projectId: "my-project",
* name: "my-project",
* orgId: "123456789",
* billingAccount: "000000-0000000-0000000-000000",
* deletionPolicy: "DELETE",
* });
* const apigee = new gcp.projects.Service("apigee", {
* project: project.projectId,
* service: "apigee.googleapis.com",
* });
* const apigeeOrg = new gcp.apigee.Organization("apigee_org", {
* analyticsRegion: "us-central1",
* projectId: project.projectId,
* runtimeType: "HYBRID",
* }, {
* dependsOn: [apigee],
* });
* const serviceAccount = new gcp.serviceaccount.Account("service_account", {
* accountId: "my-account",
* displayName: "Service Account",
* });
* const synchronizer_iam = new gcp.projects.IAMMember("synchronizer-iam", {
* project: project.projectId,
* role: "roles/apigee.synchronizerManager",
* member: pulumi.interpolate`serviceAccount:${serviceAccount.email}`,
* });
* const apigeeSyncAuthorization = new gcp.apigee.SyncAuthorization("apigee_sync_authorization", {
* name: apigeeOrg.name,
* identities: [pulumi.interpolate`serviceAccount:${serviceAccount.email}`],
* }, {
* dependsOn: [synchronizer_iam],
* });
* ```
*
* ## Import
*
* SyncAuthorization can be imported using any of these accepted formats:
*
* * `organizations/{{name}}/syncAuthorization`
* * `{{name}}`
*
* When using the `pulumi import` command, SyncAuthorization can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:apigee/syncAuthorization:SyncAuthorization default organizations/{{name}}/syncAuthorization
* $ pulumi import gcp:apigee/syncAuthorization:SyncAuthorization default {{name}}
* ```
*/
class SyncAuthorization extends pulumi.CustomResource {
/**
* Get an existing SyncAuthorization 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 SyncAuthorization(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:apigee/syncAuthorization:SyncAuthorization';
/**
* Returns true if the given object is an instance of SyncAuthorization. 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'] === SyncAuthorization.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["etag"] = state?.etag;
resourceInputs["identities"] = state?.identities;
resourceInputs["name"] = state?.name;
}
else {
const args = argsOrState;
if (args?.identities === undefined && !opts.urn) {
throw new Error("Missing required property 'identities'");
}
resourceInputs["identities"] = args?.identities;
resourceInputs["name"] = args?.name;
resourceInputs["etag"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SyncAuthorization.__pulumiType, name, resourceInputs, opts);
}
}
exports.SyncAuthorization = SyncAuthorization;
//# sourceMappingURL=syncAuthorization.js.map