UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

109 lines 5.01 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"); /** * Manages an SMN topic resource within HuaweiCloud. * * ## Example Usage * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * * const topic1 = new huaweicloud.Smn.Topic("topic_1", { * displayName: "The display name of topic_1", * }); * ``` * ### Topic with policies * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * * const topic1 = new huaweicloud.Smn.Topic("topic_1", { * displayName: "The display name of topic_1", * introduction: "created by terraform", * servicesPublishAllowed: "obs,vod,cce", * usersPublishAllowed: "urn:csp:iam::0970d7b7d400f2470fbec00316a03560:root,urn:csp:iam::0970d7b7d400f2470fbec00316a03561:root", * }); * ``` * * ## Import * * SMN topic can be imported using the `id` (topic urn), e.g. bash * * ```sh * $ pulumi import huaweicloud:Smn/topic:Topic topic_1 urn:smn:cn-north-4:0970dd7a1300f5672ff2c003c60ae115:topic_1 * ``` */ 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["accessPolicy"] = state ? state.accessPolicy : undefined; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined; resourceInputs["introduction"] = state ? state.introduction : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["pushPolicy"] = state ? state.pushPolicy : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["servicesPublishAllowed"] = state ? state.servicesPublishAllowed : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["topicUrn"] = state ? state.topicUrn : undefined; resourceInputs["updateTime"] = state ? state.updateTime : undefined; resourceInputs["usersPublishAllowed"] = state ? state.usersPublishAllowed : undefined; } else { const args = argsOrState; resourceInputs["accessPolicy"] = args ? args.accessPolicy : undefined; resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined; resourceInputs["introduction"] = args ? args.introduction : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["servicesPublishAllowed"] = args ? args.servicesPublishAllowed : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["usersPublishAllowed"] = args ? args.usersPublishAllowed : undefined; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["pushPolicy"] = undefined /*out*/; resourceInputs["topicUrn"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Topic.__pulumiType, name, resourceInputs, opts); } } exports.Topic = Topic; /** @internal */ Topic.__pulumiType = 'huaweicloud:Smn/topic:Topic'; //# sourceMappingURL=topic.js.map