UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

106 lines 5.13 kB
"use strict"; // *** 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.KafkaTopic = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a DMS kafka topic resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const kafkaInstanceId = config.requireObject("kafkaInstanceId"); * const topic = new huaweicloud.dms.KafkaTopic("topic", { * instanceId: kafkaInstanceId, * partitions: 20, * }); * ``` * * ## Import * * DMS kafka topics can be imported using the kafka instance ID and topic name separated by a slash, e.g. * * ```sh * $ pulumi import huaweicloud:Dms/kafkaTopic:KafkaTopic topic c8057fe5-23a8-46ef-ad83-c0055b4e0c5c/topic_1 * ``` */ class KafkaTopic extends pulumi.CustomResource { /** * Get an existing KafkaTopic 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 KafkaTopic(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of KafkaTopic. 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'] === KafkaTopic.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["agingTime"] = state ? state.agingTime : undefined; resourceInputs["configs"] = state ? state.configs : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["instanceId"] = state ? state.instanceId : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["newPartitionBrokers"] = state ? state.newPartitionBrokers : undefined; resourceInputs["partitions"] = state ? state.partitions : undefined; resourceInputs["policiesOnly"] = state ? state.policiesOnly : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["replicas"] = state ? state.replicas : undefined; resourceInputs["syncFlushing"] = state ? state.syncFlushing : undefined; resourceInputs["syncReplication"] = state ? state.syncReplication : undefined; resourceInputs["type"] = state ? state.type : undefined; } else { const args = argsOrState; if ((!args || args.instanceId === undefined) && !opts.urn) { throw new Error("Missing required property 'instanceId'"); } if ((!args || args.partitions === undefined) && !opts.urn) { throw new Error("Missing required property 'partitions'"); } resourceInputs["agingTime"] = args ? args.agingTime : undefined; resourceInputs["configs"] = args ? args.configs : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["instanceId"] = args ? args.instanceId : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["newPartitionBrokers"] = args ? args.newPartitionBrokers : undefined; resourceInputs["partitions"] = args ? args.partitions : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["replicas"] = args ? args.replicas : undefined; resourceInputs["syncFlushing"] = args ? args.syncFlushing : undefined; resourceInputs["syncReplication"] = args ? args.syncReplication : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["policiesOnly"] = undefined /*out*/; resourceInputs["type"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(KafkaTopic.__pulumiType, name, resourceInputs, opts); } } exports.KafkaTopic = KafkaTopic; /** @internal */ KafkaTopic.__pulumiType = 'huaweicloud:Dms/kafkaTopic:KafkaTopic'; //# sourceMappingURL=kafkaTopic.js.map