UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

139 lines 6.05 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.DataforwardingRule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an IoTDA data forwarding rule within HuaweiCloud. * * > When accessing an IoTDA **standard** or **enterprise** edition instance, you need to specify the IoTDA service * endpoint in `provider` block. * You can login to the IoTDA console, choose the instance **Overview** and click **Access Details** * to view the HTTPS application access address. An example of the access address might be * **9bc34xxxxx.st1.iotda-app.ap-southeast-1.myhuaweicloud.com**, then you need to configure the * `provider` block as follows: * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const disRegion = config.requireObject("disRegion"); * const disStreamId = config.requireObject("disStreamId"); * const obsRegion = config.requireObject("obsRegion"); * const obsbucket = config.requireObject("obsbucket"); * const test = new huaweicloud.iotda.DataforwardingRule("test", { * trigger: "product:create", * enabled: true, * targets: [ * { * type: "DIS_FORWARDING", * disForwarding: { * region: disRegion, * streamId: disStreamId, * }, * }, * { * type: "HTTP_FORWARDING", * httpForwarding: { * url: "http://www.yourDomain.com", * }, * }, * { * type: "OBS_FORWARDING", * obsForwarding: { * region: obsRegion, * bucket: obsbucket, * }, * }, * ], * }); * ``` * * ## Import * * Data forwarding rules can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:IoTDA/dataforwardingRule:DataforwardingRule test 10022532f4f94f26b01daa1e424853e1 * ``` * * Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response, security or some other reason. The missing attributes include`password` of `kafka_forwarding`. It is generally recommended running `terraform plan` after importing the resource. You can then decide if changes should be applied to the resource, or the resource definition should be updated to align with the group. Also you can ignore changes as below. hcl resource "huaweicloud_iotda_device_group" "test" { * * ... * * lifecycle { * * ignore_changes = [ * * targets, * * ] * * } } */ class DataforwardingRule extends pulumi.CustomResource { /** * Get an existing DataforwardingRule 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 DataforwardingRule(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of DataforwardingRule. 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'] === DataforwardingRule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["enabled"] = state ? state.enabled : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["select"] = state ? state.select : undefined; resourceInputs["spaceId"] = state ? state.spaceId : undefined; resourceInputs["targets"] = state ? state.targets : undefined; resourceInputs["trigger"] = state ? state.trigger : undefined; resourceInputs["where"] = state ? state.where : undefined; } else { const args = argsOrState; if ((!args || args.trigger === undefined) && !opts.urn) { throw new Error("Missing required property 'trigger'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["enabled"] = args ? args.enabled : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["select"] = args ? args.select : undefined; resourceInputs["spaceId"] = args ? args.spaceId : undefined; resourceInputs["targets"] = args ? args.targets : undefined; resourceInputs["trigger"] = args ? args.trigger : undefined; resourceInputs["where"] = args ? args.where : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(DataforwardingRule.__pulumiType, name, resourceInputs, opts); } } exports.DataforwardingRule = DataforwardingRule; /** @internal */ DataforwardingRule.__pulumiType = 'huaweicloud:IoTDA/dataforwardingRule:DataforwardingRule'; //# sourceMappingURL=dataforwardingRule.js.map