alicloud.ddos.SchedulerRule
Explore with Pulumi AI
Provides a DdosCoo Scheduler Rule resource. For information about DdosCoo Scheduler Rule and how to use it, seeWhat is DdosCoo Scheduler Rule.
NOTE: Available since v1.86.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "tf-example";
const example = new alicloud.ddos.SchedulerRule("example", {
ruleName: name,
ruleType: 3,
rules: [
{
priority: 100,
regionId: "cn-hangzhou",
type: "A",
value: "127.0.0.1",
valueType: 3,
},
{
priority: 50,
regionId: "cn-hangzhou",
type: "A",
value: "127.0.0.0",
valueType: 1,
},
],
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-example"
example = alicloud.ddos.SchedulerRule("example",
rule_name=name,
rule_type=3,
rules=[
{
"priority": 100,
"region_id": "cn-hangzhou",
"type": "A",
"value": "127.0.0.1",
"value_type": 3,
},
{
"priority": 50,
"region_id": "cn-hangzhou",
"type": "A",
"value": "127.0.0.0",
"value_type": 1,
},
])
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ddos"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "tf-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := ddos.NewSchedulerRule(ctx, "example", &ddos.SchedulerRuleArgs{
RuleName: pulumi.String(name),
RuleType: pulumi.Int(3),
Rules: ddos.SchedulerRuleRuleArray{
&ddos.SchedulerRuleRuleArgs{
Priority: pulumi.Int(100),
RegionId: pulumi.String("cn-hangzhou"),
Type: pulumi.String("A"),
Value: pulumi.String("127.0.0.1"),
ValueType: pulumi.Int(3),
},
&ddos.SchedulerRuleRuleArgs{
Priority: pulumi.Int(50),
RegionId: pulumi.String("cn-hangzhou"),
Type: pulumi.String("A"),
Value: pulumi.String("127.0.0.0"),
ValueType: pulumi.Int(1),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "tf-example";
var example = new AliCloud.Ddos.SchedulerRule("example", new()
{
RuleName = name,
RuleType = 3,
Rules = new[]
{
new AliCloud.Ddos.Inputs.SchedulerRuleRuleArgs
{
Priority = 100,
RegionId = "cn-hangzhou",
Type = "A",
Value = "127.0.0.1",
ValueType = 3,
},
new AliCloud.Ddos.Inputs.SchedulerRuleRuleArgs
{
Priority = 50,
RegionId = "cn-hangzhou",
Type = "A",
Value = "127.0.0.0",
ValueType = 1,
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ddos.SchedulerRule;
import com.pulumi.alicloud.ddos.SchedulerRuleArgs;
import com.pulumi.alicloud.ddos.inputs.SchedulerRuleRuleArgs;
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) {
final var config = ctx.config();
final var name = config.get("name").orElse("tf-example");
var example = new SchedulerRule("example", SchedulerRuleArgs.builder()
.ruleName(name)
.ruleType(3)
.rules(
SchedulerRuleRuleArgs.builder()
.priority(100)
.regionId("cn-hangzhou")
.type("A")
.value("127.0.0.1")
.valueType(3)
.build(),
SchedulerRuleRuleArgs.builder()
.priority(50)
.regionId("cn-hangzhou")
.type("A")
.value("127.0.0.0")
.valueType(1)
.build())
.build());
}
}
configuration:
name:
type: string
default: tf-example
resources:
example:
type: alicloud:ddos:SchedulerRule
properties:
ruleName: ${name}
ruleType: 3
rules:
- priority: 100
regionId: cn-hangzhou
type: A
value: 127.0.0.1
valueType: 3
- priority: 50
regionId: cn-hangzhou
type: A
value: 127.0.0.0
valueType: 1
Create SchedulerRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SchedulerRule(name: string, args: SchedulerRuleArgs, opts?: CustomResourceOptions);
@overload
def SchedulerRule(resource_name: str,
args: SchedulerRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SchedulerRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
rule_name: Optional[str] = None,
rule_type: Optional[int] = None,
rules: Optional[Sequence[SchedulerRuleRuleArgs]] = None,
param: Optional[str] = None,
resource_group_id: Optional[str] = None)
func NewSchedulerRule(ctx *Context, name string, args SchedulerRuleArgs, opts ...ResourceOption) (*SchedulerRule, error)
public SchedulerRule(string name, SchedulerRuleArgs args, CustomResourceOptions? opts = null)
public SchedulerRule(String name, SchedulerRuleArgs args)
public SchedulerRule(String name, SchedulerRuleArgs args, CustomResourceOptions options)
type: alicloud:ddos:SchedulerRule
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 SchedulerRuleArgs
- 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 SchedulerRuleArgs
- 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 SchedulerRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SchedulerRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SchedulerRuleArgs
- 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 schedulerRuleResource = new AliCloud.Ddos.SchedulerRule("schedulerRuleResource", new()
{
RuleName = "string",
RuleType = 0,
Rules = new[]
{
new AliCloud.Ddos.Inputs.SchedulerRuleRuleArgs
{
Priority = 0,
RegionId = "string",
Status = 0,
Type = "string",
Value = "string",
ValueType = 0,
},
},
Param = "string",
ResourceGroupId = "string",
});
example, err := ddos.NewSchedulerRule(ctx, "schedulerRuleResource", &ddos.SchedulerRuleArgs{
RuleName: pulumi.String("string"),
RuleType: pulumi.Int(0),
Rules: ddos.SchedulerRuleRuleArray{
&ddos.SchedulerRuleRuleArgs{
Priority: pulumi.Int(0),
RegionId: pulumi.String("string"),
Status: pulumi.Int(0),
Type: pulumi.String("string"),
Value: pulumi.String("string"),
ValueType: pulumi.Int(0),
},
},
Param: pulumi.String("string"),
ResourceGroupId: pulumi.String("string"),
})
var schedulerRuleResource = new SchedulerRule("schedulerRuleResource", SchedulerRuleArgs.builder()
.ruleName("string")
.ruleType(0)
.rules(SchedulerRuleRuleArgs.builder()
.priority(0)
.regionId("string")
.status(0)
.type("string")
.value("string")
.valueType(0)
.build())
.param("string")
.resourceGroupId("string")
.build());
scheduler_rule_resource = alicloud.ddos.SchedulerRule("schedulerRuleResource",
rule_name="string",
rule_type=0,
rules=[alicloud.ddos.SchedulerRuleRuleArgs(
priority=0,
region_id="string",
status=0,
type="string",
value="string",
value_type=0,
)],
param="string",
resource_group_id="string")
const schedulerRuleResource = new alicloud.ddos.SchedulerRule("schedulerRuleResource", {
ruleName: "string",
ruleType: 0,
rules: [{
priority: 0,
regionId: "string",
status: 0,
type: "string",
value: "string",
valueType: 0,
}],
param: "string",
resourceGroupId: "string",
});
type: alicloud:ddos:SchedulerRule
properties:
param: string
resourceGroupId: string
ruleName: string
ruleType: 0
rules:
- priority: 0
regionId: string
status: 0
type: string
value: string
valueType: 0
SchedulerRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The SchedulerRule resource accepts the following input properties:
- Rule
Name string - The name of the rule.
- Rule
Type int - The rule type. Valid values:
2
: tiered protection.3
: globalization acceleration.6
: Cloud product interaction. - Rules
List<Pulumi.
Ali Cloud. Ddos. Inputs. Scheduler Rule Rule> - The information about the scheduling rules. See
rules
below. - Param string
- The scheduling rule for the Global Accelerator instance that interacts with Anti-DDoS Pro or Anti-DDoS Premium.
- Resource
Group stringId - The ID of the resource group to which the anti-DDoS pro instance belongs in resource management. By default, no value is specified, indicating that the domains in the default resource group are listed.
- Rule
Name string - The name of the rule.
- Rule
Type int - The rule type. Valid values:
2
: tiered protection.3
: globalization acceleration.6
: Cloud product interaction. - Rules
[]Scheduler
Rule Rule Args - The information about the scheduling rules. See
rules
below. - Param string
- The scheduling rule for the Global Accelerator instance that interacts with Anti-DDoS Pro or Anti-DDoS Premium.
- Resource
Group stringId - The ID of the resource group to which the anti-DDoS pro instance belongs in resource management. By default, no value is specified, indicating that the domains in the default resource group are listed.
- rule
Name String - The name of the rule.
- rule
Type Integer - The rule type. Valid values:
2
: tiered protection.3
: globalization acceleration.6
: Cloud product interaction. - rules
List<Scheduler
Rule Rule> - The information about the scheduling rules. See
rules
below. - param String
- The scheduling rule for the Global Accelerator instance that interacts with Anti-DDoS Pro or Anti-DDoS Premium.
- resource
Group StringId - The ID of the resource group to which the anti-DDoS pro instance belongs in resource management. By default, no value is specified, indicating that the domains in the default resource group are listed.
- rule
Name string - The name of the rule.
- rule
Type number - The rule type. Valid values:
2
: tiered protection.3
: globalization acceleration.6
: Cloud product interaction. - rules
Scheduler
Rule Rule[] - The information about the scheduling rules. See
rules
below. - param string
- The scheduling rule for the Global Accelerator instance that interacts with Anti-DDoS Pro or Anti-DDoS Premium.
- resource
Group stringId - The ID of the resource group to which the anti-DDoS pro instance belongs in resource management. By default, no value is specified, indicating that the domains in the default resource group are listed.
- rule_
name str - The name of the rule.
- rule_
type int - The rule type. Valid values:
2
: tiered protection.3
: globalization acceleration.6
: Cloud product interaction. - rules
Sequence[Scheduler
Rule Rule Args] - The information about the scheduling rules. See
rules
below. - param str
- The scheduling rule for the Global Accelerator instance that interacts with Anti-DDoS Pro or Anti-DDoS Premium.
- resource_
group_ strid - The ID of the resource group to which the anti-DDoS pro instance belongs in resource management. By default, no value is specified, indicating that the domains in the default resource group are listed.
- rule
Name String - The name of the rule.
- rule
Type Number - The rule type. Valid values:
2
: tiered protection.3
: globalization acceleration.6
: Cloud product interaction. - rules List<Property Map>
- The information about the scheduling rules. See
rules
below. - param String
- The scheduling rule for the Global Accelerator instance that interacts with Anti-DDoS Pro or Anti-DDoS Premium.
- resource
Group StringId - The ID of the resource group to which the anti-DDoS pro instance belongs in resource management. By default, no value is specified, indicating that the domains in the default resource group are listed.
Outputs
All input properties are implicitly available as output properties. Additionally, the SchedulerRule resource produces the following output properties:
Look up Existing SchedulerRule Resource
Get an existing SchedulerRule 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?: SchedulerRuleState, opts?: CustomResourceOptions): SchedulerRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cname: Optional[str] = None,
param: Optional[str] = None,
resource_group_id: Optional[str] = None,
rule_name: Optional[str] = None,
rule_type: Optional[int] = None,
rules: Optional[Sequence[SchedulerRuleRuleArgs]] = None) -> SchedulerRule
func GetSchedulerRule(ctx *Context, name string, id IDInput, state *SchedulerRuleState, opts ...ResourceOption) (*SchedulerRule, error)
public static SchedulerRule Get(string name, Input<string> id, SchedulerRuleState? state, CustomResourceOptions? opts = null)
public static SchedulerRule get(String name, Output<String> id, SchedulerRuleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Cname string
- The cname is the traffic scheduler corresponding to rules.
- Param string
- The scheduling rule for the Global Accelerator instance that interacts with Anti-DDoS Pro or Anti-DDoS Premium.
- Resource
Group stringId - The ID of the resource group to which the anti-DDoS pro instance belongs in resource management. By default, no value is specified, indicating that the domains in the default resource group are listed.
- Rule
Name string - The name of the rule.
- Rule
Type int - The rule type. Valid values:
2
: tiered protection.3
: globalization acceleration.6
: Cloud product interaction. - Rules
List<Pulumi.
Ali Cloud. Ddos. Inputs. Scheduler Rule Rule> - The information about the scheduling rules. See
rules
below.
- Cname string
- The cname is the traffic scheduler corresponding to rules.
- Param string
- The scheduling rule for the Global Accelerator instance that interacts with Anti-DDoS Pro or Anti-DDoS Premium.
- Resource
Group stringId - The ID of the resource group to which the anti-DDoS pro instance belongs in resource management. By default, no value is specified, indicating that the domains in the default resource group are listed.
- Rule
Name string - The name of the rule.
- Rule
Type int - The rule type. Valid values:
2
: tiered protection.3
: globalization acceleration.6
: Cloud product interaction. - Rules
[]Scheduler
Rule Rule Args - The information about the scheduling rules. See
rules
below.
- cname String
- The cname is the traffic scheduler corresponding to rules.
- param String
- The scheduling rule for the Global Accelerator instance that interacts with Anti-DDoS Pro or Anti-DDoS Premium.
- resource
Group StringId - The ID of the resource group to which the anti-DDoS pro instance belongs in resource management. By default, no value is specified, indicating that the domains in the default resource group are listed.
- rule
Name String - The name of the rule.
- rule
Type Integer - The rule type. Valid values:
2
: tiered protection.3
: globalization acceleration.6
: Cloud product interaction. - rules
List<Scheduler
Rule Rule> - The information about the scheduling rules. See
rules
below.
- cname string
- The cname is the traffic scheduler corresponding to rules.
- param string
- The scheduling rule for the Global Accelerator instance that interacts with Anti-DDoS Pro or Anti-DDoS Premium.
- resource
Group stringId - The ID of the resource group to which the anti-DDoS pro instance belongs in resource management. By default, no value is specified, indicating that the domains in the default resource group are listed.
- rule
Name string - The name of the rule.
- rule
Type number - The rule type. Valid values:
2
: tiered protection.3
: globalization acceleration.6
: Cloud product interaction. - rules
Scheduler
Rule Rule[] - The information about the scheduling rules. See
rules
below.
- cname str
- The cname is the traffic scheduler corresponding to rules.
- param str
- The scheduling rule for the Global Accelerator instance that interacts with Anti-DDoS Pro or Anti-DDoS Premium.
- resource_
group_ strid - The ID of the resource group to which the anti-DDoS pro instance belongs in resource management. By default, no value is specified, indicating that the domains in the default resource group are listed.
- rule_
name str - The name of the rule.
- rule_
type int - The rule type. Valid values:
2
: tiered protection.3
: globalization acceleration.6
: Cloud product interaction. - rules
Sequence[Scheduler
Rule Rule Args] - The information about the scheduling rules. See
rules
below.
- cname String
- The cname is the traffic scheduler corresponding to rules.
- param String
- The scheduling rule for the Global Accelerator instance that interacts with Anti-DDoS Pro or Anti-DDoS Premium.
- resource
Group StringId - The ID of the resource group to which the anti-DDoS pro instance belongs in resource management. By default, no value is specified, indicating that the domains in the default resource group are listed.
- rule
Name String - The name of the rule.
- rule
Type Number - The rule type. Valid values:
2
: tiered protection.3
: globalization acceleration.6
: Cloud product interaction. - rules List<Property Map>
- The information about the scheduling rules. See
rules
below.
Supporting Types
SchedulerRuleRule, SchedulerRuleRuleArgs
- Priority int
- The priority of the rule.
- Region
Id string - The region where the interaction resource that is used in the scheduling rule is deployed. NOTE: This parameter is returned only if the RuleType parameter is set to 2.
- Status int
- The status of the scheduling rule.
- Type string
- The address type of the interaction resource. Valid values:
A
: IPv4 address.CNAME
: CNAME record. - Value string
- The address of the interaction resource.
- Value
Type int - Required. The type of the linked resource. It is an Integer. Valid values:
1
: The IP address of Anti-DDoS Pro or Anti-DDoS Premium2
: the IP address of the interaction resource (in the tiered protection scenario)3
: the IP address used to accelerate access (in the network acceleration scenario)6
the IP address of the interaction resource (in the cloud service interaction scenario)
- Priority int
- The priority of the rule.
- Region
Id string - The region where the interaction resource that is used in the scheduling rule is deployed. NOTE: This parameter is returned only if the RuleType parameter is set to 2.
- Status int
- The status of the scheduling rule.
- Type string
- The address type of the interaction resource. Valid values:
A
: IPv4 address.CNAME
: CNAME record. - Value string
- The address of the interaction resource.
- Value
Type int - Required. The type of the linked resource. It is an Integer. Valid values:
1
: The IP address of Anti-DDoS Pro or Anti-DDoS Premium2
: the IP address of the interaction resource (in the tiered protection scenario)3
: the IP address used to accelerate access (in the network acceleration scenario)6
the IP address of the interaction resource (in the cloud service interaction scenario)
- priority Integer
- The priority of the rule.
- region
Id String - The region where the interaction resource that is used in the scheduling rule is deployed. NOTE: This parameter is returned only if the RuleType parameter is set to 2.
- status Integer
- The status of the scheduling rule.
- type String
- The address type of the interaction resource. Valid values:
A
: IPv4 address.CNAME
: CNAME record. - value String
- The address of the interaction resource.
- value
Type Integer - Required. The type of the linked resource. It is an Integer. Valid values:
1
: The IP address of Anti-DDoS Pro or Anti-DDoS Premium2
: the IP address of the interaction resource (in the tiered protection scenario)3
: the IP address used to accelerate access (in the network acceleration scenario)6
the IP address of the interaction resource (in the cloud service interaction scenario)
- priority number
- The priority of the rule.
- region
Id string - The region where the interaction resource that is used in the scheduling rule is deployed. NOTE: This parameter is returned only if the RuleType parameter is set to 2.
- status number
- The status of the scheduling rule.
- type string
- The address type of the interaction resource. Valid values:
A
: IPv4 address.CNAME
: CNAME record. - value string
- The address of the interaction resource.
- value
Type number - Required. The type of the linked resource. It is an Integer. Valid values:
1
: The IP address of Anti-DDoS Pro or Anti-DDoS Premium2
: the IP address of the interaction resource (in the tiered protection scenario)3
: the IP address used to accelerate access (in the network acceleration scenario)6
the IP address of the interaction resource (in the cloud service interaction scenario)
- priority int
- The priority of the rule.
- region_
id str - The region where the interaction resource that is used in the scheduling rule is deployed. NOTE: This parameter is returned only if the RuleType parameter is set to 2.
- status int
- The status of the scheduling rule.
- type str
- The address type of the interaction resource. Valid values:
A
: IPv4 address.CNAME
: CNAME record. - value str
- The address of the interaction resource.
- value_
type int - Required. The type of the linked resource. It is an Integer. Valid values:
1
: The IP address of Anti-DDoS Pro or Anti-DDoS Premium2
: the IP address of the interaction resource (in the tiered protection scenario)3
: the IP address used to accelerate access (in the network acceleration scenario)6
the IP address of the interaction resource (in the cloud service interaction scenario)
- priority Number
- The priority of the rule.
- region
Id String - The region where the interaction resource that is used in the scheduling rule is deployed. NOTE: This parameter is returned only if the RuleType parameter is set to 2.
- status Number
- The status of the scheduling rule.
- type String
- The address type of the interaction resource. Valid values:
A
: IPv4 address.CNAME
: CNAME record. - value String
- The address of the interaction resource.
- value
Type Number - Required. The type of the linked resource. It is an Integer. Valid values:
1
: The IP address of Anti-DDoS Pro or Anti-DDoS Premium2
: the IP address of the interaction resource (in the tiered protection scenario)3
: the IP address used to accelerate access (in the network acceleration scenario)6
the IP address of the interaction resource (in the cloud service interaction scenario)
Import
DdosCoo Scheduler Rule can be imported using the id or the rule name, e.g.
$ pulumi import alicloud:ddos/schedulerRule:SchedulerRule example fbb20dc77e8fc******
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.