UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

329 lines (328 loc) 10.4 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Provides a resource to manage tls rule * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as volcengine from "@volcengine/pulumi"; * * const fooProject = new volcengine.tls.Project("fooProject", { * projectName: "tf-test-project-ttt", * description: "tf-test-project-desc", * region: "cn-guilin-boe", * }); * const fooTopic = new volcengine.tls.Topic("fooTopic", { * projectId: fooProject.id, * topicName: "tf-test-topic-rule-1", * ttl: 60, * shardCount: 2, * autoSplit: true, * maxSplitShard: 10, * enableTracking: true, * timeKey: "request_time", * timeFormat: "%Y-%m-%dT%H:%M:%S,%f", * tags: [{ * key: "k1", * value: "v1", * }], * logPublicIp: true, * enableHotTtl: true, * hotTtl: 30, * coldTtl: 30, * archiveTtl: 0, * }); * const fooRule = new volcengine.tls.Rule("fooRule", { * topicId: fooTopic.id, * ruleName: "tf-test-rule-modify", * logType: "delimiter_log", * logSample: "2018-05-22 15:35:53.850,INFO,XXXX", * inputType: 1, * extractRule: { * delimiter: ",", * keys: [ * "time", * "level", * "msg", * ], * timeKey: "time", * timeFormat: "%Y-%m-%d %H:%M:%S.%f", * quote: "\"", * timeZone: "GMT+08:00", * beginRegex: "", * logRegex: "", * filterKeyRegexes: [{ * key: "__content__", * regex: ".*ERROR.*", * }], * unMatchUpLoadSwitch: true, * unMatchLogKey: "LogParseFailed", * logTemplate: { * type: "", * format: "", * }, * }, * userDefineRule: { * enableRawLog: true, * tailFiles: true, * fields: { * cluster_id: "dabaad5f-7a10-4771-b3ea-d821f73e****", * }, * parsePathRule: { * pathSample: "/data/nginx/log/dabaad5f-7a10/tls/app.log", * regex: "\\/data\\/nginx\\/log\\/(\\w+)-(\\w+)\\/tls\\/app\\.log", * keys: [ * "instance-id", * "pod-name", * ], * }, * shardHashKey: { * hashKey: "3C", * }, * plugin: { * processors: [JSON.stringify({ * json: { * field: "__content__", * trim_keys: { * mode: "all", * chars: "#", * }, * trim_values: { * mode: "all", * chars: "#t", * }, * allow_overwrite_keys: true, * allow_empty_values: true, * }, * })], * }, * advanced: { * closeInactive: 10, * closeRemoved: false, * closeRenamed: false, * closeEof: false, * closeTimeout: 1, * }, * }, * containerRule: { * stream: "all", * containerNameRegex: ".*test.*", * includeContainerLabelRegex: { * Key1: "Value12", * Key2: "Value23", * }, * excludeContainerLabelRegex: { * Key1: "Value12", * Key2: "Value22", * }, * includeContainerEnvRegex: { * Key1: "Value1", * Key2: "Value2", * }, * excludeContainerEnvRegex: { * Key1: "Value1", * Key2: "Value2", * }, * envTag: { * Key1: "Value1", * Key2: "Value2", * }, * kubernetesRule: { * namespaceNameRegex: ".*test.*", * workloadType: "Deployment", * workloadNameRegex: ".*test.*", * includePodLabelRegex: { * Key1: "Value1", * Key2: "Value2", * }, * excludePodLabelRegex: { * Key1: "Value1", * Key2: "Value2", * }, * podNameRegex: ".*test.*", * labelTag: { * Key1: "Value1", * Key2: "Value2", * }, * annotationTag: { * Key1: "Value1", * Key2: "Value2", * }, * }, * }, * }); * ``` * * ## Import * * tls rule can be imported using the id, e.g. * * ```sh * $ pulumi import volcengine:tls/rule:Rule default fa************ * ``` */ export declare class Rule extends pulumi.CustomResource { /** * Get an existing Rule 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?: RuleState, opts?: pulumi.CustomResourceOptions): Rule; /** * Returns true if the given object is an instance of Rule. 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 Rule; /** * Container collection rules. */ readonly containerRule: pulumi.Output<outputs.tls.RuleContainerRule | undefined>; /** * Collect the blacklist list. */ readonly excludePaths: pulumi.Output<outputs.tls.RuleExcludePath[] | undefined>; /** * The extract rule. */ readonly extractRule: pulumi.Output<outputs.tls.RuleExtractRule>; /** * The type of the collection configuration. Validate value can be `0`(host log file), `1`(K8s container standard output) and `2`(Log files in the K8s container). */ readonly inputType: pulumi.Output<number | undefined>; /** * The sample of the log. */ readonly logSample: pulumi.Output<string | undefined>; /** * The log type. The value can be one of the following: `minimalistLog`, `jsonLog`, `delimiterLog`, `multilineLog`, `fullregexLog`. */ readonly logType: pulumi.Output<string | undefined>; /** * Collection path list. */ readonly paths: pulumi.Output<string[] | undefined>; /** * The id of the rule. */ readonly ruleId: pulumi.Output<string>; /** * The name of the collection configuration. */ readonly ruleName: pulumi.Output<string>; /** * The ID of the log topic to which the collection configuration belongs. */ readonly topicId: pulumi.Output<string>; /** * User-defined collection rules. */ readonly userDefineRule: pulumi.Output<outputs.tls.RuleUserDefineRule | undefined>; /** * Create a Rule 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: RuleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Rule resources. */ export interface RuleState { /** * Container collection rules. */ containerRule?: pulumi.Input<inputs.tls.RuleContainerRule>; /** * Collect the blacklist list. */ excludePaths?: pulumi.Input<pulumi.Input<inputs.tls.RuleExcludePath>[]>; /** * The extract rule. */ extractRule?: pulumi.Input<inputs.tls.RuleExtractRule>; /** * The type of the collection configuration. Validate value can be `0`(host log file), `1`(K8s container standard output) and `2`(Log files in the K8s container). */ inputType?: pulumi.Input<number>; /** * The sample of the log. */ logSample?: pulumi.Input<string>; /** * The log type. The value can be one of the following: `minimalistLog`, `jsonLog`, `delimiterLog`, `multilineLog`, `fullregexLog`. */ logType?: pulumi.Input<string>; /** * Collection path list. */ paths?: pulumi.Input<pulumi.Input<string>[]>; /** * The id of the rule. */ ruleId?: pulumi.Input<string>; /** * The name of the collection configuration. */ ruleName?: pulumi.Input<string>; /** * The ID of the log topic to which the collection configuration belongs. */ topicId?: pulumi.Input<string>; /** * User-defined collection rules. */ userDefineRule?: pulumi.Input<inputs.tls.RuleUserDefineRule>; } /** * The set of arguments for constructing a Rule resource. */ export interface RuleArgs { /** * Container collection rules. */ containerRule?: pulumi.Input<inputs.tls.RuleContainerRule>; /** * Collect the blacklist list. */ excludePaths?: pulumi.Input<pulumi.Input<inputs.tls.RuleExcludePath>[]>; /** * The extract rule. */ extractRule?: pulumi.Input<inputs.tls.RuleExtractRule>; /** * The type of the collection configuration. Validate value can be `0`(host log file), `1`(K8s container standard output) and `2`(Log files in the K8s container). */ inputType?: pulumi.Input<number>; /** * The sample of the log. */ logSample?: pulumi.Input<string>; /** * The log type. The value can be one of the following: `minimalistLog`, `jsonLog`, `delimiterLog`, `multilineLog`, `fullregexLog`. */ logType?: pulumi.Input<string>; /** * Collection path list. */ paths?: pulumi.Input<pulumi.Input<string>[]>; /** * The name of the collection configuration. */ ruleName: pulumi.Input<string>; /** * The ID of the log topic to which the collection configuration belongs. */ topicId: pulumi.Input<string>; /** * User-defined collection rules. */ userDefineRule?: pulumi.Input<inputs.tls.RuleUserDefineRule>; }