UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

291 lines (290 loc) 13.7 kB
import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "../types"; /** * 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> * ``` */ export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: ServiceDiscoveryRuleState, opts?: pulumi.CustomResourceOptions): ServiceDiscoveryRule; /** * 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: any): obj is ServiceDiscoveryRule; /** * The rule create time. */ readonly createdAt: pulumi.Output<string>; /** * Specifies the rule description. */ readonly description: pulumi.Output<string | undefined>; /** * Specifies whether to enable log collection. The default value is true. */ readonly detectLogEnabled: pulumi.Output<boolean | undefined>; /** * Specifies whether the rule is enabled. The default value is true. */ readonly discoveryRuleEnabled: pulumi.Output<boolean | undefined>; /** * Specifies the discovery rule. If the array contains multiple conditions, only the * processes that meet all the conditions will be matched. If the value of `checkType` is **cmdLine**, set the value of * `checkMode` to **contain**. `checkContent` is in the format of ["xxx"], indicating that the process must contain * the xxx parameter. If the value of `checkType` is **env**, set the value of `checkMode` to **contain**. * `checkContent` is in the format of ["k1","v1"], indicating that the process must contain the environment variable * whose name is k1 and value is v1. If the value of `checkType` is **scope**, set the value of `checkMode` * to **equals**. `checkContent` is in the format of ["hostId1","hostId2"], indicating that the rule takes effect only * on specified nodes. If no nodes are specified, the rule applies to all nodes of the project. */ readonly discoveryRules: pulumi.Output<outputs.Aom.ServiceDiscoveryRuleDiscoveryRule[]>; /** * Specifies whether the rule is the default one. The default value is false. */ readonly isDefaultRule: pulumi.Output<boolean | undefined>; /** * Specifies the log file suffix. This is a list of strings. * The values can be: **log**, **trace**, and **out**. */ readonly logFileSuffixes: pulumi.Output<string[]>; /** * Specifies the log path configuration rule. If cmdLineHash is a fixed string, * logs in the specified log path or log file are collected. Otherwise, only the files whose names end with * .log or .trace are collected. If the value of `nameType` is **cmdLineHash**, args is in the format of ["00001"] and * value is in the format of ["/xxx/xx.log"], indicating that the log path is /xxx/xx.log when the startup command is 00001. */ readonly logPathRules: pulumi.Output<outputs.Aom.ServiceDiscoveryRuleLogPathRule[] | undefined>; /** * Specifies the rule name, which contains `4` to `63` characters. It must start * with a lowercase letter but cannot end with a hyphen (-). Only digits, lowercase letters, and hyphens are allowed. */ readonly name: pulumi.Output<string>; /** * Specifies the naming rules for discovered services and applications. * The object structure is documented below. */ readonly nameRules: pulumi.Output<outputs.Aom.ServiceDiscoveryRuleNameRules>; /** * Specifies the rule priority. Value range: 1 to 9999. The default value is 9999. */ readonly priority: pulumi.Output<number | undefined>; /** * The region in which to create the service discovery rule resource. If omitted, * the provider-level region will be used. Changing this creates a new resource. */ readonly region: pulumi.Output<string>; /** * The rule ID in uuid format. */ readonly ruleId: pulumi.Output<string>; /** * Specifies the service type, which is used only for rule classification and UI display. * You can enter any field. For example, enter Java or Python by technology stack, or enter collector or database by function. */ readonly serviceType: pulumi.Output<string>; /** * Create a ServiceDiscoveryRule resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: ServiceDiscoveryRuleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ServiceDiscoveryRule resources. */ export interface ServiceDiscoveryRuleState { /** * The rule create time. */ createdAt?: pulumi.Input<string>; /** * Specifies the rule description. */ description?: pulumi.Input<string>; /** * Specifies whether to enable log collection. The default value is true. */ detectLogEnabled?: pulumi.Input<boolean>; /** * Specifies whether the rule is enabled. The default value is true. */ discoveryRuleEnabled?: pulumi.Input<boolean>; /** * Specifies the discovery rule. If the array contains multiple conditions, only the * processes that meet all the conditions will be matched. If the value of `checkType` is **cmdLine**, set the value of * `checkMode` to **contain**. `checkContent` is in the format of ["xxx"], indicating that the process must contain * the xxx parameter. If the value of `checkType` is **env**, set the value of `checkMode` to **contain**. * `checkContent` is in the format of ["k1","v1"], indicating that the process must contain the environment variable * whose name is k1 and value is v1. If the value of `checkType` is **scope**, set the value of `checkMode` * to **equals**. `checkContent` is in the format of ["hostId1","hostId2"], indicating that the rule takes effect only * on specified nodes. If no nodes are specified, the rule applies to all nodes of the project. */ discoveryRules?: pulumi.Input<pulumi.Input<inputs.Aom.ServiceDiscoveryRuleDiscoveryRule>[]>; /** * Specifies whether the rule is the default one. The default value is false. */ isDefaultRule?: pulumi.Input<boolean>; /** * Specifies the log file suffix. This is a list of strings. * The values can be: **log**, **trace**, and **out**. */ logFileSuffixes?: pulumi.Input<pulumi.Input<string>[]>; /** * Specifies the log path configuration rule. If cmdLineHash is a fixed string, * logs in the specified log path or log file are collected. Otherwise, only the files whose names end with * .log or .trace are collected. If the value of `nameType` is **cmdLineHash**, args is in the format of ["00001"] and * value is in the format of ["/xxx/xx.log"], indicating that the log path is /xxx/xx.log when the startup command is 00001. */ logPathRules?: pulumi.Input<pulumi.Input<inputs.Aom.ServiceDiscoveryRuleLogPathRule>[]>; /** * Specifies the rule name, which contains `4` to `63` characters. It must start * with a lowercase letter but cannot end with a hyphen (-). Only digits, lowercase letters, and hyphens are allowed. */ name?: pulumi.Input<string>; /** * Specifies the naming rules for discovered services and applications. * The object structure is documented below. */ nameRules?: pulumi.Input<inputs.Aom.ServiceDiscoveryRuleNameRules>; /** * Specifies the rule priority. Value range: 1 to 9999. The default value is 9999. */ priority?: pulumi.Input<number>; /** * The region in which to create the service discovery rule resource. If omitted, * the provider-level region will be used. Changing this creates a new resource. */ region?: pulumi.Input<string>; /** * The rule ID in uuid format. */ ruleId?: pulumi.Input<string>; /** * Specifies the service type, which is used only for rule classification and UI display. * You can enter any field. For example, enter Java or Python by technology stack, or enter collector or database by function. */ serviceType?: pulumi.Input<string>; } /** * The set of arguments for constructing a ServiceDiscoveryRule resource. */ export interface ServiceDiscoveryRuleArgs { /** * Specifies the rule description. */ description?: pulumi.Input<string>; /** * Specifies whether to enable log collection. The default value is true. */ detectLogEnabled?: pulumi.Input<boolean>; /** * Specifies whether the rule is enabled. The default value is true. */ discoveryRuleEnabled?: pulumi.Input<boolean>; /** * Specifies the discovery rule. If the array contains multiple conditions, only the * processes that meet all the conditions will be matched. If the value of `checkType` is **cmdLine**, set the value of * `checkMode` to **contain**. `checkContent` is in the format of ["xxx"], indicating that the process must contain * the xxx parameter. If the value of `checkType` is **env**, set the value of `checkMode` to **contain**. * `checkContent` is in the format of ["k1","v1"], indicating that the process must contain the environment variable * whose name is k1 and value is v1. If the value of `checkType` is **scope**, set the value of `checkMode` * to **equals**. `checkContent` is in the format of ["hostId1","hostId2"], indicating that the rule takes effect only * on specified nodes. If no nodes are specified, the rule applies to all nodes of the project. */ discoveryRules: pulumi.Input<pulumi.Input<inputs.Aom.ServiceDiscoveryRuleDiscoveryRule>[]>; /** * Specifies whether the rule is the default one. The default value is false. */ isDefaultRule?: pulumi.Input<boolean>; /** * Specifies the log file suffix. This is a list of strings. * The values can be: **log**, **trace**, and **out**. */ logFileSuffixes: pulumi.Input<pulumi.Input<string>[]>; /** * Specifies the log path configuration rule. If cmdLineHash is a fixed string, * logs in the specified log path or log file are collected. Otherwise, only the files whose names end with * .log or .trace are collected. If the value of `nameType` is **cmdLineHash**, args is in the format of ["00001"] and * value is in the format of ["/xxx/xx.log"], indicating that the log path is /xxx/xx.log when the startup command is 00001. */ logPathRules?: pulumi.Input<pulumi.Input<inputs.Aom.ServiceDiscoveryRuleLogPathRule>[]>; /** * Specifies the rule name, which contains `4` to `63` characters. It must start * with a lowercase letter but cannot end with a hyphen (-). Only digits, lowercase letters, and hyphens are allowed. */ name?: pulumi.Input<string>; /** * Specifies the naming rules for discovered services and applications. * The object structure is documented below. */ nameRules: pulumi.Input<inputs.Aom.ServiceDiscoveryRuleNameRules>; /** * Specifies the rule priority. Value range: 1 to 9999. The default value is 9999. */ priority?: pulumi.Input<number>; /** * The region in which to create the service discovery rule resource. If omitted, * the provider-level region will be used. Changing this creates a new resource. */ region?: pulumi.Input<string>; /** * Specifies the service type, which is used only for rule classification and UI display. * You can enter any field. For example, enter Java or Python by technology stack, or enter collector or database by function. */ serviceType: pulumi.Input<string>; }