published on Monday, Aug 24, 2026 by Pulumi
published on Monday, Aug 24, 2026 by Pulumi
Represents a traffic classification rule that describes one or more match conditions along with the action to be taken when traffic matches this condition.
Warning: This resource is in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta resources.
To get more information about RegionNetworkPolicyTrafficClassificationRule, see:
Example Usage
Region Network Policy Traffic Classification Rule Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const basicRegionalNetworkPolicy = new gcp.compute.RegionNetworkPolicy("basic_regional_network_policy", {
name: "nw-policy",
description: "Sample regional network firewall policy",
project: "my-project-name",
region: "us-west1",
});
const primary = new gcp.compute.RegionNetworkPolicyTrafficClassificationRule("primary", {
ruleName: "test-rule",
description: "This is a simple rule description",
disabled: false,
networkPolicy: basicRegionalNetworkPolicy.name,
priority: 1000,
region: "us-west1",
action: {
trafficClass: "TC1",
dscpMode: "AUTO",
},
match: {
srcIpRanges: ["10.100.0.1/32"],
destIpRanges: ["11.100.0.1/32"],
layer4Configs: [{
ipProtocol: "all",
}],
},
});
import pulumi
import pulumi_gcp as gcp
basic_regional_network_policy = gcp.compute.RegionNetworkPolicy("basic_regional_network_policy",
name="nw-policy",
description="Sample regional network firewall policy",
project="my-project-name",
region="us-west1")
primary = gcp.compute.RegionNetworkPolicyTrafficClassificationRule("primary",
rule_name="test-rule",
description="This is a simple rule description",
disabled=False,
network_policy=basic_regional_network_policy.name,
priority=1000,
region="us-west1",
action={
"traffic_class": "TC1",
"dscp_mode": "AUTO",
},
match={
"src_ip_ranges": ["10.100.0.1/32"],
"dest_ip_ranges": ["11.100.0.1/32"],
"layer4_configs": [{
"ip_protocol": "all",
}],
})
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
basicRegionalNetworkPolicy, err := compute.NewRegionNetworkPolicy(ctx, "basic_regional_network_policy", &compute.RegionNetworkPolicyArgs{
Name: pulumi.String("nw-policy"),
Description: pulumi.String("Sample regional network firewall policy"),
Project: pulumi.String("my-project-name"),
Region: pulumi.String("us-west1"),
})
if err != nil {
return err
}
_, err = compute.NewRegionNetworkPolicyTrafficClassificationRule(ctx, "primary", &compute.RegionNetworkPolicyTrafficClassificationRuleArgs{
RuleName: pulumi.String("test-rule"),
Description: pulumi.String("This is a simple rule description"),
Disabled: pulumi.Bool(false),
NetworkPolicy: basicRegionalNetworkPolicy.Name,
Priority: pulumi.Int(1000),
Region: pulumi.String("us-west1"),
Action: &compute.RegionNetworkPolicyTrafficClassificationRuleActionArgs{
TrafficClass: pulumi.String("TC1"),
DscpMode: pulumi.String("AUTO"),
},
Match: &compute.RegionNetworkPolicyTrafficClassificationRuleMatchArgs{
SrcIpRanges: pulumi.StringArray{
pulumi.String("10.100.0.1/32"),
},
DestIpRanges: pulumi.StringArray{
pulumi.String("11.100.0.1/32"),
},
Layer4Configs: compute.RegionNetworkPolicyTrafficClassificationRuleMatchLayer4ConfigArray{
&compute.RegionNetworkPolicyTrafficClassificationRuleMatchLayer4ConfigArgs{
IpProtocol: pulumi.String("all"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var basicRegionalNetworkPolicy = new Gcp.Compute.RegionNetworkPolicy("basic_regional_network_policy", new()
{
Name = "nw-policy",
Description = "Sample regional network firewall policy",
Project = "my-project-name",
Region = "us-west1",
});
var primary = new Gcp.Compute.RegionNetworkPolicyTrafficClassificationRule("primary", new()
{
RuleName = "test-rule",
Description = "This is a simple rule description",
Disabled = false,
NetworkPolicy = basicRegionalNetworkPolicy.Name,
Priority = 1000,
Region = "us-west1",
Action = new Gcp.Compute.Inputs.RegionNetworkPolicyTrafficClassificationRuleActionArgs
{
TrafficClass = "TC1",
DscpMode = "AUTO",
},
Match = new Gcp.Compute.Inputs.RegionNetworkPolicyTrafficClassificationRuleMatchArgs
{
SrcIpRanges = new[]
{
"10.100.0.1/32",
},
DestIpRanges = new[]
{
"11.100.0.1/32",
},
Layer4Configs = new[]
{
new Gcp.Compute.Inputs.RegionNetworkPolicyTrafficClassificationRuleMatchLayer4ConfigArgs
{
IpProtocol = "all",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.RegionNetworkPolicy;
import com.pulumi.gcp.compute.RegionNetworkPolicyArgs;
import com.pulumi.gcp.compute.RegionNetworkPolicyTrafficClassificationRule;
import com.pulumi.gcp.compute.RegionNetworkPolicyTrafficClassificationRuleArgs;
import com.pulumi.gcp.compute.inputs.RegionNetworkPolicyTrafficClassificationRuleActionArgs;
import com.pulumi.gcp.compute.inputs.RegionNetworkPolicyTrafficClassificationRuleMatchArgs;
import com.pulumi.gcp.compute.inputs.RegionNetworkPolicyTrafficClassificationRuleMatchLayer4ConfigArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 basicRegionalNetworkPolicy = new RegionNetworkPolicy("basicRegionalNetworkPolicy", RegionNetworkPolicyArgs.builder()
.name("nw-policy")
.description("Sample regional network firewall policy")
.project("my-project-name")
.region("us-west1")
.build());
var primary = new RegionNetworkPolicyTrafficClassificationRule("primary", RegionNetworkPolicyTrafficClassificationRuleArgs.builder()
.ruleName("test-rule")
.description("This is a simple rule description")
.disabled(false)
.networkPolicy(basicRegionalNetworkPolicy.name())
.priority(1000)
.region("us-west1")
.action(RegionNetworkPolicyTrafficClassificationRuleActionArgs.builder()
.trafficClass("TC1")
.dscpMode("AUTO")
.build())
.match(RegionNetworkPolicyTrafficClassificationRuleMatchArgs.builder()
.srcIpRanges("10.100.0.1/32")
.destIpRanges("11.100.0.1/32")
.layer4Configs(RegionNetworkPolicyTrafficClassificationRuleMatchLayer4ConfigArgs.builder()
.ipProtocol("all")
.build())
.build())
.build());
}
}
resources:
basicRegionalNetworkPolicy:
type: gcp:compute:RegionNetworkPolicy
name: basic_regional_network_policy
properties:
name: nw-policy
description: Sample regional network firewall policy
project: my-project-name
region: us-west1
primary:
type: gcp:compute:RegionNetworkPolicyTrafficClassificationRule
properties:
ruleName: test-rule
description: This is a simple rule description
disabled: false
networkPolicy: ${basicRegionalNetworkPolicy.name}
priority: 1000
region: us-west1
action:
trafficClass: TC1
dscpMode: AUTO
match:
srcIpRanges:
- 10.100.0.1/32
destIpRanges:
- 11.100.0.1/32
layer4Configs:
- ipProtocol: all
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_compute_regionnetworkpolicy" "basic_regional_network_policy" {
name = "nw-policy"
description = "Sample regional network firewall policy"
project = "my-project-name"
region = "us-west1"
}
resource "gcp_compute_regionnetworkpolicytrafficclassificationrule" "primary" {
rule_name = "test-rule"
description = "This is a simple rule description"
disabled = false
network_policy = gcp_compute_regionnetworkpolicy.basic_regional_network_policy.name
priority = 1000
region = "us-west1"
action = {
traffic_class = "TC1"
dscp_mode = "AUTO"
}
match = {
src_ip_ranges = ["10.100.0.1/32"]
dest_ip_ranges = ["11.100.0.1/32"]
layer4_configs = [{
"ipProtocol" = "all"
}]
}
}
Create RegionNetworkPolicyTrafficClassificationRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RegionNetworkPolicyTrafficClassificationRule(name: string, args: RegionNetworkPolicyTrafficClassificationRuleArgs, opts?: CustomResourceOptions);@overload
def RegionNetworkPolicyTrafficClassificationRule(resource_name: str,
args: RegionNetworkPolicyTrafficClassificationRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RegionNetworkPolicyTrafficClassificationRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
match: Optional[RegionNetworkPolicyTrafficClassificationRuleMatchArgs] = None,
network_policy: Optional[str] = None,
priority: Optional[int] = None,
action: Optional[RegionNetworkPolicyTrafficClassificationRuleActionArgs] = None,
deletion_policy: Optional[str] = None,
description: Optional[str] = None,
disabled: Optional[bool] = None,
project: Optional[str] = None,
region: Optional[str] = None,
rule_name: Optional[str] = None,
target_secure_tags: Optional[Sequence[RegionNetworkPolicyTrafficClassificationRuleTargetSecureTagArgs]] = None,
target_service_accounts: Optional[Sequence[str]] = None)func NewRegionNetworkPolicyTrafficClassificationRule(ctx *Context, name string, args RegionNetworkPolicyTrafficClassificationRuleArgs, opts ...ResourceOption) (*RegionNetworkPolicyTrafficClassificationRule, error)public RegionNetworkPolicyTrafficClassificationRule(string name, RegionNetworkPolicyTrafficClassificationRuleArgs args, CustomResourceOptions? opts = null)
public RegionNetworkPolicyTrafficClassificationRule(String name, RegionNetworkPolicyTrafficClassificationRuleArgs args)
public RegionNetworkPolicyTrafficClassificationRule(String name, RegionNetworkPolicyTrafficClassificationRuleArgs args, CustomResourceOptions options)
type: gcp:compute:RegionNetworkPolicyTrafficClassificationRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "gcp_compute_region_network_policy_traffic_classification_rule" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args RegionNetworkPolicyTrafficClassificationRuleArgs
- 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 RegionNetworkPolicyTrafficClassificationRuleArgs
- 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 RegionNetworkPolicyTrafficClassificationRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RegionNetworkPolicyTrafficClassificationRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RegionNetworkPolicyTrafficClassificationRuleArgs
- 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 regionNetworkPolicyTrafficClassificationRuleResource = new Gcp.Compute.RegionNetworkPolicyTrafficClassificationRule("regionNetworkPolicyTrafficClassificationRuleResource", new()
{
Match = new Gcp.Compute.Inputs.RegionNetworkPolicyTrafficClassificationRuleMatchArgs
{
Layer4Configs = new[]
{
new Gcp.Compute.Inputs.RegionNetworkPolicyTrafficClassificationRuleMatchLayer4ConfigArgs
{
IpProtocol = "string",
Ports = new[]
{
"string",
},
},
},
DestIpRanges = new[]
{
"string",
},
SrcIpRanges = new[]
{
"string",
},
},
NetworkPolicy = "string",
Priority = 0,
Action = new Gcp.Compute.Inputs.RegionNetworkPolicyTrafficClassificationRuleActionArgs
{
DscpMode = "string",
DscpValue = 0,
TrafficClass = "string",
Type = "string",
},
DeletionPolicy = "string",
Description = "string",
Disabled = false,
Project = "string",
Region = "string",
RuleName = "string",
TargetSecureTags = new[]
{
new Gcp.Compute.Inputs.RegionNetworkPolicyTrafficClassificationRuleTargetSecureTagArgs
{
Name = "string",
State = "string",
},
},
TargetServiceAccounts = new[]
{
"string",
},
});
example, err := compute.NewRegionNetworkPolicyTrafficClassificationRule(ctx, "regionNetworkPolicyTrafficClassificationRuleResource", &compute.RegionNetworkPolicyTrafficClassificationRuleArgs{
Match: &compute.RegionNetworkPolicyTrafficClassificationRuleMatchArgs{
Layer4Configs: compute.RegionNetworkPolicyTrafficClassificationRuleMatchLayer4ConfigArray{
&compute.RegionNetworkPolicyTrafficClassificationRuleMatchLayer4ConfigArgs{
IpProtocol: pulumi.String("string"),
Ports: pulumi.StringArray{
pulumi.String("string"),
},
},
},
DestIpRanges: pulumi.StringArray{
pulumi.String("string"),
},
SrcIpRanges: pulumi.StringArray{
pulumi.String("string"),
},
},
NetworkPolicy: pulumi.String("string"),
Priority: pulumi.Int(0),
Action: &compute.RegionNetworkPolicyTrafficClassificationRuleActionArgs{
DscpMode: pulumi.String("string"),
DscpValue: pulumi.Int(0),
TrafficClass: pulumi.String("string"),
Type: pulumi.String("string"),
},
DeletionPolicy: pulumi.String("string"),
Description: pulumi.String("string"),
Disabled: pulumi.Bool(false),
Project: pulumi.String("string"),
Region: pulumi.String("string"),
RuleName: pulumi.String("string"),
TargetSecureTags: compute.RegionNetworkPolicyTrafficClassificationRuleTargetSecureTagArray{
&compute.RegionNetworkPolicyTrafficClassificationRuleTargetSecureTagArgs{
Name: pulumi.String("string"),
State: pulumi.String("string"),
},
},
TargetServiceAccounts: pulumi.StringArray{
pulumi.String("string"),
},
})
resource "gcp_compute_region_network_policy_traffic_classification_rule" "regionNetworkPolicyTrafficClassificationRuleResource" {
lifecycle {
create_before_destroy = true
}
match = {
layer4_configs = [{
ip_protocol = "string"
ports = ["string"]
}]
dest_ip_ranges = ["string"]
src_ip_ranges = ["string"]
}
network_policy = "string"
priority = 0
action = {
dscp_mode = "string"
dscp_value = 0
traffic_class = "string"
type = "string"
}
deletion_policy = "string"
description = "string"
disabled = false
project = "string"
region = "string"
rule_name = "string"
target_secure_tags {
name = "string"
state = "string"
}
target_service_accounts = ["string"]
}
var regionNetworkPolicyTrafficClassificationRuleResource = new RegionNetworkPolicyTrafficClassificationRule("regionNetworkPolicyTrafficClassificationRuleResource", RegionNetworkPolicyTrafficClassificationRuleArgs.builder()
.match(RegionNetworkPolicyTrafficClassificationRuleMatchArgs.builder()
.layer4Configs(RegionNetworkPolicyTrafficClassificationRuleMatchLayer4ConfigArgs.builder()
.ipProtocol("string")
.ports("string")
.build())
.destIpRanges("string")
.srcIpRanges("string")
.build())
.networkPolicy("string")
.priority(0)
.action(RegionNetworkPolicyTrafficClassificationRuleActionArgs.builder()
.dscpMode("string")
.dscpValue(0)
.trafficClass("string")
.type("string")
.build())
.deletionPolicy("string")
.description("string")
.disabled(false)
.project("string")
.region("string")
.ruleName("string")
.targetSecureTags(RegionNetworkPolicyTrafficClassificationRuleTargetSecureTagArgs.builder()
.name("string")
.state("string")
.build())
.targetServiceAccounts("string")
.build());
region_network_policy_traffic_classification_rule_resource = gcp.compute.RegionNetworkPolicyTrafficClassificationRule("regionNetworkPolicyTrafficClassificationRuleResource",
match={
"layer4_configs": [{
"ip_protocol": "string",
"ports": ["string"],
}],
"dest_ip_ranges": ["string"],
"src_ip_ranges": ["string"],
},
network_policy="string",
priority=0,
action={
"dscp_mode": "string",
"dscp_value": 0,
"traffic_class": "string",
"type": "string",
},
deletion_policy="string",
description="string",
disabled=False,
project="string",
region="string",
rule_name="string",
target_secure_tags=[{
"name": "string",
"state": "string",
}],
target_service_accounts=["string"])
const regionNetworkPolicyTrafficClassificationRuleResource = new gcp.compute.RegionNetworkPolicyTrafficClassificationRule("regionNetworkPolicyTrafficClassificationRuleResource", {
match: {
layer4Configs: [{
ipProtocol: "string",
ports: ["string"],
}],
destIpRanges: ["string"],
srcIpRanges: ["string"],
},
networkPolicy: "string",
priority: 0,
action: {
dscpMode: "string",
dscpValue: 0,
trafficClass: "string",
type: "string",
},
deletionPolicy: "string",
description: "string",
disabled: false,
project: "string",
region: "string",
ruleName: "string",
targetSecureTags: [{
name: "string",
state: "string",
}],
targetServiceAccounts: ["string"],
});
type: gcp:compute:RegionNetworkPolicyTrafficClassificationRule
properties:
action:
dscpMode: string
dscpValue: 0
trafficClass: string
type: string
deletionPolicy: string
description: string
disabled: false
match:
destIpRanges:
- string
layer4Configs:
- ipProtocol: string
ports:
- string
srcIpRanges:
- string
networkPolicy: string
priority: 0
project: string
region: string
ruleName: string
targetSecureTags:
- name: string
state: string
targetServiceAccounts:
- string
RegionNetworkPolicyTrafficClassificationRule 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 RegionNetworkPolicyTrafficClassificationRule resource accepts the following input properties:
- Match
Region
Network Policy Traffic Classification Rule Match - A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- Network
Policy string - The firewall policy of the resource.
- Priority int
- An integer indicating the priority of a rule in the list. The priority must be a positive value between 1 and 2147482647. The priority values from 2147482648 to 2147483647 (1000) are reserved for system default network policy rules. Rules are evaluated from highest to lowest priority where 1 is the highest priority and 2147483647 is the lowest priority.
- Action
Region
Network Policy Traffic Classification Rule Action - The Action to perform when the client connection triggers the rule. Structure is documented below.
- Deletion
Policy string - Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- Description string
- An optional description for this resource.
- Disabled bool
- Denotes whether the network policy rule is disabled. When set to true, the network policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the network policy rule will be enabled.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
- The location of this resource.
- Rule
Name string - An optional name for the rule. This field is not a unique identifier and can be updated.
-
List<Region
Network Policy Traffic Classification Rule Target Secure Tag> - A list of secure tags that controls which instances the traffic classification rule applies to. If targetSecureTag are specified, then the traffic classification rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. Structure is documented below.
- Target
Service List<string>Accounts - A list of service accounts indicating the sets of instances that are applied with this rule.
- Match
Region
Network Policy Traffic Classification Rule Match Args - A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- Network
Policy string - The firewall policy of the resource.
- Priority int
- An integer indicating the priority of a rule in the list. The priority must be a positive value between 1 and 2147482647. The priority values from 2147482648 to 2147483647 (1000) are reserved for system default network policy rules. Rules are evaluated from highest to lowest priority where 1 is the highest priority and 2147483647 is the lowest priority.
- Action
Region
Network Policy Traffic Classification Rule Action Args - The Action to perform when the client connection triggers the rule. Structure is documented below.
- Deletion
Policy string - Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- Description string
- An optional description for this resource.
- Disabled bool
- Denotes whether the network policy rule is disabled. When set to true, the network policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the network policy rule will be enabled.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
- The location of this resource.
- Rule
Name string - An optional name for the rule. This field is not a unique identifier and can be updated.
-
[]Region
Network Policy Traffic Classification Rule Target Secure Tag Args - A list of secure tags that controls which instances the traffic classification rule applies to. If targetSecureTag are specified, then the traffic classification rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. Structure is documented below.
- Target
Service []stringAccounts - A list of service accounts indicating the sets of instances that are applied with this rule.
- match object
- A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- network_
policy string - The firewall policy of the resource.
- priority number
- An integer indicating the priority of a rule in the list. The priority must be a positive value between 1 and 2147482647. The priority values from 2147482648 to 2147483647 (1000) are reserved for system default network policy rules. Rules are evaluated from highest to lowest priority where 1 is the highest priority and 2147483647 is the lowest priority.
- action object
- The Action to perform when the client connection triggers the rule. Structure is documented below.
- deletion_
policy string - Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- description string
- An optional description for this resource.
- disabled bool
- Denotes whether the network policy rule is disabled. When set to true, the network policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the network policy rule will be enabled.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region string
- The location of this resource.
- rule_
name string - An optional name for the rule. This field is not a unique identifier and can be updated.
- list(object)
- A list of secure tags that controls which instances the traffic classification rule applies to. If targetSecureTag are specified, then the traffic classification rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. Structure is documented below.
- target_
service_ list(string)accounts - A list of service accounts indicating the sets of instances that are applied with this rule.
- match
Region
Network Policy Traffic Classification Rule Match - A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- network
Policy String - The firewall policy of the resource.
- priority Integer
- An integer indicating the priority of a rule in the list. The priority must be a positive value between 1 and 2147482647. The priority values from 2147482648 to 2147483647 (1000) are reserved for system default network policy rules. Rules are evaluated from highest to lowest priority where 1 is the highest priority and 2147483647 is the lowest priority.
- action
Region
Network Policy Traffic Classification Rule Action - The Action to perform when the client connection triggers the rule. Structure is documented below.
- deletion
Policy String - Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- description String
- An optional description for this resource.
- disabled Boolean
- Denotes whether the network policy rule is disabled. When set to true, the network policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the network policy rule will be enabled.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region String
- The location of this resource.
- rule
Name String - An optional name for the rule. This field is not a unique identifier and can be updated.
-
List<Region
Network Policy Traffic Classification Rule Target Secure Tag> - A list of secure tags that controls which instances the traffic classification rule applies to. If targetSecureTag are specified, then the traffic classification rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. Structure is documented below.
- target
Service List<String>Accounts - A list of service accounts indicating the sets of instances that are applied with this rule.
- match
Region
Network Policy Traffic Classification Rule Match - A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- network
Policy string - The firewall policy of the resource.
- priority number
- An integer indicating the priority of a rule in the list. The priority must be a positive value between 1 and 2147482647. The priority values from 2147482648 to 2147483647 (1000) are reserved for system default network policy rules. Rules are evaluated from highest to lowest priority where 1 is the highest priority and 2147483647 is the lowest priority.
- action
Region
Network Policy Traffic Classification Rule Action - The Action to perform when the client connection triggers the rule. Structure is documented below.
- deletion
Policy string - Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- description string
- An optional description for this resource.
- disabled boolean
- Denotes whether the network policy rule is disabled. When set to true, the network policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the network policy rule will be enabled.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region string
- The location of this resource.
- rule
Name string - An optional name for the rule. This field is not a unique identifier and can be updated.
-
Region
Network Policy Traffic Classification Rule Target Secure Tag[] - A list of secure tags that controls which instances the traffic classification rule applies to. If targetSecureTag are specified, then the traffic classification rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. Structure is documented below.
- target
Service string[]Accounts - A list of service accounts indicating the sets of instances that are applied with this rule.
- match
Region
Network Policy Traffic Classification Rule Match Args - A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- network_
policy str - The firewall policy of the resource.
- priority int
- An integer indicating the priority of a rule in the list. The priority must be a positive value between 1 and 2147482647. The priority values from 2147482648 to 2147483647 (1000) are reserved for system default network policy rules. Rules are evaluated from highest to lowest priority where 1 is the highest priority and 2147483647 is the lowest priority.
- action
Region
Network Policy Traffic Classification Rule Action Args - The Action to perform when the client connection triggers the rule. Structure is documented below.
- deletion_
policy str - Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- description str
- An optional description for this resource.
- disabled bool
- Denotes whether the network policy rule is disabled. When set to true, the network policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the network policy rule will be enabled.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region str
- The location of this resource.
- rule_
name str - An optional name for the rule. This field is not a unique identifier and can be updated.
-
Sequence[Region
Network Policy Traffic Classification Rule Target Secure Tag Args] - A list of secure tags that controls which instances the traffic classification rule applies to. If targetSecureTag are specified, then the traffic classification rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. Structure is documented below.
- target_
service_ Sequence[str]accounts - A list of service accounts indicating the sets of instances that are applied with this rule.
- match Property Map
- A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- network
Policy String - The firewall policy of the resource.
- priority Number
- An integer indicating the priority of a rule in the list. The priority must be a positive value between 1 and 2147482647. The priority values from 2147482648 to 2147483647 (1000) are reserved for system default network policy rules. Rules are evaluated from highest to lowest priority where 1 is the highest priority and 2147483647 is the lowest priority.
- action Property Map
- The Action to perform when the client connection triggers the rule. Structure is documented below.
- deletion
Policy String - Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- description String
- An optional description for this resource.
- disabled Boolean
- Denotes whether the network policy rule is disabled. When set to true, the network policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the network policy rule will be enabled.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region String
- The location of this resource.
- rule
Name String - An optional name for the rule. This field is not a unique identifier and can be updated.
- List<Property Map>
- A list of secure tags that controls which instances the traffic classification rule applies to. If targetSecureTag are specified, then the traffic classification rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. Structure is documented below.
- target
Service List<String>Accounts - A list of service accounts indicating the sets of instances that are applied with this rule.
Outputs
All input properties are implicitly available as output properties. Additionally, the RegionNetworkPolicyTrafficClassificationRule resource produces the following output properties:
- Creation
Timestamp string - Creation timestamp in RFC3339 text format.
- Id string
- The provider-assigned unique ID for this managed resource.
- Kind string
- Type of the resource. Alwayscompute#networkPolicyTrafficClassificationRule for network policy traffic classification rules
- Rule
Tuple intCount - Calculation of the complexity of a single network policy rule.
- Creation
Timestamp string - Creation timestamp in RFC3339 text format.
- Id string
- The provider-assigned unique ID for this managed resource.
- Kind string
- Type of the resource. Alwayscompute#networkPolicyTrafficClassificationRule for network policy traffic classification rules
- Rule
Tuple intCount - Calculation of the complexity of a single network policy rule.
- creation_
timestamp string - Creation timestamp in RFC3339 text format.
- id string
- The provider-assigned unique ID for this managed resource.
- kind string
- Type of the resource. Alwayscompute#networkPolicyTrafficClassificationRule for network policy traffic classification rules
- rule_
tuple_ numbercount - Calculation of the complexity of a single network policy rule.
- creation
Timestamp String - Creation timestamp in RFC3339 text format.
- id String
- The provider-assigned unique ID for this managed resource.
- kind String
- Type of the resource. Alwayscompute#networkPolicyTrafficClassificationRule for network policy traffic classification rules
- rule
Tuple IntegerCount - Calculation of the complexity of a single network policy rule.
- creation
Timestamp string - Creation timestamp in RFC3339 text format.
- id string
- The provider-assigned unique ID for this managed resource.
- kind string
- Type of the resource. Alwayscompute#networkPolicyTrafficClassificationRule for network policy traffic classification rules
- rule
Tuple numberCount - Calculation of the complexity of a single network policy rule.
- creation_
timestamp str - Creation timestamp in RFC3339 text format.
- id str
- The provider-assigned unique ID for this managed resource.
- kind str
- Type of the resource. Alwayscompute#networkPolicyTrafficClassificationRule for network policy traffic classification rules
- rule_
tuple_ intcount - Calculation of the complexity of a single network policy rule.
- creation
Timestamp String - Creation timestamp in RFC3339 text format.
- id String
- The provider-assigned unique ID for this managed resource.
- kind String
- Type of the resource. Alwayscompute#networkPolicyTrafficClassificationRule for network policy traffic classification rules
- rule
Tuple NumberCount - Calculation of the complexity of a single network policy rule.
Look up Existing RegionNetworkPolicyTrafficClassificationRule Resource
Get an existing RegionNetworkPolicyTrafficClassificationRule 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?: RegionNetworkPolicyTrafficClassificationRuleState, opts?: CustomResourceOptions): RegionNetworkPolicyTrafficClassificationRule@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
action: Optional[RegionNetworkPolicyTrafficClassificationRuleActionArgs] = None,
creation_timestamp: Optional[str] = None,
deletion_policy: Optional[str] = None,
description: Optional[str] = None,
disabled: Optional[bool] = None,
kind: Optional[str] = None,
match: Optional[RegionNetworkPolicyTrafficClassificationRuleMatchArgs] = None,
network_policy: Optional[str] = None,
priority: Optional[int] = None,
project: Optional[str] = None,
region: Optional[str] = None,
rule_name: Optional[str] = None,
rule_tuple_count: Optional[int] = None,
target_secure_tags: Optional[Sequence[RegionNetworkPolicyTrafficClassificationRuleTargetSecureTagArgs]] = None,
target_service_accounts: Optional[Sequence[str]] = None) -> RegionNetworkPolicyTrafficClassificationRulefunc GetRegionNetworkPolicyTrafficClassificationRule(ctx *Context, name string, id IDInput, state *RegionNetworkPolicyTrafficClassificationRuleState, opts ...ResourceOption) (*RegionNetworkPolicyTrafficClassificationRule, error)public static RegionNetworkPolicyTrafficClassificationRule Get(string name, Input<string> id, RegionNetworkPolicyTrafficClassificationRuleState? state, CustomResourceOptions? opts = null)public static RegionNetworkPolicyTrafficClassificationRule get(String name, Output<String> id, RegionNetworkPolicyTrafficClassificationRuleState state, CustomResourceOptions options)resources: _: type: gcp:compute:RegionNetworkPolicyTrafficClassificationRule get: id: ${id}import {
to = gcp_compute_region_network_policy_traffic_classification_rule.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.
- Action
Region
Network Policy Traffic Classification Rule Action - The Action to perform when the client connection triggers the rule. Structure is documented below.
- Creation
Timestamp string - Creation timestamp in RFC3339 text format.
- Deletion
Policy string - Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- Description string
- An optional description for this resource.
- Disabled bool
- Denotes whether the network policy rule is disabled. When set to true, the network policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the network policy rule will be enabled.
- Kind string
- Type of the resource. Alwayscompute#networkPolicyTrafficClassificationRule for network policy traffic classification rules
- Match
Region
Network Policy Traffic Classification Rule Match - A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- Network
Policy string - The firewall policy of the resource.
- Priority int
- An integer indicating the priority of a rule in the list. The priority must be a positive value between 1 and 2147482647. The priority values from 2147482648 to 2147483647 (1000) are reserved for system default network policy rules. Rules are evaluated from highest to lowest priority where 1 is the highest priority and 2147483647 is the lowest priority.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
- The location of this resource.
- Rule
Name string - An optional name for the rule. This field is not a unique identifier and can be updated.
- Rule
Tuple intCount - Calculation of the complexity of a single network policy rule.
-
List<Region
Network Policy Traffic Classification Rule Target Secure Tag> - A list of secure tags that controls which instances the traffic classification rule applies to. If targetSecureTag are specified, then the traffic classification rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. Structure is documented below.
- Target
Service List<string>Accounts - A list of service accounts indicating the sets of instances that are applied with this rule.
- Action
Region
Network Policy Traffic Classification Rule Action Args - The Action to perform when the client connection triggers the rule. Structure is documented below.
- Creation
Timestamp string - Creation timestamp in RFC3339 text format.
- Deletion
Policy string - Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- Description string
- An optional description for this resource.
- Disabled bool
- Denotes whether the network policy rule is disabled. When set to true, the network policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the network policy rule will be enabled.
- Kind string
- Type of the resource. Alwayscompute#networkPolicyTrafficClassificationRule for network policy traffic classification rules
- Match
Region
Network Policy Traffic Classification Rule Match Args - A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- Network
Policy string - The firewall policy of the resource.
- Priority int
- An integer indicating the priority of a rule in the list. The priority must be a positive value between 1 and 2147482647. The priority values from 2147482648 to 2147483647 (1000) are reserved for system default network policy rules. Rules are evaluated from highest to lowest priority where 1 is the highest priority and 2147483647 is the lowest priority.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
- The location of this resource.
- Rule
Name string - An optional name for the rule. This field is not a unique identifier and can be updated.
- Rule
Tuple intCount - Calculation of the complexity of a single network policy rule.
-
[]Region
Network Policy Traffic Classification Rule Target Secure Tag Args - A list of secure tags that controls which instances the traffic classification rule applies to. If targetSecureTag are specified, then the traffic classification rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. Structure is documented below.
- Target
Service []stringAccounts - A list of service accounts indicating the sets of instances that are applied with this rule.
- action object
- The Action to perform when the client connection triggers the rule. Structure is documented below.
- creation_
timestamp string - Creation timestamp in RFC3339 text format.
- deletion_
policy string - Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- description string
- An optional description for this resource.
- disabled bool
- Denotes whether the network policy rule is disabled. When set to true, the network policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the network policy rule will be enabled.
- kind string
- Type of the resource. Alwayscompute#networkPolicyTrafficClassificationRule for network policy traffic classification rules
- match object
- A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- network_
policy string - The firewall policy of the resource.
- priority number
- An integer indicating the priority of a rule in the list. The priority must be a positive value between 1 and 2147482647. The priority values from 2147482648 to 2147483647 (1000) are reserved for system default network policy rules. Rules are evaluated from highest to lowest priority where 1 is the highest priority and 2147483647 is the lowest priority.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region string
- The location of this resource.
- rule_
name string - An optional name for the rule. This field is not a unique identifier and can be updated.
- rule_
tuple_ numbercount - Calculation of the complexity of a single network policy rule.
- list(object)
- A list of secure tags that controls which instances the traffic classification rule applies to. If targetSecureTag are specified, then the traffic classification rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. Structure is documented below.
- target_
service_ list(string)accounts - A list of service accounts indicating the sets of instances that are applied with this rule.
- action
Region
Network Policy Traffic Classification Rule Action - The Action to perform when the client connection triggers the rule. Structure is documented below.
- creation
Timestamp String - Creation timestamp in RFC3339 text format.
- deletion
Policy String - Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- description String
- An optional description for this resource.
- disabled Boolean
- Denotes whether the network policy rule is disabled. When set to true, the network policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the network policy rule will be enabled.
- kind String
- Type of the resource. Alwayscompute#networkPolicyTrafficClassificationRule for network policy traffic classification rules
- match
Region
Network Policy Traffic Classification Rule Match - A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- network
Policy String - The firewall policy of the resource.
- priority Integer
- An integer indicating the priority of a rule in the list. The priority must be a positive value between 1 and 2147482647. The priority values from 2147482648 to 2147483647 (1000) are reserved for system default network policy rules. Rules are evaluated from highest to lowest priority where 1 is the highest priority and 2147483647 is the lowest priority.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region String
- The location of this resource.
- rule
Name String - An optional name for the rule. This field is not a unique identifier and can be updated.
- rule
Tuple IntegerCount - Calculation of the complexity of a single network policy rule.
-
List<Region
Network Policy Traffic Classification Rule Target Secure Tag> - A list of secure tags that controls which instances the traffic classification rule applies to. If targetSecureTag are specified, then the traffic classification rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. Structure is documented below.
- target
Service List<String>Accounts - A list of service accounts indicating the sets of instances that are applied with this rule.
- action
Region
Network Policy Traffic Classification Rule Action - The Action to perform when the client connection triggers the rule. Structure is documented below.
- creation
Timestamp string - Creation timestamp in RFC3339 text format.
- deletion
Policy string - Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- description string
- An optional description for this resource.
- disabled boolean
- Denotes whether the network policy rule is disabled. When set to true, the network policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the network policy rule will be enabled.
- kind string
- Type of the resource. Alwayscompute#networkPolicyTrafficClassificationRule for network policy traffic classification rules
- match
Region
Network Policy Traffic Classification Rule Match - A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- network
Policy string - The firewall policy of the resource.
- priority number
- An integer indicating the priority of a rule in the list. The priority must be a positive value between 1 and 2147482647. The priority values from 2147482648 to 2147483647 (1000) are reserved for system default network policy rules. Rules are evaluated from highest to lowest priority where 1 is the highest priority and 2147483647 is the lowest priority.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region string
- The location of this resource.
- rule
Name string - An optional name for the rule. This field is not a unique identifier and can be updated.
- rule
Tuple numberCount - Calculation of the complexity of a single network policy rule.
-
Region
Network Policy Traffic Classification Rule Target Secure Tag[] - A list of secure tags that controls which instances the traffic classification rule applies to. If targetSecureTag are specified, then the traffic classification rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. Structure is documented below.
- target
Service string[]Accounts - A list of service accounts indicating the sets of instances that are applied with this rule.
- action
Region
Network Policy Traffic Classification Rule Action Args - The Action to perform when the client connection triggers the rule. Structure is documented below.
- creation_
timestamp str - Creation timestamp in RFC3339 text format.
- deletion_
policy str - Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- description str
- An optional description for this resource.
- disabled bool
- Denotes whether the network policy rule is disabled. When set to true, the network policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the network policy rule will be enabled.
- kind str
- Type of the resource. Alwayscompute#networkPolicyTrafficClassificationRule for network policy traffic classification rules
- match
Region
Network Policy Traffic Classification Rule Match Args - A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- network_
policy str - The firewall policy of the resource.
- priority int
- An integer indicating the priority of a rule in the list. The priority must be a positive value between 1 and 2147482647. The priority values from 2147482648 to 2147483647 (1000) are reserved for system default network policy rules. Rules are evaluated from highest to lowest priority where 1 is the highest priority and 2147483647 is the lowest priority.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region str
- The location of this resource.
- rule_
name str - An optional name for the rule. This field is not a unique identifier and can be updated.
- rule_
tuple_ intcount - Calculation of the complexity of a single network policy rule.
-
Sequence[Region
Network Policy Traffic Classification Rule Target Secure Tag Args] - A list of secure tags that controls which instances the traffic classification rule applies to. If targetSecureTag are specified, then the traffic classification rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. Structure is documented below.
- target_
service_ Sequence[str]accounts - A list of service accounts indicating the sets of instances that are applied with this rule.
- action Property Map
- The Action to perform when the client connection triggers the rule. Structure is documented below.
- creation
Timestamp String - Creation timestamp in RFC3339 text format.
- deletion
Policy String - Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
- description String
- An optional description for this resource.
- disabled Boolean
- Denotes whether the network policy rule is disabled. When set to true, the network policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the network policy rule will be enabled.
- kind String
- Type of the resource. Alwayscompute#networkPolicyTrafficClassificationRule for network policy traffic classification rules
- match Property Map
- A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- network
Policy String - The firewall policy of the resource.
- priority Number
- An integer indicating the priority of a rule in the list. The priority must be a positive value between 1 and 2147482647. The priority values from 2147482648 to 2147483647 (1000) are reserved for system default network policy rules. Rules are evaluated from highest to lowest priority where 1 is the highest priority and 2147483647 is the lowest priority.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region String
- The location of this resource.
- rule
Name String - An optional name for the rule. This field is not a unique identifier and can be updated.
- rule
Tuple NumberCount - Calculation of the complexity of a single network policy rule.
- List<Property Map>
- A list of secure tags that controls which instances the traffic classification rule applies to. If targetSecureTag are specified, then the traffic classification rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the targetSecureTag are in INEFFECTIVE state, then this rule will be ignored. targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. Structure is documented below.
- target
Service List<String>Accounts - A list of service accounts indicating the sets of instances that are applied with this rule.
Supporting Types
RegionNetworkPolicyTrafficClassificationRuleAction, RegionNetworkPolicyTrafficClassificationRuleActionArgs
- Dscp
Mode string - DSCP mode. When set to AUTO, the DSCP value will be picked automatically based on selected trafficClass. Otherwise,dscpValue needs to be explicitly specified.
Possible values are:
AUTO,CUSTOM. - Dscp
Value int - Custom DSCP value from 0-63 range.
- Traffic
Class string - The traffic class that should be applied to the matching packet.
Possible values are:
TC1,TC2,TC3,TC4,TC5,TC6. - Type string
- Always applyTrafficClassification for Traffic Classification Rules.
Default value is
applyTrafficClassification. Possible values are:applyTrafficClassification.
- Dscp
Mode string - DSCP mode. When set to AUTO, the DSCP value will be picked automatically based on selected trafficClass. Otherwise,dscpValue needs to be explicitly specified.
Possible values are:
AUTO,CUSTOM. - Dscp
Value int - Custom DSCP value from 0-63 range.
- Traffic
Class string - The traffic class that should be applied to the matching packet.
Possible values are:
TC1,TC2,TC3,TC4,TC5,TC6. - Type string
- Always applyTrafficClassification for Traffic Classification Rules.
Default value is
applyTrafficClassification. Possible values are:applyTrafficClassification.
- dscp_
mode string - DSCP mode. When set to AUTO, the DSCP value will be picked automatically based on selected trafficClass. Otherwise,dscpValue needs to be explicitly specified.
Possible values are:
AUTO,CUSTOM. - dscp_
value number - Custom DSCP value from 0-63 range.
- traffic_
class string - The traffic class that should be applied to the matching packet.
Possible values are:
TC1,TC2,TC3,TC4,TC5,TC6. - type string
- Always applyTrafficClassification for Traffic Classification Rules.
Default value is
applyTrafficClassification. Possible values are:applyTrafficClassification.
- dscp
Mode String - DSCP mode. When set to AUTO, the DSCP value will be picked automatically based on selected trafficClass. Otherwise,dscpValue needs to be explicitly specified.
Possible values are:
AUTO,CUSTOM. - dscp
Value Integer - Custom DSCP value from 0-63 range.
- traffic
Class String - The traffic class that should be applied to the matching packet.
Possible values are:
TC1,TC2,TC3,TC4,TC5,TC6. - type String
- Always applyTrafficClassification for Traffic Classification Rules.
Default value is
applyTrafficClassification. Possible values are:applyTrafficClassification.
- dscp
Mode string - DSCP mode. When set to AUTO, the DSCP value will be picked automatically based on selected trafficClass. Otherwise,dscpValue needs to be explicitly specified.
Possible values are:
AUTO,CUSTOM. - dscp
Value number - Custom DSCP value from 0-63 range.
- traffic
Class string - The traffic class that should be applied to the matching packet.
Possible values are:
TC1,TC2,TC3,TC4,TC5,TC6. - type string
- Always applyTrafficClassification for Traffic Classification Rules.
Default value is
applyTrafficClassification. Possible values are:applyTrafficClassification.
- dscp_
mode str - DSCP mode. When set to AUTO, the DSCP value will be picked automatically based on selected trafficClass. Otherwise,dscpValue needs to be explicitly specified.
Possible values are:
AUTO,CUSTOM. - dscp_
value int - Custom DSCP value from 0-63 range.
- traffic_
class str - The traffic class that should be applied to the matching packet.
Possible values are:
TC1,TC2,TC3,TC4,TC5,TC6. - type str
- Always applyTrafficClassification for Traffic Classification Rules.
Default value is
applyTrafficClassification. Possible values are:applyTrafficClassification.
- dscp
Mode String - DSCP mode. When set to AUTO, the DSCP value will be picked automatically based on selected trafficClass. Otherwise,dscpValue needs to be explicitly specified.
Possible values are:
AUTO,CUSTOM. - dscp
Value Number - Custom DSCP value from 0-63 range.
- traffic
Class String - The traffic class that should be applied to the matching packet.
Possible values are:
TC1,TC2,TC3,TC4,TC5,TC6. - type String
- Always applyTrafficClassification for Traffic Classification Rules.
Default value is
applyTrafficClassification. Possible values are:applyTrafficClassification.
RegionNetworkPolicyTrafficClassificationRuleMatch, RegionNetworkPolicyTrafficClassificationRuleMatchArgs
- Layer4Configs
List<Region
Network Policy Traffic Classification Rule Match Layer4Config> Pairs of IP protocols and ports that the rule should match. Structure is documented below.
The
layer4Configsblock supports:- Dest
Ip List<string>Ranges - CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000.
- Src
Ip List<string>Ranges - CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000.
- Layer4Configs
[]Region
Network Policy Traffic Classification Rule Match Layer4Config Pairs of IP protocols and ports that the rule should match. Structure is documented below.
The
layer4Configsblock supports:- Dest
Ip []stringRanges - CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000.
- Src
Ip []stringRanges - CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000.
- layer4_
configs list(object) Pairs of IP protocols and ports that the rule should match. Structure is documented below.
The
layer4Configsblock supports:- dest_
ip_ list(string)ranges - CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000.
- src_
ip_ list(string)ranges - CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000.
- layer4Configs
List<Region
Network Policy Traffic Classification Rule Match Layer4Config> Pairs of IP protocols and ports that the rule should match. Structure is documented below.
The
layer4Configsblock supports:- dest
Ip List<String>Ranges - CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000.
- src
Ip List<String>Ranges - CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000.
- layer4Configs
Region
Network Policy Traffic Classification Rule Match Layer4Config[] Pairs of IP protocols and ports that the rule should match. Structure is documented below.
The
layer4Configsblock supports:- dest
Ip string[]Ranges - CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000.
- src
Ip string[]Ranges - CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000.
- layer4_
configs Sequence[RegionNetwork Policy Traffic Classification Rule Match Layer4Config] Pairs of IP protocols and ports that the rule should match. Structure is documented below.
The
layer4Configsblock supports:- dest_
ip_ Sequence[str]ranges - CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000.
- src_
ip_ Sequence[str]ranges - CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000.
- layer4Configs List<Property Map>
Pairs of IP protocols and ports that the rule should match. Structure is documented below.
The
layer4Configsblock supports:- dest
Ip List<String>Ranges - CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000.
- src
Ip List<String>Ranges - CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000.
RegionNetworkPolicyTrafficClassificationRuleMatchLayer4Config, RegionNetworkPolicyTrafficClassificationRuleMatchLayer4ConfigArgs
- Ip
Protocol string - The IP protocol to which this rule applies. The protocol type is required when creating a traffic classification rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number.
- Ports List<string>
- An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
- Ip
Protocol string - The IP protocol to which this rule applies. The protocol type is required when creating a traffic classification rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number.
- Ports []string
- An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
- ip_
protocol string - The IP protocol to which this rule applies. The protocol type is required when creating a traffic classification rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number.
- ports list(string)
- An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
- ip
Protocol String - The IP protocol to which this rule applies. The protocol type is required when creating a traffic classification rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number.
- ports List<String>
- An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
- ip
Protocol string - The IP protocol to which this rule applies. The protocol type is required when creating a traffic classification rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number.
- ports string[]
- An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
- ip_
protocol str - The IP protocol to which this rule applies. The protocol type is required when creating a traffic classification rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number.
- ports Sequence[str]
- An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
- ip
Protocol String - The IP protocol to which this rule applies. The protocol type is required when creating a traffic classification rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number.
- ports List<String>
- An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
RegionNetworkPolicyTrafficClassificationRuleTargetSecureTag, RegionNetworkPolicyTrafficClassificationRuleTargetSecureTagArgs
Import
RegionNetworkPolicyTrafficClassificationRule can be imported using any of these accepted formats:
projects/{{project}}/regions/{{region}}/networkPolicies/{{network_policy}}/{{priority}}{{project}}/{{region}}/{{network_policy}}/{{priority}}{{region}}/{{network_policy}}/{{priority}}{{network_policy}}/{{priority}}
When using the pulumi import command, RegionNetworkPolicyTrafficClassificationRule can be imported using one of the formats above. For example:
$ pulumi import gcp:compute/regionNetworkPolicyTrafficClassificationRule:RegionNetworkPolicyTrafficClassificationRule default projects/{{project}}/regions/{{region}}/networkPolicies/{{network_policy}}/{{priority}}
$ pulumi import gcp:compute/regionNetworkPolicyTrafficClassificationRule:RegionNetworkPolicyTrafficClassificationRule default {{project}}/{{region}}/{{network_policy}}/{{priority}}
$ pulumi import gcp:compute/regionNetworkPolicyTrafficClassificationRule:RegionNetworkPolicyTrafficClassificationRule default {{region}}/{{network_policy}}/{{priority}}
$ pulumi import gcp:compute/regionNetworkPolicyTrafficClassificationRule:RegionNetworkPolicyTrafficClassificationRule default {{network_policy}}/{{priority}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.
published on Monday, Aug 24, 2026 by Pulumi