@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
133 lines • 5.04 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.LiteTopic = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* A named resource to which messages are sent by publishers.
*
* To get more information about Topic, see:
*
* * [API documentation](https://cloud.google.com/pubsub/lite/docs/reference/rest/v1/admin.projects.locations.topics)
* * How-to Guides
* * [Managing Topics](https://cloud.google.com/pubsub/lite/docs/topics)
*
* ## Example Usage
*
* ### Pubsub Lite Topic Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const project = gcp.organizations.getProject({});
* const example = new gcp.pubsub.LiteReservation("example", {
* name: "example-reservation",
* project: project.then(project => project.number),
* throughputCapacity: 2,
* });
* const exampleLiteTopic = new gcp.pubsub.LiteTopic("example", {
* name: "example-topic",
* project: project.then(project => project.number),
* partitionConfig: {
* count: 1,
* capacity: {
* publishMibPerSec: 4,
* subscribeMibPerSec: 8,
* },
* },
* retentionConfig: {
* perPartitionBytes: "32212254720",
* },
* reservationConfig: {
* throughputReservation: example.name,
* },
* });
* ```
*
* ## Import
*
* Topic can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{zone}}/topics/{{name}}`
*
* * `{{project}}/{{zone}}/{{name}}`
*
* * `{{zone}}/{{name}}`
*
* * `{{name}}`
*
* When using the `pulumi import` command, Topic can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:pubsub/liteTopic:LiteTopic default projects/{{project}}/locations/{{zone}}/topics/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:pubsub/liteTopic:LiteTopic default {{project}}/{{zone}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:pubsub/liteTopic:LiteTopic default {{zone}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:pubsub/liteTopic:LiteTopic default {{name}}
* ```
*/
class LiteTopic extends pulumi.CustomResource {
/**
* Get an existing LiteTopic 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 LiteTopic(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of LiteTopic. 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'] === LiteTopic.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["partitionConfig"] = state ? state.partitionConfig : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["reservationConfig"] = state ? state.reservationConfig : undefined;
resourceInputs["retentionConfig"] = state ? state.retentionConfig : undefined;
resourceInputs["zone"] = state ? state.zone : undefined;
}
else {
const args = argsOrState;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["partitionConfig"] = args ? args.partitionConfig : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["reservationConfig"] = args ? args.reservationConfig : undefined;
resourceInputs["retentionConfig"] = args ? args.retentionConfig : undefined;
resourceInputs["zone"] = args ? args.zone : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(LiteTopic.__pulumiType, name, resourceInputs, opts);
}
}
exports.LiteTopic = LiteTopic;
/** @internal */
LiteTopic.__pulumiType = 'gcp:pubsub/liteTopic:LiteTopic';
//# sourceMappingURL=liteTopic.js.map