@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
214 lines • 8.82 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.Datastore = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* An analytics datastore for an Apigee organization. Datastores configure
* export destinations for Apigee Analytics data, supporting either Google
* Cloud Storage (GCS) or BigQuery as targets.
*
* To get more information about Datastore, see:
*
* * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.analytics.datastores)
* * How-to Guides
* * [Export analytics data](https://cloud.google.com/apigee/docs/api-platform/analytics/analytics-export)
*
* ## Example Usage
*
* ### Apigee Datastore 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 analyticsBucket = new gcp.storage.Bucket("analytics_bucket", {
* name: "my-analytics-bucket",
* location: "US",
* });
* const apigeeDatastore = new gcp.apigee.Datastore("apigee_datastore", {
* orgId: apigeeOrg.id,
* displayName: "my_datastore",
* targetType: "gcs",
* datastoreConfig: {
* projectId: current.then(current => current.project),
* bucketName: analyticsBucket.name,
* path: "/analytics",
* },
* });
* ```
* ### Apigee Datastore Bigquery
*
* ```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 analyticsDataset = new gcp.bigquery.Dataset("analytics_dataset", {
* datasetId: "my_analytics_dataset",
* location: "US",
* });
* const apigeeDatastore = new gcp.apigee.Datastore("apigee_datastore", {
* orgId: apigeeOrg.id,
* displayName: "my_bigquery_datastore",
* targetType: "bigquery",
* datastoreConfig: {
* projectId: current.then(current => current.project),
* datasetName: analyticsDataset.datasetId,
* tablePrefix: "apigee_",
* },
* });
* ```
*
* ## Import
*
* Datastore can be imported using any of these accepted formats:
*
* * `{{org_id}}/analytics/datastores/{{name}}`
* * `{{org_id}}/{{name}}`
*
* When using the `pulumi import` command, Datastore can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:apigee/datastore:Datastore default {{org_id}}/analytics/datastores/{{name}}
* $ pulumi import gcp:apigee/datastore:Datastore default {{org_id}}/{{name}}
* ```
*/
class Datastore extends pulumi.CustomResource {
/**
* Get an existing Datastore 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 Datastore(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:apigee/datastore:Datastore';
/**
* Returns true if the given object is an instance of Datastore. 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'] === Datastore.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createTime"] = state?.createTime;
resourceInputs["datastoreConfig"] = state?.datastoreConfig;
resourceInputs["deletionPolicy"] = state?.deletionPolicy;
resourceInputs["displayName"] = state?.displayName;
resourceInputs["lastUpdateTime"] = state?.lastUpdateTime;
resourceInputs["name"] = state?.name;
resourceInputs["org"] = state?.org;
resourceInputs["orgId"] = state?.orgId;
resourceInputs["self"] = state?.self;
resourceInputs["targetType"] = state?.targetType;
}
else {
const args = argsOrState;
if (args?.datastoreConfig === undefined && !opts.urn) {
throw new Error("Missing required property 'datastoreConfig'");
}
if (args?.displayName === undefined && !opts.urn) {
throw new Error("Missing required property 'displayName'");
}
if (args?.orgId === undefined && !opts.urn) {
throw new Error("Missing required property 'orgId'");
}
if (args?.targetType === undefined && !opts.urn) {
throw new Error("Missing required property 'targetType'");
}
resourceInputs["datastoreConfig"] = args?.datastoreConfig;
resourceInputs["deletionPolicy"] = args?.deletionPolicy;
resourceInputs["displayName"] = args?.displayName;
resourceInputs["orgId"] = args?.orgId;
resourceInputs["targetType"] = args?.targetType;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["lastUpdateTime"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["org"] = undefined /*out*/;
resourceInputs["self"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Datastore.__pulumiType, name, resourceInputs, opts);
}
}
exports.Datastore = Datastore;
//# sourceMappingURL=datastore.js.map