UNPKG

@pulumi/gcp

Version:

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

157 lines 6.74 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.DataCollector = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * A `DataCollector` collects and stores data from the runtime for use in * Analytics custom reports or API monetization. Data collectors are scoped * to an Apigee organization. * * To get more information about DataCollector, see: * * * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.datacollectors) * * How-to Guides * * [Creating a data collector](https://cloud.google.com/apigee/docs/api-platform/analytics/custom-reports) * * ## Example Usage * * ### Apigee Data Collector Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const current = gcp.organizations.getClientConfig({}); * const apigeeNetwork = new gcp.compute.Network("apigee_network", {name: "apigee-network"}); * const apigeeRange = new gcp.compute.GlobalAddress("apigee_range", { * name: "apigee-range", * purpose: "VPC_PEERING", * addressType: "INTERNAL", * prefixLength: 16, * network: apigeeNetwork.id, * }); * const apigeeVpcConnection = new gcp.servicenetworking.Connection("apigee_vpc_connection", { * network: apigeeNetwork.id, * service: "servicenetworking.googleapis.com", * reservedPeeringRanges: [apigeeRange.name], * }); * const apigeeOrg = new gcp.apigee.Organization("apigee_org", { * analyticsRegion: "us-central1", * projectId: current.then(current => current.project), * authorizedNetwork: apigeeNetwork.id, * }, { * dependsOn: [apigeeVpcConnection], * }); * const apigeeDataCollector = new gcp.apigee.DataCollector("apigee_data_collector", { * orgId: apigeeOrg.id, * dataCollectorId: "dc_my_data_collector", * description: "A data collector for custom analytics", * type: "INTEGER", * }); * ``` * * ## Import * * DataCollector can be imported using any of these accepted formats: * * * `{{org_id}}/datacollectors/{{data_collector_id}}` * * `{{org_id}}/{{data_collector_id}}` * * When using the `pulumi import` command, DataCollector can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:apigee/dataCollector:DataCollector default {{org_id}}/datacollectors/{{data_collector_id}} * $ pulumi import gcp:apigee/dataCollector:DataCollector default {{org_id}}/{{data_collector_id}} * ``` */ class DataCollector extends pulumi.CustomResource { /** * Get an existing DataCollector 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 DataCollector(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:apigee/dataCollector:DataCollector'; /** * Returns true if the given object is an instance of DataCollector. 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'] === DataCollector.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createdAt"] = state?.createdAt; resourceInputs["dataCollectorId"] = state?.dataCollectorId; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["description"] = state?.description; resourceInputs["lastModifiedAt"] = state?.lastModifiedAt; resourceInputs["name"] = state?.name; resourceInputs["orgId"] = state?.orgId; resourceInputs["type"] = state?.type; } else { const args = argsOrState; if (args?.dataCollectorId === undefined && !opts.urn) { throw new Error("Missing required property 'dataCollectorId'"); } if (args?.orgId === undefined && !opts.urn) { throw new Error("Missing required property 'orgId'"); } if (args?.type === undefined && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["dataCollectorId"] = args?.dataCollectorId; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["orgId"] = args?.orgId; resourceInputs["type"] = args?.type; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["lastModifiedAt"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(DataCollector.__pulumiType, name, resourceInputs, opts); } } exports.DataCollector = DataCollector; //# sourceMappingURL=dataCollector.js.map