volcengine.cloud_firewall.CfwNatFirewallControlPolicyPriority
Explore with Pulumi AI
Provides a resource to manage cfw nat firewall 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 fooCfwNatFirewallControlPolicy = new volcengine.cloud_firewall.CfwNatFirewallControlPolicy("fooCfwNatFirewallControlPolicy", {
direction: "in",
natFirewallId: "nfw-ydmkayvjsw2vsavx****",
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,
4,
],
startTime: 1736092800,
endTime: 1738339140,
priority: 1,
status: true,
});
const fooCfwNatFirewallControlPolicyPriority = new volcengine.cloud_firewall.CfwNatFirewallControlPolicyPriority("fooCfwNatFirewallControlPolicyPriority", {
direction: "in",
natFirewallId: "nfw-ydmkayvjsw2vsavx****",
ruleId: fooCfwNatFirewallControlPolicy.ruleId,
newPrio: 2,
});
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_nat_firewall_control_policy = volcengine.cloud_firewall.CfwNatFirewallControlPolicy("fooCfwNatFirewallControlPolicy",
direction="in",
nat_firewall_id="nfw-ydmkayvjsw2vsavx****",
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,
4,
],
start_time=1736092800,
end_time=1738339140,
priority=1,
status=True)
foo_cfw_nat_firewall_control_policy_priority = volcengine.cloud_firewall.CfwNatFirewallControlPolicyPriority("fooCfwNatFirewallControlPolicyPriority",
direction="in",
nat_firewall_id="nfw-ydmkayvjsw2vsavx****",
rule_id=foo_cfw_nat_firewall_control_policy.rule_id,
new_prio=2)
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
}
fooCfwNatFirewallControlPolicy, err := cloud_firewall.NewCfwNatFirewallControlPolicy(ctx, "fooCfwNatFirewallControlPolicy", &cloud_firewall.CfwNatFirewallControlPolicyArgs{
Direction: pulumi.String("in"),
NatFirewallId: pulumi.String("nfw-ydmkayvjsw2vsavx****"),
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),
pulumi.Int(4),
},
StartTime: pulumi.Int(1736092800),
EndTime: pulumi.Int(1738339140),
Priority: pulumi.Int(1),
Status: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = cloud_firewall.NewCfwNatFirewallControlPolicyPriority(ctx, "fooCfwNatFirewallControlPolicyPriority", &cloud_firewall.CfwNatFirewallControlPolicyPriorityArgs{
Direction: pulumi.String("in"),
NatFirewallId: pulumi.String("nfw-ydmkayvjsw2vsavx****"),
RuleId: fooCfwNatFirewallControlPolicy.RuleId,
NewPrio: pulumi.Int(2),
})
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 fooCfwNatFirewallControlPolicy = new Volcengine.Cloud_firewall.CfwNatFirewallControlPolicy("fooCfwNatFirewallControlPolicy", new()
{
Direction = "in",
NatFirewallId = "nfw-ydmkayvjsw2vsavx****",
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,
4,
},
StartTime = 1736092800,
EndTime = 1738339140,
Priority = 1,
Status = true,
});
var fooCfwNatFirewallControlPolicyPriority = new Volcengine.Cloud_firewall.CfwNatFirewallControlPolicyPriority("fooCfwNatFirewallControlPolicyPriority", new()
{
Direction = "in",
NatFirewallId = "nfw-ydmkayvjsw2vsavx****",
RuleId = fooCfwNatFirewallControlPolicy.RuleId,
NewPrio = 2,
});
});
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.CfwNatFirewallControlPolicy;
import com.pulumi.volcengine.cloud_firewall.CfwNatFirewallControlPolicyArgs;
import com.pulumi.volcengine.cloud_firewall.CfwNatFirewallControlPolicyPriority;
import com.pulumi.volcengine.cloud_firewall.CfwNatFirewallControlPolicyPriorityArgs;
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 fooCfwNatFirewallControlPolicy = new CfwNatFirewallControlPolicy("fooCfwNatFirewallControlPolicy", CfwNatFirewallControlPolicyArgs.builder()
.direction("in")
.natFirewallId("nfw-ydmkayvjsw2vsavx****")
.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,
4)
.startTime(1736092800)
.endTime(1738339140)
.priority(1)
.status(true)
.build());
var fooCfwNatFirewallControlPolicyPriority = new CfwNatFirewallControlPolicyPriority("fooCfwNatFirewallControlPolicyPriority", CfwNatFirewallControlPolicyPriorityArgs.builder()
.direction("in")
.natFirewallId("nfw-ydmkayvjsw2vsavx****")
.ruleId(fooCfwNatFirewallControlPolicy.ruleId())
.newPrio(2)
.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
fooCfwNatFirewallControlPolicy:
type: volcengine:cloud_firewall:CfwNatFirewallControlPolicy
properties:
direction: in
natFirewallId: nfw-ydmkayvjsw2vsavx****
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
- 4
startTime: 1.7360928e+09
endTime: 1.73833914e+09
priority: 1
status: true
fooCfwNatFirewallControlPolicyPriority:
type: volcengine:cloud_firewall:CfwNatFirewallControlPolicyPriority
properties:
direction: in
natFirewallId: nfw-ydmkayvjsw2vsavx****
ruleId: ${fooCfwNatFirewallControlPolicy.ruleId}
newPrio: 2
Create CfwNatFirewallControlPolicyPriority Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CfwNatFirewallControlPolicyPriority(name: string, args: CfwNatFirewallControlPolicyPriorityArgs, opts?: CustomResourceOptions);
@overload
def CfwNatFirewallControlPolicyPriority(resource_name: str,
args: CfwNatFirewallControlPolicyPriorityArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CfwNatFirewallControlPolicyPriority(resource_name: str,
opts: Optional[ResourceOptions] = None,
direction: Optional[str] = None,
nat_firewall_id: Optional[str] = None,
rule_id: Optional[str] = None,
new_prio: Optional[int] = None)
func NewCfwNatFirewallControlPolicyPriority(ctx *Context, name string, args CfwNatFirewallControlPolicyPriorityArgs, opts ...ResourceOption) (*CfwNatFirewallControlPolicyPriority, error)
public CfwNatFirewallControlPolicyPriority(string name, CfwNatFirewallControlPolicyPriorityArgs args, CustomResourceOptions? opts = null)
public CfwNatFirewallControlPolicyPriority(String name, CfwNatFirewallControlPolicyPriorityArgs args)
public CfwNatFirewallControlPolicyPriority(String name, CfwNatFirewallControlPolicyPriorityArgs args, CustomResourceOptions options)
type: volcengine:cloud_firewall:CfwNatFirewallControlPolicyPriority
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 CfwNatFirewallControlPolicyPriorityArgs
- 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 CfwNatFirewallControlPolicyPriorityArgs
- 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 CfwNatFirewallControlPolicyPriorityArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CfwNatFirewallControlPolicyPriorityArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CfwNatFirewallControlPolicyPriorityArgs
- 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 cfwNatFirewallControlPolicyPriorityResource = new Volcengine.Cloud_firewall.CfwNatFirewallControlPolicyPriority("cfwNatFirewallControlPolicyPriorityResource", new()
{
Direction = "string",
NatFirewallId = "string",
RuleId = "string",
NewPrio = 0,
});
example, err := cloud_firewall.NewCfwNatFirewallControlPolicyPriority(ctx, "cfwNatFirewallControlPolicyPriorityResource", &cloud_firewall.CfwNatFirewallControlPolicyPriorityArgs{
Direction: pulumi.String("string"),
NatFirewallId: pulumi.String("string"),
RuleId: pulumi.String("string"),
NewPrio: pulumi.Int(0),
})
var cfwNatFirewallControlPolicyPriorityResource = new CfwNatFirewallControlPolicyPriority("cfwNatFirewallControlPolicyPriorityResource", CfwNatFirewallControlPolicyPriorityArgs.builder()
.direction("string")
.natFirewallId("string")
.ruleId("string")
.newPrio(0)
.build());
cfw_nat_firewall_control_policy_priority_resource = volcengine.cloud_firewall.CfwNatFirewallControlPolicyPriority("cfwNatFirewallControlPolicyPriorityResource",
direction="string",
nat_firewall_id="string",
rule_id="string",
new_prio=0)
const cfwNatFirewallControlPolicyPriorityResource = new volcengine.cloud_firewall.CfwNatFirewallControlPolicyPriority("cfwNatFirewallControlPolicyPriorityResource", {
direction: "string",
natFirewallId: "string",
ruleId: "string",
newPrio: 0,
});
type: volcengine:cloud_firewall:CfwNatFirewallControlPolicyPriority
properties:
direction: string
natFirewallId: string
newPrio: 0
ruleId: string
CfwNatFirewallControlPolicyPriority 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 CfwNatFirewallControlPolicyPriority resource accepts the following input properties:
- Direction string
- The direction of the nat firewall control policy. Valid values:
in
,out
. - Nat
Firewall stringId - The id of the nat firewall.
- Rule
Id string - The rule id of the nat firewall control policy.
- New
Prio int - The new priority of the nat firewall control policy. The priority increases in order from 1, with lower priority indicating higher priority.
- Direction string
- The direction of the nat firewall control policy. Valid values:
in
,out
. - Nat
Firewall stringId - The id of the nat firewall.
- Rule
Id string - The rule id of the nat firewall control policy.
- New
Prio int - The new priority of the nat firewall control policy. The priority increases in order from 1, with lower priority indicating higher priority.
- direction String
- The direction of the nat firewall control policy. Valid values:
in
,out
. - nat
Firewall StringId - The id of the nat firewall.
- rule
Id String - The rule id of the nat firewall control policy.
- new
Prio Integer - The new priority of the nat firewall control policy. The priority increases in order from 1, with lower priority indicating higher priority.
- direction string
- The direction of the nat firewall control policy. Valid values:
in
,out
. - nat
Firewall stringId - The id of the nat firewall.
- rule
Id string - The rule id of the nat firewall control policy.
- new
Prio number - The new priority of the nat firewall control policy. The priority increases in order from 1, with lower priority indicating higher priority.
- direction str
- The direction of the nat firewall control policy. Valid values:
in
,out
. - nat_
firewall_ strid - The id of the nat firewall.
- rule_
id str - The rule id of the nat firewall control policy.
- new_
prio int - The new priority of the nat firewall control policy. The priority increases in order from 1, with lower priority indicating higher priority.
- direction String
- The direction of the nat firewall control policy. Valid values:
in
,out
. - nat
Firewall StringId - The id of the nat firewall.
- rule
Id String - The rule id of the nat firewall control policy.
- new
Prio Number - The new priority of the nat firewall control policy. The priority increases in order from 1, with lower priority indicating higher priority.
Outputs
All input properties are implicitly available as output properties. Additionally, the CfwNatFirewallControlPolicyPriority resource produces the following output properties:
Look up Existing CfwNatFirewallControlPolicyPriority Resource
Get an existing CfwNatFirewallControlPolicyPriority 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?: CfwNatFirewallControlPolicyPriorityState, opts?: CustomResourceOptions): CfwNatFirewallControlPolicyPriority
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
direction: Optional[str] = None,
nat_firewall_id: Optional[str] = None,
new_prio: Optional[int] = None,
prio: Optional[int] = None,
rule_id: Optional[str] = None) -> CfwNatFirewallControlPolicyPriority
func GetCfwNatFirewallControlPolicyPriority(ctx *Context, name string, id IDInput, state *CfwNatFirewallControlPolicyPriorityState, opts ...ResourceOption) (*CfwNatFirewallControlPolicyPriority, error)
public static CfwNatFirewallControlPolicyPriority Get(string name, Input<string> id, CfwNatFirewallControlPolicyPriorityState? state, CustomResourceOptions? opts = null)
public static CfwNatFirewallControlPolicyPriority get(String name, Output<String> id, CfwNatFirewallControlPolicyPriorityState state, CustomResourceOptions options)
resources: _: type: volcengine:cloud_firewall:CfwNatFirewallControlPolicyPriority 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 nat firewall control policy. Valid values:
in
,out
. - Nat
Firewall stringId - The id of the nat firewall.
- New
Prio int - The new priority of the nat firewall control policy. The priority increases in order from 1, with lower priority indicating higher priority.
- Prio int
- The priority of the nat firewall control policy.
- Rule
Id string - The rule id of the nat firewall control policy.
- Direction string
- The direction of the nat firewall control policy. Valid values:
in
,out
. - Nat
Firewall stringId - The id of the nat firewall.
- New
Prio int - The new priority of the nat firewall control policy. The priority increases in order from 1, with lower priority indicating higher priority.
- Prio int
- The priority of the nat firewall control policy.
- Rule
Id string - The rule id of the nat firewall control policy.
- direction String
- The direction of the nat firewall control policy. Valid values:
in
,out
. - nat
Firewall StringId - The id of the nat firewall.
- new
Prio Integer - The new priority of the nat firewall control policy. The priority increases in order from 1, with lower priority indicating higher priority.
- prio Integer
- The priority of the nat firewall control policy.
- rule
Id String - The rule id of the nat firewall control policy.
- direction string
- The direction of the nat firewall control policy. Valid values:
in
,out
. - nat
Firewall stringId - The id of the nat firewall.
- new
Prio number - The new priority of the nat firewall control policy. The priority increases in order from 1, with lower priority indicating higher priority.
- prio number
- The priority of the nat firewall control policy.
- rule
Id string - The rule id of the nat firewall control policy.
- direction str
- The direction of the nat firewall control policy. Valid values:
in
,out
. - nat_
firewall_ strid - The id of the nat firewall.
- new_
prio int - The new priority of the nat firewall control policy. The priority increases in order from 1, with lower priority indicating higher priority.
- prio int
- The priority of the nat firewall control policy.
- rule_
id str - The rule id of the nat firewall control policy.
- direction String
- The direction of the nat firewall control policy. Valid values:
in
,out
. - nat
Firewall StringId - The id of the nat firewall.
- new
Prio Number - The new priority of the nat firewall control policy. The priority increases in order from 1, with lower priority indicating higher priority.
- prio Number
- The priority of the nat firewall control policy.
- rule
Id String - The rule id of the nat firewall control policy.
Import
NatFirewallControlPolicyPriority can be imported using the direction_nat_firewall_id:rule_id, e.g.
$ pulumi import volcengine:cloud_firewall/cfwNatFirewallControlPolicyPriority:CfwNatFirewallControlPolicyPriority 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.