1. Packages
  2. Packages
  3. Google Cloud (GCP) Classic
  4. API Docs
  5. compute
  6. RegionNetworkPolicy
Viewing docs for Google Cloud v9.32.1
published on Wednesday, Jul 29, 2026 by Pulumi
gcp logo
Viewing docs for Google Cloud v9.32.1
published on Wednesday, Jul 29, 2026 by Pulumi

    The Compute NetworkFirewallPolicy resource

    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.

    Example Usage

    Region Network Policy Full

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const policy = new gcp.compute.RegionNetworkPolicy("policy", {
        name: "region-np-full",
        description: "Terraform network policy create test",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    policy = gcp.compute.RegionNetworkPolicy("policy",
        name="region-np-full",
        description="Terraform network policy create test")
    
    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 {
    		_, err := compute.NewRegionNetworkPolicy(ctx, "policy", &compute.RegionNetworkPolicyArgs{
    			Name:        pulumi.String("region-np-full"),
    			Description: pulumi.String("Terraform network policy create test"),
    		})
    		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 policy = new Gcp.Compute.RegionNetworkPolicy("policy", new()
        {
            Name = "region-np-full",
            Description = "Terraform network policy create test",
        });
    
    });
    
    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 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 policy = new RegionNetworkPolicy("policy", RegionNetworkPolicyArgs.builder()
                .name("region-np-full")
                .description("Terraform network policy create test")
                .build());
    
        }
    }
    
    resources:
      policy:
        type: gcp:compute:RegionNetworkPolicy
        properties:
          name: region-np-full
          description: Terraform network policy create test
    
    pulumi {
      required_providers {
        gcp = {
          source = "pulumi/gcp"
        }
      }
    }
    
    resource "gcp_compute_regionnetworkpolicy" "policy" {
      name        = "region-np-full"
      description = "Terraform network policy create test"
    }
    

    Create RegionNetworkPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new RegionNetworkPolicy(name: string, args?: RegionNetworkPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def RegionNetworkPolicy(resource_name: str,
                            args: Optional[RegionNetworkPolicyArgs] = None,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def RegionNetworkPolicy(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            deletion_policy: Optional[str] = None,
                            description: Optional[str] = None,
                            name: Optional[str] = None,
                            project: Optional[str] = None,
                            region: Optional[str] = None)
    func NewRegionNetworkPolicy(ctx *Context, name string, args *RegionNetworkPolicyArgs, opts ...ResourceOption) (*RegionNetworkPolicy, error)
    public RegionNetworkPolicy(string name, RegionNetworkPolicyArgs? args = null, CustomResourceOptions? opts = null)
    public RegionNetworkPolicy(String name, RegionNetworkPolicyArgs args)
    public RegionNetworkPolicy(String name, RegionNetworkPolicyArgs args, CustomResourceOptions options)
    
    type: gcp:compute:RegionNetworkPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "gcp_compute_region_network_policy" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args RegionNetworkPolicyArgs
    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 RegionNetworkPolicyArgs
    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 RegionNetworkPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RegionNetworkPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RegionNetworkPolicyArgs
    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 regionNetworkPolicyResource = new Gcp.Compute.RegionNetworkPolicy("regionNetworkPolicyResource", new()
    {
        DeletionPolicy = "string",
        Description = "string",
        Name = "string",
        Project = "string",
        Region = "string",
    });
    
    example, err := compute.NewRegionNetworkPolicy(ctx, "regionNetworkPolicyResource", &compute.RegionNetworkPolicyArgs{
    	DeletionPolicy: pulumi.String("string"),
    	Description:    pulumi.String("string"),
    	Name:           pulumi.String("string"),
    	Project:        pulumi.String("string"),
    	Region:         pulumi.String("string"),
    })
    
    resource "gcp_compute_region_network_policy" "regionNetworkPolicyResource" {
      lifecycle {
        create_before_destroy = true
      }
      deletion_policy = "string"
      description     = "string"
      name            = "string"
      project         = "string"
      region          = "string"
    }
    
    var regionNetworkPolicyResource = new RegionNetworkPolicy("regionNetworkPolicyResource", RegionNetworkPolicyArgs.builder()
        .deletionPolicy("string")
        .description("string")
        .name("string")
        .project("string")
        .region("string")
        .build());
    
    region_network_policy_resource = gcp.compute.RegionNetworkPolicy("regionNetworkPolicyResource",
        deletion_policy="string",
        description="string",
        name="string",
        project="string",
        region="string")
    
    const regionNetworkPolicyResource = new gcp.compute.RegionNetworkPolicy("regionNetworkPolicyResource", {
        deletionPolicy: "string",
        description: "string",
        name: "string",
        project: "string",
        region: "string",
    });
    
    type: gcp:compute:RegionNetworkPolicy
    properties:
        deletionPolicy: string
        description: string
        name: string
        project: string
        region: string
    

    RegionNetworkPolicy 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 RegionNetworkPolicy resource accepts the following input properties:

    DeletionPolicy 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 of this resource. Provide this property when you create the resource.
    Name string
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    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 region of this resource.
    DeletionPolicy 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 of this resource. Provide this property when you create the resource.
    Name string
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    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 region of this resource.
    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 of this resource. Provide this property when you create the resource.
    name string
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    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 region of this resource.
    deletionPolicy 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 of this resource. Provide this property when you create the resource.
    name String
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    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 region of this resource.
    deletionPolicy 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 of this resource. Provide this property when you create the resource.
    name string
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    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 region of this resource.
    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 of this resource. Provide this property when you create the resource.
    name str
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    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 region of this resource.
    deletionPolicy 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 of this resource. Provide this property when you create the resource.
    name String
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    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 region of this resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the RegionNetworkPolicy resource produces the following output properties:

    Associations List<RegionNetworkPolicyAssociation>
    [Output Only] A list of associations that belong to this network policy. Structure is documented below.
    CreationTimestamp string
    Creation timestamp in RFC3339 text format.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegionNetworkPolicyId string
    The unique identifier for the resource. This identifier is defined by the server.
    RuleTupleCount int
    Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.
    SelfLink string
    Server-defined URL for the resource.
    SelfLinkWithId string
    Server-defined URL for this resource with the resource id.
    Associations []RegionNetworkPolicyAssociation
    [Output Only] A list of associations that belong to this network policy. Structure is documented below.
    CreationTimestamp string
    Creation timestamp in RFC3339 text format.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegionNetworkPolicyId string
    The unique identifier for the resource. This identifier is defined by the server.
    RuleTupleCount int
    Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.
    SelfLink string
    Server-defined URL for the resource.
    SelfLinkWithId string
    Server-defined URL for this resource with the resource id.
    associations list(object)
    [Output Only] A list of associations that belong to this network policy. Structure is documented below.
    creation_timestamp string
    Creation timestamp in RFC3339 text format.
    id string
    The provider-assigned unique ID for this managed resource.
    region_network_policy_id string
    The unique identifier for the resource. This identifier is defined by the server.
    rule_tuple_count number
    Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.
    self_link string
    Server-defined URL for the resource.
    self_link_with_id string
    Server-defined URL for this resource with the resource id.
    associations List<RegionNetworkPolicyAssociation>
    [Output Only] A list of associations that belong to this network policy. Structure is documented below.
    creationTimestamp String
    Creation timestamp in RFC3339 text format.
    id String
    The provider-assigned unique ID for this managed resource.
    regionNetworkPolicyId String
    The unique identifier for the resource. This identifier is defined by the server.
    ruleTupleCount Integer
    Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.
    selfLink String
    Server-defined URL for the resource.
    selfLinkWithId String
    Server-defined URL for this resource with the resource id.
    associations RegionNetworkPolicyAssociation[]
    [Output Only] A list of associations that belong to this network policy. Structure is documented below.
    creationTimestamp string
    Creation timestamp in RFC3339 text format.
    id string
    The provider-assigned unique ID for this managed resource.
    regionNetworkPolicyId string
    The unique identifier for the resource. This identifier is defined by the server.
    ruleTupleCount number
    Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.
    selfLink string
    Server-defined URL for the resource.
    selfLinkWithId string
    Server-defined URL for this resource with the resource id.
    associations Sequence[RegionNetworkPolicyAssociation]
    [Output Only] A list of associations that belong to this network policy. Structure is documented below.
    creation_timestamp str
    Creation timestamp in RFC3339 text format.
    id str
    The provider-assigned unique ID for this managed resource.
    region_network_policy_id str
    The unique identifier for the resource. This identifier is defined by the server.
    rule_tuple_count int
    Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.
    self_link str
    Server-defined URL for the resource.
    self_link_with_id str
    Server-defined URL for this resource with the resource id.
    associations List<Property Map>
    [Output Only] A list of associations that belong to this network policy. Structure is documented below.
    creationTimestamp String
    Creation timestamp in RFC3339 text format.
    id String
    The provider-assigned unique ID for this managed resource.
    regionNetworkPolicyId String
    The unique identifier for the resource. This identifier is defined by the server.
    ruleTupleCount Number
    Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.
    selfLink String
    Server-defined URL for the resource.
    selfLinkWithId String
    Server-defined URL for this resource with the resource id.

    Look up Existing RegionNetworkPolicy Resource

    Get an existing RegionNetworkPolicy 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?: RegionNetworkPolicyState, opts?: CustomResourceOptions): RegionNetworkPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            associations: Optional[Sequence[RegionNetworkPolicyAssociationArgs]] = None,
            creation_timestamp: Optional[str] = None,
            deletion_policy: Optional[str] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            region: Optional[str] = None,
            region_network_policy_id: Optional[str] = None,
            rule_tuple_count: Optional[int] = None,
            self_link: Optional[str] = None,
            self_link_with_id: Optional[str] = None) -> RegionNetworkPolicy
    func GetRegionNetworkPolicy(ctx *Context, name string, id IDInput, state *RegionNetworkPolicyState, opts ...ResourceOption) (*RegionNetworkPolicy, error)
    public static RegionNetworkPolicy Get(string name, Input<string> id, RegionNetworkPolicyState? state, CustomResourceOptions? opts = null)
    public static RegionNetworkPolicy get(String name, Output<String> id, RegionNetworkPolicyState state, CustomResourceOptions options)
    resources:  _:    type: gcp:compute:RegionNetworkPolicy    get:      id: ${id}
    import {
      to = gcp_compute_region_network_policy.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.
    The following state arguments are supported:
    Associations List<RegionNetworkPolicyAssociation>
    [Output Only] A list of associations that belong to this network policy. Structure is documented below.
    CreationTimestamp string
    Creation timestamp in RFC3339 text format.
    DeletionPolicy 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 of this resource. Provide this property when you create the resource.
    Name string
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    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 region of this resource.
    RegionNetworkPolicyId string
    The unique identifier for the resource. This identifier is defined by the server.
    RuleTupleCount int
    Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.
    SelfLink string
    Server-defined URL for the resource.
    SelfLinkWithId string
    Server-defined URL for this resource with the resource id.
    Associations []RegionNetworkPolicyAssociationArgs
    [Output Only] A list of associations that belong to this network policy. Structure is documented below.
    CreationTimestamp string
    Creation timestamp in RFC3339 text format.
    DeletionPolicy 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 of this resource. Provide this property when you create the resource.
    Name string
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    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 region of this resource.
    RegionNetworkPolicyId string
    The unique identifier for the resource. This identifier is defined by the server.
    RuleTupleCount int
    Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.
    SelfLink string
    Server-defined URL for the resource.
    SelfLinkWithId string
    Server-defined URL for this resource with the resource id.
    associations list(object)
    [Output Only] A list of associations that belong to this network policy. 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 of this resource. Provide this property when you create the resource.
    name string
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    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 region of this resource.
    region_network_policy_id string
    The unique identifier for the resource. This identifier is defined by the server.
    rule_tuple_count number
    Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.
    self_link string
    Server-defined URL for the resource.
    self_link_with_id string
    Server-defined URL for this resource with the resource id.
    associations List<RegionNetworkPolicyAssociation>
    [Output Only] A list of associations that belong to this network policy. Structure is documented below.
    creationTimestamp String
    Creation timestamp in RFC3339 text format.
    deletionPolicy 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 of this resource. Provide this property when you create the resource.
    name String
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    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 region of this resource.
    regionNetworkPolicyId String
    The unique identifier for the resource. This identifier is defined by the server.
    ruleTupleCount Integer
    Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.
    selfLink String
    Server-defined URL for the resource.
    selfLinkWithId String
    Server-defined URL for this resource with the resource id.
    associations RegionNetworkPolicyAssociation[]
    [Output Only] A list of associations that belong to this network policy. Structure is documented below.
    creationTimestamp string
    Creation timestamp in RFC3339 text format.
    deletionPolicy 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 of this resource. Provide this property when you create the resource.
    name string
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    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 region of this resource.
    regionNetworkPolicyId string
    The unique identifier for the resource. This identifier is defined by the server.
    ruleTupleCount number
    Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.
    selfLink string
    Server-defined URL for the resource.
    selfLinkWithId string
    Server-defined URL for this resource with the resource id.
    associations Sequence[RegionNetworkPolicyAssociationArgs]
    [Output Only] A list of associations that belong to this network policy. 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 of this resource. Provide this property when you create the resource.
    name str
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    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 region of this resource.
    region_network_policy_id str
    The unique identifier for the resource. This identifier is defined by the server.
    rule_tuple_count int
    Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.
    self_link str
    Server-defined URL for the resource.
    self_link_with_id str
    Server-defined URL for this resource with the resource id.
    associations List<Property Map>
    [Output Only] A list of associations that belong to this network policy. Structure is documented below.
    creationTimestamp String
    Creation timestamp in RFC3339 text format.
    deletionPolicy 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 of this resource. Provide this property when you create the resource.
    name String
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    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 region of this resource.
    regionNetworkPolicyId String
    The unique identifier for the resource. This identifier is defined by the server.
    ruleTupleCount Number
    Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.
    selfLink String
    Server-defined URL for the resource.
    selfLinkWithId String
    Server-defined URL for this resource with the resource id.

    Supporting Types

    RegionNetworkPolicyAssociation, RegionNetworkPolicyAssociationArgs

    AttachmentTarget string
    The target that the network policy is attached to.
    Name string
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    AttachmentTarget string
    The target that the network policy is attached to.
    Name string
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    attachment_target string
    The target that the network policy is attached to.
    name string
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    attachmentTarget String
    The target that the network policy is attached to.
    name String
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    attachmentTarget string
    The target that the network policy is attached to.
    name string
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    attachment_target str
    The target that the network policy is attached to.
    name str
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    attachmentTarget String
    The target that the network policy is attached to.
    name String
    User-provided name of the Network policy. The name should be unique in the project in which the policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

    Import

    RegionNetworkPolicy can be imported using any of these accepted formats:

    • projects/{{project}}/regions/{{region}}/networkPolicies/{{name}}
    • {{project}}/{{region}}/{{name}}
    • {{region}}/{{name}}
    • {{name}}

    When using the pulumi import command, RegionNetworkPolicy can be imported using one of the formats above. For example:

    $ pulumi import gcp:compute/regionNetworkPolicy:RegionNetworkPolicy default projects/{{project}}/regions/{{region}}/networkPolicies/{{name}}
    $ pulumi import gcp:compute/regionNetworkPolicy:RegionNetworkPolicy default {{project}}/{{region}}/{{name}}
    $ pulumi import gcp:compute/regionNetworkPolicy:RegionNetworkPolicy default {{region}}/{{name}}
    $ pulumi import gcp:compute/regionNetworkPolicy:RegionNetworkPolicy default {{name}}
    

    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-beta Terraform Provider.
    gcp logo
    Viewing docs for Google Cloud v9.32.1
    published on Wednesday, Jul 29, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial