UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

135 lines 6.25 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.ServiceDiscoveryRule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an AOM service discovery rule resource within HuaweiCloud. * * ## Example Usage * ### Basic example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * * const discoveryRule = new huaweicloud.Aom.ServiceDiscoveryRule("discovery_rule", { * detectLogEnabled: true, * discoveryRuleEnabled: true, * discoveryRules: [{ * checkContents: ["java"], * checkMode: "contain", * checkType: "cmdLine", * }], * isDefaultRule: false, * logFileSuffixes: ["log"], * logPathRules: [{ * args: ["java"], * nameType: "cmdLineHash", * values: ["/tmp/log"], * }], * nameRules: { * applicationNameRules: [{ * args: ["java"], * nameType: "str", * }], * serviceNameRules: [{ * args: ["java"], * nameType: "str", * }], * }, * priority: 9999, * serviceType: "Java", * }); * ``` * * ## Import * * AOM service discovery rules can be imported using the `name`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Aom/serviceDiscoveryRule:ServiceDiscoveryRule alarm_rule <name> * ``` */ class ServiceDiscoveryRule extends pulumi.CustomResource { /** * Get an existing ServiceDiscoveryRule 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 ServiceDiscoveryRule(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ServiceDiscoveryRule. 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'] === ServiceDiscoveryRule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["detectLogEnabled"] = state ? state.detectLogEnabled : undefined; resourceInputs["discoveryRuleEnabled"] = state ? state.discoveryRuleEnabled : undefined; resourceInputs["discoveryRules"] = state ? state.discoveryRules : undefined; resourceInputs["isDefaultRule"] = state ? state.isDefaultRule : undefined; resourceInputs["logFileSuffixes"] = state ? state.logFileSuffixes : undefined; resourceInputs["logPathRules"] = state ? state.logPathRules : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["nameRules"] = state ? state.nameRules : undefined; resourceInputs["priority"] = state ? state.priority : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["ruleId"] = state ? state.ruleId : undefined; resourceInputs["serviceType"] = state ? state.serviceType : undefined; } else { const args = argsOrState; if ((!args || args.discoveryRules === undefined) && !opts.urn) { throw new Error("Missing required property 'discoveryRules'"); } if ((!args || args.logFileSuffixes === undefined) && !opts.urn) { throw new Error("Missing required property 'logFileSuffixes'"); } if ((!args || args.nameRules === undefined) && !opts.urn) { throw new Error("Missing required property 'nameRules'"); } if ((!args || args.serviceType === undefined) && !opts.urn) { throw new Error("Missing required property 'serviceType'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["detectLogEnabled"] = args ? args.detectLogEnabled : undefined; resourceInputs["discoveryRuleEnabled"] = args ? args.discoveryRuleEnabled : undefined; resourceInputs["discoveryRules"] = args ? args.discoveryRules : undefined; resourceInputs["isDefaultRule"] = args ? args.isDefaultRule : undefined; resourceInputs["logFileSuffixes"] = args ? args.logFileSuffixes : undefined; resourceInputs["logPathRules"] = args ? args.logPathRules : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["nameRules"] = args ? args.nameRules : undefined; resourceInputs["priority"] = args ? args.priority : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["serviceType"] = args ? args.serviceType : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["ruleId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ServiceDiscoveryRule.__pulumiType, name, resourceInputs, opts); } } exports.ServiceDiscoveryRule = ServiceDiscoveryRule; /** @internal */ ServiceDiscoveryRule.__pulumiType = 'huaweicloud:Aom/serviceDiscoveryRule:ServiceDiscoveryRule'; //# sourceMappingURL=serviceDiscoveryRule.js.map