UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

123 lines 5.71 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.Topic = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage tls topic * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as volcengine from "@volcengine/pulumi"; * * const foo = new volcengine.tls.Topic("foo", { * autoSplit: true, * description: "test", * enableTracking: true, * maxSplitShard: 10, * projectId: "e020c978-4f05-40e1-9167-0113d3ef****", * shardCount: 2, * tags: [{ * key: "k1", * value: "v1", * }], * timeFormat: "%Y-%m-%dT%H:%M:%S,%f", * timeKey: "request_time", * topicName: "tf-test-topic", * ttl: 10, * }); * ``` * * ## Import * * Tls Topic can be imported using the id, e.g. * * ```sh * $ pulumi import volcengine:tls/topic:Topic default edf051ed-3c46-49ba-9339-bea628fe**** * ``` */ class Topic extends pulumi.CustomResource { /** * Get an existing Topic 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 Topic(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Topic. 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'] === Topic.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["autoSplit"] = state ? state.autoSplit : undefined; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["enableTracking"] = state ? state.enableTracking : undefined; resourceInputs["manualSplitShardId"] = state ? state.manualSplitShardId : undefined; resourceInputs["manualSplitShardNumber"] = state ? state.manualSplitShardNumber : undefined; resourceInputs["maxSplitShard"] = state ? state.maxSplitShard : undefined; resourceInputs["modifyTime"] = state ? state.modifyTime : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["shardCount"] = state ? state.shardCount : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["timeFormat"] = state ? state.timeFormat : undefined; resourceInputs["timeKey"] = state ? state.timeKey : undefined; resourceInputs["topicName"] = state ? state.topicName : undefined; resourceInputs["ttl"] = state ? state.ttl : undefined; } else { const args = argsOrState; if ((!args || args.projectId === undefined) && !opts.urn) { throw new Error("Missing required property 'projectId'"); } if ((!args || args.shardCount === undefined) && !opts.urn) { throw new Error("Missing required property 'shardCount'"); } if ((!args || args.topicName === undefined) && !opts.urn) { throw new Error("Missing required property 'topicName'"); } if ((!args || args.ttl === undefined) && !opts.urn) { throw new Error("Missing required property 'ttl'"); } resourceInputs["autoSplit"] = args ? args.autoSplit : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["enableTracking"] = args ? args.enableTracking : undefined; resourceInputs["manualSplitShardId"] = args ? args.manualSplitShardId : undefined; resourceInputs["manualSplitShardNumber"] = args ? args.manualSplitShardNumber : undefined; resourceInputs["maxSplitShard"] = args ? args.maxSplitShard : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["shardCount"] = args ? args.shardCount : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["timeFormat"] = args ? args.timeFormat : undefined; resourceInputs["timeKey"] = args ? args.timeKey : undefined; resourceInputs["topicName"] = args ? args.topicName : undefined; resourceInputs["ttl"] = args ? args.ttl : undefined; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["modifyTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Topic.__pulumiType, name, resourceInputs, opts); } } exports.Topic = Topic; /** @internal */ Topic.__pulumiType = 'volcengine:tls/topic:Topic'; //# sourceMappingURL=topic.js.map