volcengine.cloud_firewall.CfwControlPolicyPriority
Explore with Pulumi AI
Provides a resource to manage cfw control policy priority
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@volcengine/pulumi";
const fooCfwAddressBook = new volcengine.cloud_firewall.CfwAddressBook("fooCfwAddressBook", {
groupName: "acc-test-address-book",
description: "acc-test",
groupType: "ip",
addressLists: [
"192.168.1.1",
"192.168.2.2",
],
});
const fooCfwControlPolicy = new volcengine.cloud_firewall.CfwControlPolicy("fooCfwControlPolicy", {
direction: "in",
action: "accept",
destinationType: "group",
destination: fooCfwAddressBook.id,
proto: "TCP",
sourceType: "net",
source: "0.0.0.0/0",
description: "acc-test-control-policy",
destPortType: "port",
destPort: "300",
repeatType: "Weekly",
repeatStartTime: "01:00",
repeatEndTime: "11:00",
repeatDays: [
2,
5,
],
startTime: 1736092800,
endTime: 1738339140,
priority: 1,
status: true,
});
const fooCfwControlPolicyPriority = new volcengine.cloud_firewall.CfwControlPolicyPriority("fooCfwControlPolicyPriority", {
direction: "in",
ruleId: fooCfwControlPolicy.ruleId,
newPrio: 5,
});
import pulumi
import pulumi_volcengine as volcengine
foo_cfw_address_book = volcengine.cloud_firewall.CfwAddressBook("fooCfwAddressBook",
group_name="acc-test-address-book",
description="acc-test",
group_type="ip",
address_lists=[
"192.168.1.1",
"192.168.2.2",
])
foo_cfw_control_policy = volcengine.cloud_firewall.CfwControlPolicy("fooCfwControlPolicy",
direction="in",
action="accept",
destination_type="group",
destination=foo_cfw_address_book.id,
proto="TCP",
source_type="net",
source="0.0.0.0/0",
description="acc-test-control-policy",
dest_port_type="port",
dest_port="300",
repeat_type="Weekly",
repeat_start_time="01:00",
repeat_end_time="11:00",
repeat_days=[
2,
5,
],
start_time=1736092800,
end_time=1738339140,
priority=1,
status=True)
foo_cfw_control_policy_priority = volcengine.cloud_firewall.CfwControlPolicyPriority("fooCfwControlPolicyPriority",
direction="in",
rule_id=foo_cfw_control_policy.rule_id,
new_prio=5)
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/cloud_firewall"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
fooCfwAddressBook, err := cloud_firewall.NewCfwAddressBook(ctx, "fooCfwAddressBook", &cloud_firewall.CfwAddressBookArgs{
GroupName: pulumi.String("acc-test-address-book"),
Description: pulumi.String("acc-test"),
GroupType: pulumi.String("ip"),
AddressLists: pulumi.StringArray{
pulumi.String("192.168.1.1"),
pulumi.String("192.168.2.2"),
},
})
if err != nil {
return err
}
fooCfwControlPolicy, err := cloud_firewall.NewCfwControlPolicy(ctx, "fooCfwControlPolicy", &cloud_firewall.CfwControlPolicyArgs{
Direction: pulumi.String("in"),
Action: pulumi.String("accept"),
DestinationType: pulumi.String("group"),
Destination: fooCfwAddressBook.ID(),
Proto: pulumi.String("TCP"),
SourceType: pulumi.String("net"),
Source: pulumi.String("0.0.0.0/0"),
Description: pulumi.String("acc-test-control-policy"),
DestPortType: pulumi.String("port"),
DestPort: pulumi.String("300"),
RepeatType: pulumi.String("Weekly"),
RepeatStartTime: pulumi.String("01:00"),
RepeatEndTime: pulumi.String("11:00"),
RepeatDays: pulumi.IntArray{
pulumi.Int(2),
pulumi.Int(5),
},
StartTime: pulumi.Int(1736092800),
EndTime: pulumi.Int(1738339140),
Priority: pulumi.Int(1),
Status: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = cloud_firewall.NewCfwControlPolicyPriority(ctx, "fooCfwControlPolicyPriority", &cloud_firewall.CfwControlPolicyPriorityArgs{
Direction: pulumi.String("in"),
RuleId: fooCfwControlPolicy.RuleId,
NewPrio: pulumi.Int(5),
})
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 fooCfwAddressBook = new Volcengine.Cloud_firewall.CfwAddressBook("fooCfwAddressBook", new()
{
GroupName = "acc-test-address-book",
Description = "acc-test",
GroupType = "ip",
AddressLists = new[]
{
"192.168.1.1",
"192.168.2.2",
},
});
var fooCfwControlPolicy = new Volcengine.Cloud_firewall.CfwControlPolicy("fooCfwControlPolicy", new()
{
Direction = "in",
Action = "accept",
DestinationType = "group",
Destination = fooCfwAddressBook.Id,
Proto = "TCP",
SourceType = "net",
Source = "0.0.0.0/0",
Description = "acc-test-control-policy",
DestPortType = "port",
DestPort = "300",
RepeatType = "Weekly",
RepeatStartTime = "01:00",
RepeatEndTime = "11:00",
RepeatDays = new[]
{
2,
5,
},
StartTime = 1736092800,
EndTime = 1738339140,
Priority = 1,
Status = true,
});
var fooCfwControlPolicyPriority = new Volcengine.Cloud_firewall.CfwControlPolicyPriority("fooCfwControlPolicyPriority", new()
{
Direction = "in",
RuleId = fooCfwControlPolicy.RuleId,
NewPrio = 5,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.cloud_firewall.CfwAddressBook;
import com.pulumi.volcengine.cloud_firewall.CfwAddressBookArgs;
import com.pulumi.volcengine.cloud_firewall.CfwControlPolicy;
import com.pulumi.volcengine.cloud_firewall.CfwControlPolicyArgs;
import com.pulumi.volcengine.cloud_firewall.CfwControlPolicyPriority;
import com.pulumi.volcengine.cloud_firewall.CfwControlPolicyPriorityArgs;
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 fooCfwAddressBook = new CfwAddressBook("fooCfwAddressBook", CfwAddressBookArgs.builder()
.groupName("acc-test-address-book")
.description("acc-test")
.groupType("ip")
.addressLists(
"192.168.1.1",
"192.168.2.2")
.build());
var fooCfwControlPolicy = new CfwControlPolicy("fooCfwControlPolicy", CfwControlPolicyArgs.builder()
.direction("in")
.action("accept")
.destinationType("group")
.destination(fooCfwAddressBook.id())
.proto("TCP")
.sourceType("net")
.source("0.0.0.0/0")
.description("acc-test-control-policy")
.destPortType("port")
.destPort("300")
.repeatType("Weekly")
.repeatStartTime("01:00")
.repeatEndTime("11:00")
.repeatDays(
2,
5)
.startTime(1736092800)
.endTime(1738339140)
.priority(1)
.status(true)
.build());
var fooCfwControlPolicyPriority = new CfwControlPolicyPriority("fooCfwControlPolicyPriority", CfwControlPolicyPriorityArgs.builder()
.direction("in")
.ruleId(fooCfwControlPolicy.ruleId())
.newPrio(5)
.build());
}
}
resources:
fooCfwAddressBook:
type: volcengine:cloud_firewall:CfwAddressBook
properties:
groupName: acc-test-address-book
description: acc-test
groupType: ip
addressLists:
- 192.168.1.1
- 192.168.2.2
fooCfwControlPolicy:
type: volcengine:cloud_firewall:CfwControlPolicy
properties:
direction: in
action: accept
destinationType: group
destination: ${fooCfwAddressBook.id}
proto: TCP
sourceType: net
source: 0.0.0.0/0
description: acc-test-control-policy
destPortType: port
destPort: '300'
repeatType: Weekly
repeatStartTime: 01:00
repeatEndTime: 11:00
repeatDays:
- 2
- 5
startTime: 1.7360928e+09
endTime: 1.73833914e+09
priority: 1
status: true
fooCfwControlPolicyPriority:
type: volcengine:cloud_firewall:CfwControlPolicyPriority
properties:
direction: in
ruleId: ${fooCfwControlPolicy.ruleId}
newPrio: 5
Create CfwControlPolicyPriority Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CfwControlPolicyPriority(name: string, args: CfwControlPolicyPriorityArgs, opts?: CustomResourceOptions);
@overload
def CfwControlPolicyPriority(resource_name: str,
args: CfwControlPolicyPriorityArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CfwControlPolicyPriority(resource_name: str,
opts: Optional[ResourceOptions] = None,
direction: Optional[str] = None,
rule_id: Optional[str] = None,
new_prio: Optional[int] = None)
func NewCfwControlPolicyPriority(ctx *Context, name string, args CfwControlPolicyPriorityArgs, opts ...ResourceOption) (*CfwControlPolicyPriority, error)
public CfwControlPolicyPriority(string name, CfwControlPolicyPriorityArgs args, CustomResourceOptions? opts = null)
public CfwControlPolicyPriority(String name, CfwControlPolicyPriorityArgs args)
public CfwControlPolicyPriority(String name, CfwControlPolicyPriorityArgs args, CustomResourceOptions options)
type: volcengine:cloud_firewall:CfwControlPolicyPriority
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 CfwControlPolicyPriorityArgs
- 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 CfwControlPolicyPriorityArgs
- 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 CfwControlPolicyPriorityArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CfwControlPolicyPriorityArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CfwControlPolicyPriorityArgs
- 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 cfwControlPolicyPriorityResource = new Volcengine.Cloud_firewall.CfwControlPolicyPriority("cfwControlPolicyPriorityResource", new()
{
Direction = "string",
RuleId = "string",
NewPrio = 0,
});
example, err := cloud_firewall.NewCfwControlPolicyPriority(ctx, "cfwControlPolicyPriorityResource", &cloud_firewall.CfwControlPolicyPriorityArgs{
Direction: pulumi.String("string"),
RuleId: pulumi.String("string"),
NewPrio: pulumi.Int(0),
})
var cfwControlPolicyPriorityResource = new CfwControlPolicyPriority("cfwControlPolicyPriorityResource", CfwControlPolicyPriorityArgs.builder()
.direction("string")
.ruleId("string")
.newPrio(0)
.build());
cfw_control_policy_priority_resource = volcengine.cloud_firewall.CfwControlPolicyPriority("cfwControlPolicyPriorityResource",
direction="string",
rule_id="string",
new_prio=0)
const cfwControlPolicyPriorityResource = new volcengine.cloud_firewall.CfwControlPolicyPriority("cfwControlPolicyPriorityResource", {
direction: "string",
ruleId: "string",
newPrio: 0,
});
type: volcengine:cloud_firewall:CfwControlPolicyPriority
properties:
direction: string
newPrio: 0
ruleId: string
CfwControlPolicyPriority 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 CfwControlPolicyPriority resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the CfwControlPolicyPriority resource produces the following output properties:
Look up Existing CfwControlPolicyPriority Resource
Get an existing CfwControlPolicyPriority 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?: CfwControlPolicyPriorityState, opts?: CustomResourceOptions): CfwControlPolicyPriority
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
direction: Optional[str] = None,
new_prio: Optional[int] = None,
prio: Optional[int] = None,
rule_id: Optional[str] = None) -> CfwControlPolicyPriority
func GetCfwControlPolicyPriority(ctx *Context, name string, id IDInput, state *CfwControlPolicyPriorityState, opts ...ResourceOption) (*CfwControlPolicyPriority, error)
public static CfwControlPolicyPriority Get(string name, Input<string> id, CfwControlPolicyPriorityState? state, CustomResourceOptions? opts = null)
public static CfwControlPolicyPriority get(String name, Output<String> id, CfwControlPolicyPriorityState state, CustomResourceOptions options)
resources: _: type: volcengine:cloud_firewall:CfwControlPolicyPriority 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.
- Direction string
- The direction of the control policy. Valid values:
in
,out
. - New
Prio int - The new priority of the control policy. The priority increases in order from 1, with lower priority indicating higher priority.
- Prio int
- The priority of the control policy.
- Rule
Id string - The rule id of the control policy.
- Direction string
- The direction of the control policy. Valid values:
in
,out
. - New
Prio int - The new priority of the control policy. The priority increases in order from 1, with lower priority indicating higher priority.
- Prio int
- The priority of the control policy.
- Rule
Id string - The rule id of the control policy.
- direction String
- The direction of the control policy. Valid values:
in
,out
. - new
Prio Integer - The new priority of the control policy. The priority increases in order from 1, with lower priority indicating higher priority.
- prio Integer
- The priority of the control policy.
- rule
Id String - The rule id of the control policy.
- direction string
- The direction of the control policy. Valid values:
in
,out
. - new
Prio number - The new priority of the control policy. The priority increases in order from 1, with lower priority indicating higher priority.
- prio number
- The priority of the control policy.
- rule
Id string - The rule id of the control policy.
- direction String
- The direction of the control policy. Valid values:
in
,out
. - new
Prio Number - The new priority of the control policy. The priority increases in order from 1, with lower priority indicating higher priority.
- prio Number
- The priority of the control policy.
- rule
Id String - The rule id of the control policy.
Import
ControlPolicyPriority can be imported using the direction:rule_id, e.g.
$ pulumi import volcengine:cloud_firewall/cfwControlPolicyPriority:CfwControlPolicyPriority 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.