@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
148 lines • 6.13 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.LiteTopic = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* > **Warning:** [Pubsub Lite is deprecated and will be turned down effective March 18, 2026](https://cloud.google.com/pubsub/lite/docs/release-notes#June_17_2024). The resource will be removed in a future major release, please use `gcp.pubsub.Topic` instead.
*
* 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}}
* $ pulumi import gcp:pubsub/liteTopic:LiteTopic default {{project}}/{{zone}}/{{name}}
* $ pulumi import gcp:pubsub/liteTopic:LiteTopic default {{zone}}/{{name}}
* $ 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, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:pubsub/liteTopic:LiteTopic';
/**
* 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["deletionPolicy"] = state?.deletionPolicy;
resourceInputs["name"] = state?.name;
resourceInputs["partitionConfig"] = state?.partitionConfig;
resourceInputs["project"] = state?.project;
resourceInputs["region"] = state?.region;
resourceInputs["reservationConfig"] = state?.reservationConfig;
resourceInputs["retentionConfig"] = state?.retentionConfig;
resourceInputs["zone"] = state?.zone;
}
else {
const args = argsOrState;
resourceInputs["deletionPolicy"] = args?.deletionPolicy;
resourceInputs["name"] = args?.name;
resourceInputs["partitionConfig"] = args?.partitionConfig;
resourceInputs["project"] = args?.project;
resourceInputs["region"] = args?.region;
resourceInputs["reservationConfig"] = args?.reservationConfig;
resourceInputs["retentionConfig"] = args?.retentionConfig;
resourceInputs["zone"] = args?.zone;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(LiteTopic.__pulumiType, name, resourceInputs, opts);
}
}
exports.LiteTopic = LiteTopic;
//# sourceMappingURL=liteTopic.js.map