@ediri/vultr
Version:
A Pulumi package for creating and managing Vultr cloud resources.
98 lines • 4.49 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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.DatabaseTopic = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a Vultr database topic resource. This can be used to create, read, modify, and delete topics for a managed database on your Vultr account.
*
* ## Example Usage
*
* Create a new database topic:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vultr from "@ediri/vultr";
*
* const myDatabaseTopic = new vultr.DatabaseTopic("myDatabaseTopic", {
* databaseId: vultr_database.my_database.id,
* name: "my_database_topic",
* partitions: 3,
* replication: 2,
* retentionHours: 120,
* retentionBytes: -1,
* });
* ```
*/
class DatabaseTopic extends pulumi.CustomResource {
/**
* Get an existing DatabaseTopic 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 DatabaseTopic(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of DatabaseTopic. 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'] === DatabaseTopic.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["databaseId"] = state ? state.databaseId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["partitions"] = state ? state.partitions : undefined;
resourceInputs["replication"] = state ? state.replication : undefined;
resourceInputs["retentionBytes"] = state ? state.retentionBytes : undefined;
resourceInputs["retentionHours"] = state ? state.retentionHours : undefined;
}
else {
const args = argsOrState;
if ((!args || args.databaseId === undefined) && !opts.urn) {
throw new Error("Missing required property 'databaseId'");
}
if ((!args || args.name === undefined) && !opts.urn) {
throw new Error("Missing required property 'name'");
}
if ((!args || args.partitions === undefined) && !opts.urn) {
throw new Error("Missing required property 'partitions'");
}
if ((!args || args.replication === undefined) && !opts.urn) {
throw new Error("Missing required property 'replication'");
}
if ((!args || args.retentionBytes === undefined) && !opts.urn) {
throw new Error("Missing required property 'retentionBytes'");
}
if ((!args || args.retentionHours === undefined) && !opts.urn) {
throw new Error("Missing required property 'retentionHours'");
}
resourceInputs["databaseId"] = args ? args.databaseId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["partitions"] = args ? args.partitions : undefined;
resourceInputs["replication"] = args ? args.replication : undefined;
resourceInputs["retentionBytes"] = args ? args.retentionBytes : undefined;
resourceInputs["retentionHours"] = args ? args.retentionHours : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DatabaseTopic.__pulumiType, name, resourceInputs, opts);
}
}
exports.DatabaseTopic = DatabaseTopic;
/** @internal */
DatabaseTopic.__pulumiType = 'vultr:index/databaseTopic:DatabaseTopic';
//# sourceMappingURL=databaseTopic.js.map