volcengine.waf.CustomBot
Explore with Pulumi AI
Provides a resource to manage waf custom bot
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@volcengine/pulumi";
const foo = new volcengine.waf.CustomBot("foo", {
accurate: {
accurateRules: [
{
httpObj: "request.uri",
objType: 1,
opretar: 2,
property: 0,
valueString: "tf",
},
{
httpObj: "request.schema",
objType: 0,
opretar: 2,
property: 0,
valueString: "tf-2",
},
],
logic: 2,
},
action: "observe",
botType: "tf-test",
description: "tf-test",
enable: 1,
host: "www.tf-test.com",
projectName: "default",
});
import pulumi
import pulumi_volcengine as volcengine
foo = volcengine.waf.CustomBot("foo",
accurate=volcengine.waf.CustomBotAccurateArgs(
accurate_rules=[
volcengine.waf.CustomBotAccurateAccurateRuleArgs(
http_obj="request.uri",
obj_type=1,
opretar=2,
property=0,
value_string="tf",
),
volcengine.waf.CustomBotAccurateAccurateRuleArgs(
http_obj="request.schema",
obj_type=0,
opretar=2,
property=0,
value_string="tf-2",
),
],
logic=2,
),
action="observe",
bot_type="tf-test",
description="tf-test",
enable=1,
host="www.tf-test.com",
project_name="default")
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/waf"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := waf.NewCustomBot(ctx, "foo", &waf.CustomBotArgs{
Accurate: &waf.CustomBotAccurateArgs{
AccurateRules: waf.CustomBotAccurateAccurateRuleArray{
&waf.CustomBotAccurateAccurateRuleArgs{
HttpObj: pulumi.String("request.uri"),
ObjType: pulumi.Int(1),
Opretar: pulumi.Int(2),
Property: pulumi.Int(0),
ValueString: pulumi.String("tf"),
},
&waf.CustomBotAccurateAccurateRuleArgs{
HttpObj: pulumi.String("request.schema"),
ObjType: pulumi.Int(0),
Opretar: pulumi.Int(2),
Property: pulumi.Int(0),
ValueString: pulumi.String("tf-2"),
},
},
Logic: pulumi.Int(2),
},
Action: pulumi.String("observe"),
BotType: pulumi.String("tf-test"),
Description: pulumi.String("tf-test"),
Enable: pulumi.Int(1),
Host: pulumi.String("www.tf-test.com"),
ProjectName: pulumi.String("default"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;
return await Deployment.RunAsync(() =>
{
var foo = new Volcengine.Waf.CustomBot("foo", new()
{
Accurate = new Volcengine.Waf.Inputs.CustomBotAccurateArgs
{
AccurateRules = new[]
{
new Volcengine.Waf.Inputs.CustomBotAccurateAccurateRuleArgs
{
HttpObj = "request.uri",
ObjType = 1,
Opretar = 2,
Property = 0,
ValueString = "tf",
},
new Volcengine.Waf.Inputs.CustomBotAccurateAccurateRuleArgs
{
HttpObj = "request.schema",
ObjType = 0,
Opretar = 2,
Property = 0,
ValueString = "tf-2",
},
},
Logic = 2,
},
Action = "observe",
BotType = "tf-test",
Description = "tf-test",
Enable = 1,
Host = "www.tf-test.com",
ProjectName = "default",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.waf.CustomBot;
import com.pulumi.volcengine.waf.CustomBotArgs;
import com.pulumi.volcengine.waf.inputs.CustomBotAccurateArgs;
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 foo = new CustomBot("foo", CustomBotArgs.builder()
.accurate(CustomBotAccurateArgs.builder()
.accurateRules(
CustomBotAccurateAccurateRuleArgs.builder()
.httpObj("request.uri")
.objType(1)
.opretar(2)
.property(0)
.valueString("tf")
.build(),
CustomBotAccurateAccurateRuleArgs.builder()
.httpObj("request.schema")
.objType(0)
.opretar(2)
.property(0)
.valueString("tf-2")
.build())
.logic(2)
.build())
.action("observe")
.botType("tf-test")
.description("tf-test")
.enable(1)
.host("www.tf-test.com")
.projectName("default")
.build());
}
}
resources:
foo:
type: volcengine:waf:CustomBot
properties:
accurate:
accurateRules:
- httpObj: request.uri
objType: 1
opretar: 2
property: 0
valueString: tf
- httpObj: request.schema
objType: 0
opretar: 2
property: 0
valueString: tf-2
logic: 2
action: observe
botType: tf-test
description: tf-test
enable: 1
host: www.tf-test.com
projectName: default
Create CustomBot Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CustomBot(name: string, args: CustomBotArgs, opts?: CustomResourceOptions);
@overload
def CustomBot(resource_name: str,
args: CustomBotArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CustomBot(resource_name: str,
opts: Optional[ResourceOptions] = None,
accurate: Optional[CustomBotAccurateArgs] = None,
action: Optional[str] = None,
bot_type: Optional[str] = None,
enable: Optional[int] = None,
host: Optional[str] = None,
description: Optional[str] = None,
project_name: Optional[str] = None)
func NewCustomBot(ctx *Context, name string, args CustomBotArgs, opts ...ResourceOption) (*CustomBot, error)
public CustomBot(string name, CustomBotArgs args, CustomResourceOptions? opts = null)
public CustomBot(String name, CustomBotArgs args)
public CustomBot(String name, CustomBotArgs args, CustomResourceOptions options)
type: volcengine:waf:CustomBot
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args CustomBotArgs
- 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 CustomBotArgs
- 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 CustomBotArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CustomBotArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CustomBotArgs
- 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 customBotResource = new Volcengine.Waf.CustomBot("customBotResource", new()
{
Accurate = new Volcengine.Waf.Inputs.CustomBotAccurateArgs
{
AccurateRules = new[]
{
new Volcengine.Waf.Inputs.CustomBotAccurateAccurateRuleArgs
{
HttpObj = "string",
ObjType = 0,
Opretar = 0,
Property = 0,
ValueString = "string",
},
},
Logic = 0,
},
Action = "string",
BotType = "string",
Enable = 0,
Host = "string",
Description = "string",
ProjectName = "string",
});
example, err := waf.NewCustomBot(ctx, "customBotResource", &waf.CustomBotArgs{
Accurate: &waf.CustomBotAccurateArgs{
AccurateRules: waf.CustomBotAccurateAccurateRuleArray{
&waf.CustomBotAccurateAccurateRuleArgs{
HttpObj: pulumi.String("string"),
ObjType: pulumi.Int(0),
Opretar: pulumi.Int(0),
Property: pulumi.Int(0),
ValueString: pulumi.String("string"),
},
},
Logic: pulumi.Int(0),
},
Action: pulumi.String("string"),
BotType: pulumi.String("string"),
Enable: pulumi.Int(0),
Host: pulumi.String("string"),
Description: pulumi.String("string"),
ProjectName: pulumi.String("string"),
})
var customBotResource = new CustomBot("customBotResource", CustomBotArgs.builder()
.accurate(CustomBotAccurateArgs.builder()
.accurateRules(CustomBotAccurateAccurateRuleArgs.builder()
.httpObj("string")
.objType(0)
.opretar(0)
.property(0)
.valueString("string")
.build())
.logic(0)
.build())
.action("string")
.botType("string")
.enable(0)
.host("string")
.description("string")
.projectName("string")
.build());
custom_bot_resource = volcengine.waf.CustomBot("customBotResource",
accurate={
"accurate_rules": [{
"http_obj": "string",
"obj_type": 0,
"opretar": 0,
"property": 0,
"value_string": "string",
}],
"logic": 0,
},
action="string",
bot_type="string",
enable=0,
host="string",
description="string",
project_name="string")
const customBotResource = new volcengine.waf.CustomBot("customBotResource", {
accurate: {
accurateRules: [{
httpObj: "string",
objType: 0,
opretar: 0,
property: 0,
valueString: "string",
}],
logic: 0,
},
action: "string",
botType: "string",
enable: 0,
host: "string",
description: "string",
projectName: "string",
});
type: volcengine:waf:CustomBot
properties:
accurate:
accurateRules:
- httpObj: string
objType: 0
opretar: 0
property: 0
valueString: string
logic: 0
action: string
botType: string
description: string
enable: 0
host: string
projectName: string
CustomBot 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 CustomBot resource accepts the following input properties:
- Accurate
Custom
Bot Accurate - Advanced conditions.
- Action string
- The execution action of the Bot.
- Bot
Type string - bot name.
- Enable int
- Whether to enable bot.
- Host string
- Domain name information.
- Description string
- The description of bot.
- Project
Name string - The Name of the affiliated project resource.
- Accurate
Custom
Bot Accurate Args - Advanced conditions.
- Action string
- The execution action of the Bot.
- Bot
Type string - bot name.
- Enable int
- Whether to enable bot.
- Host string
- Domain name information.
- Description string
- The description of bot.
- Project
Name string - The Name of the affiliated project resource.
- accurate
Custom
Bot Accurate - Advanced conditions.
- action String
- The execution action of the Bot.
- bot
Type String - bot name.
- enable Integer
- Whether to enable bot.
- host String
- Domain name information.
- description String
- The description of bot.
- project
Name String - The Name of the affiliated project resource.
- accurate
Custom
Bot Accurate - Advanced conditions.
- action string
- The execution action of the Bot.
- bot
Type string - bot name.
- enable number
- Whether to enable bot.
- host string
- Domain name information.
- description string
- The description of bot.
- project
Name string - The Name of the affiliated project resource.
- accurate
Custom
Bot Accurate Args - Advanced conditions.
- action str
- The execution action of the Bot.
- bot_
type str - bot name.
- enable int
- Whether to enable bot.
- host str
- Domain name information.
- description str
- The description of bot.
- project_
name str - The Name of the affiliated project resource.
- accurate Property Map
- Advanced conditions.
- action String
- The execution action of the Bot.
- bot
Type String - bot name.
- enable Number
- Whether to enable bot.
- host String
- Domain name information.
- description String
- The description of bot.
- project
Name String - The Name of the affiliated project resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the CustomBot resource produces the following output properties:
- Advanced int
- Whether to set advanced conditions.
- Id string
- The provider-assigned unique ID for this managed resource.
- Rule
Tag string - Rule unique identifier.
- Update
Time string - The update time.
- Advanced int
- Whether to set advanced conditions.
- Id string
- The provider-assigned unique ID for this managed resource.
- Rule
Tag string - Rule unique identifier.
- Update
Time string - The update time.
- advanced Integer
- Whether to set advanced conditions.
- id String
- The provider-assigned unique ID for this managed resource.
- rule
Tag String - Rule unique identifier.
- update
Time String - The update time.
- advanced number
- Whether to set advanced conditions.
- id string
- The provider-assigned unique ID for this managed resource.
- rule
Tag string - Rule unique identifier.
- update
Time string - The update time.
- advanced int
- Whether to set advanced conditions.
- id str
- The provider-assigned unique ID for this managed resource.
- rule_
tag str - Rule unique identifier.
- update_
time str - The update time.
- advanced Number
- Whether to set advanced conditions.
- id String
- The provider-assigned unique ID for this managed resource.
- rule
Tag String - Rule unique identifier.
- update
Time String - The update time.
Look up Existing CustomBot Resource
Get an existing CustomBot 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?: CustomBotState, opts?: CustomResourceOptions): CustomBot
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
accurate: Optional[CustomBotAccurateArgs] = None,
action: Optional[str] = None,
advanced: Optional[int] = None,
bot_type: Optional[str] = None,
description: Optional[str] = None,
enable: Optional[int] = None,
host: Optional[str] = None,
project_name: Optional[str] = None,
rule_tag: Optional[str] = None,
update_time: Optional[str] = None) -> CustomBot
func GetCustomBot(ctx *Context, name string, id IDInput, state *CustomBotState, opts ...ResourceOption) (*CustomBot, error)
public static CustomBot Get(string name, Input<string> id, CustomBotState? state, CustomResourceOptions? opts = null)
public static CustomBot get(String name, Output<String> id, CustomBotState state, CustomResourceOptions options)
resources: _: type: volcengine:waf:CustomBot get: 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.
- Accurate
Custom
Bot Accurate - Advanced conditions.
- Action string
- The execution action of the Bot.
- Advanced int
- Whether to set advanced conditions.
- Bot
Type string - bot name.
- Description string
- The description of bot.
- Enable int
- Whether to enable bot.
- Host string
- Domain name information.
- Project
Name string - The Name of the affiliated project resource.
- Rule
Tag string - Rule unique identifier.
- Update
Time string - The update time.
- Accurate
Custom
Bot Accurate Args - Advanced conditions.
- Action string
- The execution action of the Bot.
- Advanced int
- Whether to set advanced conditions.
- Bot
Type string - bot name.
- Description string
- The description of bot.
- Enable int
- Whether to enable bot.
- Host string
- Domain name information.
- Project
Name string - The Name of the affiliated project resource.
- Rule
Tag string - Rule unique identifier.
- Update
Time string - The update time.
- accurate
Custom
Bot Accurate - Advanced conditions.
- action String
- The execution action of the Bot.
- advanced Integer
- Whether to set advanced conditions.
- bot
Type String - bot name.
- description String
- The description of bot.
- enable Integer
- Whether to enable bot.
- host String
- Domain name information.
- project
Name String - The Name of the affiliated project resource.
- rule
Tag String - Rule unique identifier.
- update
Time String - The update time.
- accurate
Custom
Bot Accurate - Advanced conditions.
- action string
- The execution action of the Bot.
- advanced number
- Whether to set advanced conditions.
- bot
Type string - bot name.
- description string
- The description of bot.
- enable number
- Whether to enable bot.
- host string
- Domain name information.
- project
Name string - The Name of the affiliated project resource.
- rule
Tag string - Rule unique identifier.
- update
Time string - The update time.
- accurate
Custom
Bot Accurate Args - Advanced conditions.
- action str
- The execution action of the Bot.
- advanced int
- Whether to set advanced conditions.
- bot_
type str - bot name.
- description str
- The description of bot.
- enable int
- Whether to enable bot.
- host str
- Domain name information.
- project_
name str - The Name of the affiliated project resource.
- rule_
tag str - Rule unique identifier.
- update_
time str - The update time.
- accurate Property Map
- Advanced conditions.
- action String
- The execution action of the Bot.
- advanced Number
- Whether to set advanced conditions.
- bot
Type String - bot name.
- description String
- The description of bot.
- enable Number
- Whether to enable bot.
- host String
- Domain name information.
- project
Name String - The Name of the affiliated project resource.
- rule
Tag String - Rule unique identifier.
- update
Time String - The update time.
Supporting Types
CustomBotAccurate, CustomBotAccurateArgs
- Accurate
Rules List<CustomBot Accurate Accurate Rule> - Details of advanced conditions.
- Logic int
- The logical relationship of advanced conditions.
- Accurate
Rules []CustomBot Accurate Accurate Rule - Details of advanced conditions.
- Logic int
- The logical relationship of advanced conditions.
- accurate
Rules List<CustomBot Accurate Accurate Rule> - Details of advanced conditions.
- logic Integer
- The logical relationship of advanced conditions.
- accurate
Rules CustomBot Accurate Accurate Rule[] - Details of advanced conditions.
- logic number
- The logical relationship of advanced conditions.
- accurate_
rules Sequence[CustomBot Accurate Accurate Rule] - Details of advanced conditions.
- logic int
- The logical relationship of advanced conditions.
- accurate
Rules List<Property Map> - Details of advanced conditions.
- logic Number
- The logical relationship of advanced conditions.
CustomBotAccurateAccurateRule, CustomBotAccurateAccurateRuleArgs
- Http
Obj string - The HTTP object to be added to the advanced conditions.
- Obj
Type int - The matching field for HTTP objects.
- Opretar int
- The logical operator for the condition.
- Property int
- Operate the properties of the http object.
- Value
String string - The value to be matched.
- Http
Obj string - The HTTP object to be added to the advanced conditions.
- Obj
Type int - The matching field for HTTP objects.
- Opretar int
- The logical operator for the condition.
- Property int
- Operate the properties of the http object.
- Value
String string - The value to be matched.
- http
Obj String - The HTTP object to be added to the advanced conditions.
- obj
Type Integer - The matching field for HTTP objects.
- opretar Integer
- The logical operator for the condition.
- property Integer
- Operate the properties of the http object.
- value
String String - The value to be matched.
- http
Obj string - The HTTP object to be added to the advanced conditions.
- obj
Type number - The matching field for HTTP objects.
- opretar number
- The logical operator for the condition.
- property number
- Operate the properties of the http object.
- value
String string - The value to be matched.
- http_
obj str - The HTTP object to be added to the advanced conditions.
- obj_
type int - The matching field for HTTP objects.
- opretar int
- The logical operator for the condition.
- property int
- Operate the properties of the http object.
- value_
string str - The value to be matched.
- http
Obj String - The HTTP object to be added to the advanced conditions.
- obj
Type Number - The matching field for HTTP objects.
- opretar Number
- The logical operator for the condition.
- property Number
- Operate the properties of the http object.
- value
String String - The value to be matched.
Import
WafCustomBot can be imported using the id, e.g.
$ pulumi import volcengine:waf/customBot:CustomBot default resource_id
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- volcengine volcengine/pulumi-volcengine
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
volcengine
Terraform Provider.