published on Monday, Jun 15, 2026 by Byteplus
published on Monday, Jun 15, 2026 by Byteplus
Rule file.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as bytepluscc from "@pulumi/bytepluscc";
const vMPRuleFileDemo = new bytepluscc.index.VmpRulefile("VMPRuleFileDemo", {
description: "这是一个测试规则文件",
targetWorkspaceId: "3ba7844b-e7fc-4688-a869-****",
content: `groups:
- name: example
rules:
- record: example_metric
expr: sum(up)`,
workspaceId: "3ba7844b-e7fc-4688-a869-****",
name: "test-rule-file",
});
import pulumi
import pulumi_bytepluscc as bytepluscc
v_mp_rule_file_demo = bytepluscc.index.VmpRulefile("VMPRuleFileDemo",
description=这是一个测试规则文件,
target_workspace_id=3ba7844b-e7fc-4688-a869-****,
content=groups:
- name: example
rules:
- record: example_metric
expr: sum(up),
workspace_id=3ba7844b-e7fc-4688-a869-****,
name=test-rule-file)
package main
import (
"github.com/byteplus-sdk/pulumi-bytepluscc/sdk/go/bytepluscc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := bytepluscc.NewVmpRulefile(ctx, "VMPRuleFileDemo", &bytepluscc.VmpRulefileArgs{
Description: "这是一个测试规则文件",
TargetWorkspaceId: "3ba7844b-e7fc-4688-a869-****",
Content: "groups:\n- name: example\n rules:\n - record: example_metric\n expr: sum(up)",
WorkspaceId: "3ba7844b-e7fc-4688-a869-****",
Name: "test-rule-file",
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Bytepluscc = Pulumi.Bytepluscc;
return await Deployment.RunAsync(() =>
{
var vMPRuleFileDemo = new Bytepluscc.Index.VmpRulefile("VMPRuleFileDemo", new()
{
Description = "这是一个测试规则文件",
TargetWorkspaceId = "3ba7844b-e7fc-4688-a869-****",
Content = @"groups:
- name: example
rules:
- record: example_metric
expr: sum(up)",
WorkspaceId = "3ba7844b-e7fc-4688-a869-****",
Name = "test-rule-file",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.bytepluscc.vmpRulefile;
import com.pulumi.bytepluscc.vmpRulefileArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var vMPRuleFileDemo = new VmpRulefile("vMPRuleFileDemo", VmpRulefileArgs.builder()
.description("这是一个测试规则文件")
.targetWorkspaceId("3ba7844b-e7fc-4688-a869-****")
.content("""
groups:
- name: example
rules:
- record: example_metric
expr: sum(up) """)
.workspaceId("3ba7844b-e7fc-4688-a869-****")
.name("test-rule-file")
.build());
}
}
resources:
vMPRuleFileDemo:
type: bytepluscc:vmpRulefile
name: VMPRuleFileDemo
properties:
description: 这是一个测试规则文件
targetWorkspaceId: 3ba7844b-e7fc-4688-a869-****
content: |-
groups:
- name: example
rules:
- record: example_metric
expr: sum(up)
workspaceId: 3ba7844b-e7fc-4688-a869-****
name: test-rule-file
Example coming soon!
Create RuleFile Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RuleFile(name: string, args: RuleFileArgs, opts?: CustomResourceOptions);@overload
def RuleFile(resource_name: str,
args: RuleFileArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RuleFile(resource_name: str,
opts: Optional[ResourceOptions] = None,
content: Optional[str] = None,
name: Optional[str] = None,
workspace_id: Optional[str] = None,
description: Optional[str] = None,
target_workspace_id: Optional[str] = None)func NewRuleFile(ctx *Context, name string, args RuleFileArgs, opts ...ResourceOption) (*RuleFile, error)public RuleFile(string name, RuleFileArgs args, CustomResourceOptions? opts = null)
public RuleFile(String name, RuleFileArgs args)
public RuleFile(String name, RuleFileArgs args, CustomResourceOptions options)
type: bytepluscc:vmp:RuleFile
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "bytepluscc_vmp_rulefile" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args RuleFileArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args RuleFileArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RuleFileArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RuleFileArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RuleFileArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var ruleFileResource = new Bytepluscc.Vmp.RuleFile("ruleFileResource", new()
{
Content = "string",
Name = "string",
WorkspaceId = "string",
Description = "string",
TargetWorkspaceId = "string",
});
example, err := vmp.NewRuleFile(ctx, "ruleFileResource", &vmp.RuleFileArgs{
Content: pulumi.String("string"),
Name: pulumi.String("string"),
WorkspaceId: pulumi.String("string"),
Description: pulumi.String("string"),
TargetWorkspaceId: pulumi.String("string"),
})
resource "bytepluscc_vmp_rulefile" "ruleFileResource" {
content = "string"
name = "string"
workspace_id = "string"
description = "string"
target_workspace_id = "string"
}
var ruleFileResource = new RuleFile("ruleFileResource", RuleFileArgs.builder()
.content("string")
.name("string")
.workspaceId("string")
.description("string")
.targetWorkspaceId("string")
.build());
rule_file_resource = bytepluscc.vmp.RuleFile("ruleFileResource",
content="string",
name="string",
workspace_id="string",
description="string",
target_workspace_id="string")
const ruleFileResource = new bytepluscc.vmp.RuleFile("ruleFileResource", {
content: "string",
name: "string",
workspaceId: "string",
description: "string",
targetWorkspaceId: "string",
});
type: bytepluscc:vmp:RuleFile
properties:
content: string
description: string
name: string
targetWorkspaceId: string
workspaceId: string
RuleFile Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The RuleFile resource accepts the following input properties:
- Content string
- Rule file content in YAML format. Content length limits: - Each
exprmust not exceed 16 KB. - Eachrecordmust not exceed 2,048 bytes. - Eachlabelnamemust not exceed 256 bytes. - Eachlabelvaluemust not exceed 2,048 bytes. - Name string
- Rule file name: - Must be a valid Linux file name and less than 255 characters. - Must be unique within the workspace.
- Workspace
Id string - Workspace ID.
- Description string
- Rule file description, limited to 0–200 characters. Note: Note Each English letter, Chinese character, or symbol counts as one character.
- Target
Workspace stringId - Target workspace ID to write to. If empty, writes to the source workspace.
- Content string
- Rule file content in YAML format. Content length limits: - Each
exprmust not exceed 16 KB. - Eachrecordmust not exceed 2,048 bytes. - Eachlabelnamemust not exceed 256 bytes. - Eachlabelvaluemust not exceed 2,048 bytes. - Name string
- Rule file name: - Must be a valid Linux file name and less than 255 characters. - Must be unique within the workspace.
- Workspace
Id string - Workspace ID.
- Description string
- Rule file description, limited to 0–200 characters. Note: Note Each English letter, Chinese character, or symbol counts as one character.
- Target
Workspace stringId - Target workspace ID to write to. If empty, writes to the source workspace.
- content string
- Rule file content in YAML format. Content length limits: - Each
exprmust not exceed 16 KB. - Eachrecordmust not exceed 2,048 bytes. - Eachlabelnamemust not exceed 256 bytes. - Eachlabelvaluemust not exceed 2,048 bytes. - name string
- Rule file name: - Must be a valid Linux file name and less than 255 characters. - Must be unique within the workspace.
- workspace_
id string - Workspace ID.
- description string
- Rule file description, limited to 0–200 characters. Note: Note Each English letter, Chinese character, or symbol counts as one character.
- target_
workspace_ stringid - Target workspace ID to write to. If empty, writes to the source workspace.
- content String
- Rule file content in YAML format. Content length limits: - Each
exprmust not exceed 16 KB. - Eachrecordmust not exceed 2,048 bytes. - Eachlabelnamemust not exceed 256 bytes. - Eachlabelvaluemust not exceed 2,048 bytes. - name String
- Rule file name: - Must be a valid Linux file name and less than 255 characters. - Must be unique within the workspace.
- workspace
Id String - Workspace ID.
- description String
- Rule file description, limited to 0–200 characters. Note: Note Each English letter, Chinese character, or symbol counts as one character.
- target
Workspace StringId - Target workspace ID to write to. If empty, writes to the source workspace.
- content string
- Rule file content in YAML format. Content length limits: - Each
exprmust not exceed 16 KB. - Eachrecordmust not exceed 2,048 bytes. - Eachlabelnamemust not exceed 256 bytes. - Eachlabelvaluemust not exceed 2,048 bytes. - name string
- Rule file name: - Must be a valid Linux file name and less than 255 characters. - Must be unique within the workspace.
- workspace
Id string - Workspace ID.
- description string
- Rule file description, limited to 0–200 characters. Note: Note Each English letter, Chinese character, or symbol counts as one character.
- target
Workspace stringId - Target workspace ID to write to. If empty, writes to the source workspace.
- content str
- Rule file content in YAML format. Content length limits: - Each
exprmust not exceed 16 KB. - Eachrecordmust not exceed 2,048 bytes. - Eachlabelnamemust not exceed 256 bytes. - Eachlabelvaluemust not exceed 2,048 bytes. - name str
- Rule file name: - Must be a valid Linux file name and less than 255 characters. - Must be unique within the workspace.
- workspace_
id str - Workspace ID.
- description str
- Rule file description, limited to 0–200 characters. Note: Note Each English letter, Chinese character, or symbol counts as one character.
- target_
workspace_ strid - Target workspace ID to write to. If empty, writes to the source workspace.
- content String
- Rule file content in YAML format. Content length limits: - Each
exprmust not exceed 16 KB. - Eachrecordmust not exceed 2,048 bytes. - Eachlabelnamemust not exceed 256 bytes. - Eachlabelvaluemust not exceed 2,048 bytes. - name String
- Rule file name: - Must be a valid Linux file name and less than 255 characters. - Must be unique within the workspace.
- workspace
Id String - Workspace ID.
- description String
- Rule file description, limited to 0–200 characters. Note: Note Each English letter, Chinese character, or symbol counts as one character.
- target
Workspace StringId - Target workspace ID to write to. If empty, writes to the source workspace.
Outputs
All input properties are implicitly available as output properties. Additionally, the RuleFile resource produces the following output properties:
- Create
Time string - Rule file creation time in RFC3339 format.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Update stringTime - Last updated time of the rule file in RFC3339 format.
- Rule
Count int - Number of rules in the rule file.
- Rule
File stringId - Rule file ID.
- Status string
- Rule file status: - Creating: Creating - Running: Running - Updating: Updating - OverdueSuspended: Suspended due to overdue payment - Resuming: Resuming
- Create
Time string - Rule file creation time in RFC3339 format.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Update stringTime - Last updated time of the rule file in RFC3339 format.
- Rule
Count int - Number of rules in the rule file.
- Rule
File stringId - Rule file ID.
- Status string
- Rule file status: - Creating: Creating - Running: Running - Updating: Updating - OverdueSuspended: Suspended due to overdue payment - Resuming: Resuming
- create_
time string - Rule file creation time in RFC3339 format.
- id string
- The provider-assigned unique ID for this managed resource.
- last_
update_ stringtime - Last updated time of the rule file in RFC3339 format.
- rule_
count number - Number of rules in the rule file.
- rule_
file_ stringid - Rule file ID.
- status string
- Rule file status: - Creating: Creating - Running: Running - Updating: Updating - OverdueSuspended: Suspended due to overdue payment - Resuming: Resuming
- create
Time String - Rule file creation time in RFC3339 format.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Update StringTime - Last updated time of the rule file in RFC3339 format.
- rule
Count Integer - Number of rules in the rule file.
- rule
File StringId - Rule file ID.
- status String
- Rule file status: - Creating: Creating - Running: Running - Updating: Updating - OverdueSuspended: Suspended due to overdue payment - Resuming: Resuming
- create
Time string - Rule file creation time in RFC3339 format.
- id string
- The provider-assigned unique ID for this managed resource.
- last
Update stringTime - Last updated time of the rule file in RFC3339 format.
- rule
Count number - Number of rules in the rule file.
- rule
File stringId - Rule file ID.
- status string
- Rule file status: - Creating: Creating - Running: Running - Updating: Updating - OverdueSuspended: Suspended due to overdue payment - Resuming: Resuming
- create_
time str - Rule file creation time in RFC3339 format.
- id str
- The provider-assigned unique ID for this managed resource.
- last_
update_ strtime - Last updated time of the rule file in RFC3339 format.
- rule_
count int - Number of rules in the rule file.
- rule_
file_ strid - Rule file ID.
- status str
- Rule file status: - Creating: Creating - Running: Running - Updating: Updating - OverdueSuspended: Suspended due to overdue payment - Resuming: Resuming
- create
Time String - Rule file creation time in RFC3339 format.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Update StringTime - Last updated time of the rule file in RFC3339 format.
- rule
Count Number - Number of rules in the rule file.
- rule
File StringId - Rule file ID.
- status String
- Rule file status: - Creating: Creating - Running: Running - Updating: Updating - OverdueSuspended: Suspended due to overdue payment - Resuming: Resuming
Look up Existing RuleFile Resource
Get an existing RuleFile resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: RuleFileState, opts?: CustomResourceOptions): RuleFile@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
content: Optional[str] = None,
create_time: Optional[str] = None,
description: Optional[str] = None,
last_update_time: Optional[str] = None,
name: Optional[str] = None,
rule_count: Optional[int] = None,
rule_file_id: Optional[str] = None,
status: Optional[str] = None,
target_workspace_id: Optional[str] = None,
workspace_id: Optional[str] = None) -> RuleFilefunc GetRuleFile(ctx *Context, name string, id IDInput, state *RuleFileState, opts ...ResourceOption) (*RuleFile, error)public static RuleFile Get(string name, Input<string> id, RuleFileState? state, CustomResourceOptions? opts = null)public static RuleFile get(String name, Output<String> id, RuleFileState state, CustomResourceOptions options)resources: _: type: bytepluscc:vmp:RuleFile get: id: ${id}import {
to = bytepluscc_vmp_rulefile.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Content string
- Rule file content in YAML format. Content length limits: - Each
exprmust not exceed 16 KB. - Eachrecordmust not exceed 2,048 bytes. - Eachlabelnamemust not exceed 256 bytes. - Eachlabelvaluemust not exceed 2,048 bytes. - Create
Time string - Rule file creation time in RFC3339 format.
- Description string
- Rule file description, limited to 0–200 characters. Note: Note Each English letter, Chinese character, or symbol counts as one character.
- Last
Update stringTime - Last updated time of the rule file in RFC3339 format.
- Name string
- Rule file name: - Must be a valid Linux file name and less than 255 characters. - Must be unique within the workspace.
- Rule
Count int - Number of rules in the rule file.
- Rule
File stringId - Rule file ID.
- Status string
- Rule file status: - Creating: Creating - Running: Running - Updating: Updating - OverdueSuspended: Suspended due to overdue payment - Resuming: Resuming
- Target
Workspace stringId - Target workspace ID to write to. If empty, writes to the source workspace.
- Workspace
Id string - Workspace ID.
- Content string
- Rule file content in YAML format. Content length limits: - Each
exprmust not exceed 16 KB. - Eachrecordmust not exceed 2,048 bytes. - Eachlabelnamemust not exceed 256 bytes. - Eachlabelvaluemust not exceed 2,048 bytes. - Create
Time string - Rule file creation time in RFC3339 format.
- Description string
- Rule file description, limited to 0–200 characters. Note: Note Each English letter, Chinese character, or symbol counts as one character.
- Last
Update stringTime - Last updated time of the rule file in RFC3339 format.
- Name string
- Rule file name: - Must be a valid Linux file name and less than 255 characters. - Must be unique within the workspace.
- Rule
Count int - Number of rules in the rule file.
- Rule
File stringId - Rule file ID.
- Status string
- Rule file status: - Creating: Creating - Running: Running - Updating: Updating - OverdueSuspended: Suspended due to overdue payment - Resuming: Resuming
- Target
Workspace stringId - Target workspace ID to write to. If empty, writes to the source workspace.
- Workspace
Id string - Workspace ID.
- content string
- Rule file content in YAML format. Content length limits: - Each
exprmust not exceed 16 KB. - Eachrecordmust not exceed 2,048 bytes. - Eachlabelnamemust not exceed 256 bytes. - Eachlabelvaluemust not exceed 2,048 bytes. - create_
time string - Rule file creation time in RFC3339 format.
- description string
- Rule file description, limited to 0–200 characters. Note: Note Each English letter, Chinese character, or symbol counts as one character.
- last_
update_ stringtime - Last updated time of the rule file in RFC3339 format.
- name string
- Rule file name: - Must be a valid Linux file name and less than 255 characters. - Must be unique within the workspace.
- rule_
count number - Number of rules in the rule file.
- rule_
file_ stringid - Rule file ID.
- status string
- Rule file status: - Creating: Creating - Running: Running - Updating: Updating - OverdueSuspended: Suspended due to overdue payment - Resuming: Resuming
- target_
workspace_ stringid - Target workspace ID to write to. If empty, writes to the source workspace.
- workspace_
id string - Workspace ID.
- content String
- Rule file content in YAML format. Content length limits: - Each
exprmust not exceed 16 KB. - Eachrecordmust not exceed 2,048 bytes. - Eachlabelnamemust not exceed 256 bytes. - Eachlabelvaluemust not exceed 2,048 bytes. - create
Time String - Rule file creation time in RFC3339 format.
- description String
- Rule file description, limited to 0–200 characters. Note: Note Each English letter, Chinese character, or symbol counts as one character.
- last
Update StringTime - Last updated time of the rule file in RFC3339 format.
- name String
- Rule file name: - Must be a valid Linux file name and less than 255 characters. - Must be unique within the workspace.
- rule
Count Integer - Number of rules in the rule file.
- rule
File StringId - Rule file ID.
- status String
- Rule file status: - Creating: Creating - Running: Running - Updating: Updating - OverdueSuspended: Suspended due to overdue payment - Resuming: Resuming
- target
Workspace StringId - Target workspace ID to write to. If empty, writes to the source workspace.
- workspace
Id String - Workspace ID.
- content string
- Rule file content in YAML format. Content length limits: - Each
exprmust not exceed 16 KB. - Eachrecordmust not exceed 2,048 bytes. - Eachlabelnamemust not exceed 256 bytes. - Eachlabelvaluemust not exceed 2,048 bytes. - create
Time string - Rule file creation time in RFC3339 format.
- description string
- Rule file description, limited to 0–200 characters. Note: Note Each English letter, Chinese character, or symbol counts as one character.
- last
Update stringTime - Last updated time of the rule file in RFC3339 format.
- name string
- Rule file name: - Must be a valid Linux file name and less than 255 characters. - Must be unique within the workspace.
- rule
Count number - Number of rules in the rule file.
- rule
File stringId - Rule file ID.
- status string
- Rule file status: - Creating: Creating - Running: Running - Updating: Updating - OverdueSuspended: Suspended due to overdue payment - Resuming: Resuming
- target
Workspace stringId - Target workspace ID to write to. If empty, writes to the source workspace.
- workspace
Id string - Workspace ID.
- content str
- Rule file content in YAML format. Content length limits: - Each
exprmust not exceed 16 KB. - Eachrecordmust not exceed 2,048 bytes. - Eachlabelnamemust not exceed 256 bytes. - Eachlabelvaluemust not exceed 2,048 bytes. - create_
time str - Rule file creation time in RFC3339 format.
- description str
- Rule file description, limited to 0–200 characters. Note: Note Each English letter, Chinese character, or symbol counts as one character.
- last_
update_ strtime - Last updated time of the rule file in RFC3339 format.
- name str
- Rule file name: - Must be a valid Linux file name and less than 255 characters. - Must be unique within the workspace.
- rule_
count int - Number of rules in the rule file.
- rule_
file_ strid - Rule file ID.
- status str
- Rule file status: - Creating: Creating - Running: Running - Updating: Updating - OverdueSuspended: Suspended due to overdue payment - Resuming: Resuming
- target_
workspace_ strid - Target workspace ID to write to. If empty, writes to the source workspace.
- workspace_
id str - Workspace ID.
- content String
- Rule file content in YAML format. Content length limits: - Each
exprmust not exceed 16 KB. - Eachrecordmust not exceed 2,048 bytes. - Eachlabelnamemust not exceed 256 bytes. - Eachlabelvaluemust not exceed 2,048 bytes. - create
Time String - Rule file creation time in RFC3339 format.
- description String
- Rule file description, limited to 0–200 characters. Note: Note Each English letter, Chinese character, or symbol counts as one character.
- last
Update StringTime - Last updated time of the rule file in RFC3339 format.
- name String
- Rule file name: - Must be a valid Linux file name and less than 255 characters. - Must be unique within the workspace.
- rule
Count Number - Number of rules in the rule file.
- rule
File StringId - Rule file ID.
- status String
- Rule file status: - Creating: Creating - Running: Running - Updating: Updating - OverdueSuspended: Suspended due to overdue payment - Resuming: Resuming
- target
Workspace StringId - Target workspace ID to write to. If empty, writes to the source workspace.
- workspace
Id String - Workspace ID.
Import
$ pulumi import bytepluscc:vmp/ruleFile:RuleFile example "workspace_id|rule_file_id"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- bytepluscc byteplus-sdk/pulumi-bytepluscc
- License
- MPL-2.0
- Notes
- This Pulumi package is based on the
byteplusccTerraform Provider.
published on Monday, Jun 15, 2026 by Byteplus