@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
194 lines • 7.49 kB
JavaScript
;
// *** 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.Rule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage tls rule
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@volcengine/pulumi";
*
* const foo = new volcengine.tls.Rule("foo", {
* topicId: "7bfa2cdc-4f8b-4cf9-b4c9-0ed05c33349f",
* ruleName: "test",
* logType: "minimalist_log",
* logSample: "2018-05-22 15:35:53.850 INFO XXXX",
* inputType: 1,
* userDefineRule: {
* enableRawLog: false,
* tailFiles: true,
* 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,
* },
* }),
* JSON.stringify({
* json: {
* field: "__content__",
* trim_keys: {
* mode: "all",
* chars: "#xx",
* },
* trim_values: {
* mode: "all",
* chars: "#txxxt",
* },
* 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************
* ```
*/
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, id, state, opts) {
return new Rule(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* 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) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Rule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["containerRule"] = state ? state.containerRule : undefined;
resourceInputs["excludePaths"] = state ? state.excludePaths : undefined;
resourceInputs["extractRule"] = state ? state.extractRule : undefined;
resourceInputs["inputType"] = state ? state.inputType : undefined;
resourceInputs["logSample"] = state ? state.logSample : undefined;
resourceInputs["logType"] = state ? state.logType : undefined;
resourceInputs["paths"] = state ? state.paths : undefined;
resourceInputs["ruleId"] = state ? state.ruleId : undefined;
resourceInputs["ruleName"] = state ? state.ruleName : undefined;
resourceInputs["topicId"] = state ? state.topicId : undefined;
resourceInputs["userDefineRule"] = state ? state.userDefineRule : undefined;
}
else {
const args = argsOrState;
if ((!args || args.ruleName === undefined) && !opts.urn) {
throw new Error("Missing required property 'ruleName'");
}
if ((!args || args.topicId === undefined) && !opts.urn) {
throw new Error("Missing required property 'topicId'");
}
resourceInputs["containerRule"] = args ? args.containerRule : undefined;
resourceInputs["excludePaths"] = args ? args.excludePaths : undefined;
resourceInputs["extractRule"] = args ? args.extractRule : undefined;
resourceInputs["inputType"] = args ? args.inputType : undefined;
resourceInputs["logSample"] = args ? args.logSample : undefined;
resourceInputs["logType"] = args ? args.logType : undefined;
resourceInputs["paths"] = args ? args.paths : undefined;
resourceInputs["ruleName"] = args ? args.ruleName : undefined;
resourceInputs["topicId"] = args ? args.topicId : undefined;
resourceInputs["userDefineRule"] = args ? args.userDefineRule : undefined;
resourceInputs["ruleId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Rule.__pulumiType, name, resourceInputs, opts);
}
}
exports.Rule = Rule;
/** @internal */
Rule.__pulumiType = 'volcengine:tls/rule:Rule';
//# sourceMappingURL=rule.js.map