1. Packages
  2. Packages
  3. Formal Provider
  4. API Docs
  5. NetworkRule
Viewing docs for Formal v1.2.0
published on Saturday, Jun 6, 2026 by Formal
formal logo
Viewing docs for Formal v1.2.0
published on Saturday, Jun 6, 2026 by Formal

    Creating a Network Rule in Formal.

    Create NetworkRule Resource

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

    Constructor syntax

    new NetworkRule(name: string, args: NetworkRuleArgs, opts?: CustomResourceOptions);
    @overload
    def NetworkRule(resource_name: str,
                    args: NetworkRuleArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def NetworkRule(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    cel_expression: Optional[str] = None,
                    description: Optional[str] = None,
                    name: Optional[str] = None,
                    status: Optional[str] = None,
                    termination_protection: Optional[bool] = None)
    func NewNetworkRule(ctx *Context, name string, args NetworkRuleArgs, opts ...ResourceOption) (*NetworkRule, error)
    public NetworkRule(string name, NetworkRuleArgs args, CustomResourceOptions? opts = null)
    public NetworkRule(String name, NetworkRuleArgs args)
    public NetworkRule(String name, NetworkRuleArgs args, CustomResourceOptions options)
    
    type: formal:NetworkRule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "formal_networkrule" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args NetworkRuleArgs
    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 NetworkRuleArgs
    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 NetworkRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NetworkRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NetworkRuleArgs
    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 networkRuleResource = new Pulumi.NetworkRule("networkRuleResource", new()
    {
        CelExpression = "string",
        Description = "string",
        Name = "string",
        Status = "string",
        TerminationProtection = false,
    });
    
    example, err := formal.NewNetworkRule(ctx, "networkRuleResource", &formal.NetworkRuleArgs{
    	CelExpression:         pulumi.String("string"),
    	Description:           pulumi.String("string"),
    	Name:                  pulumi.String("string"),
    	Status:                pulumi.String("string"),
    	TerminationProtection: pulumi.Bool(false),
    })
    
    resource "formal_networkrule" "networkRuleResource" {
      cel_expression         = "string"
      description            = "string"
      name                   = "string"
      status                 = "string"
      termination_protection = false
    }
    
    var networkRuleResource = new NetworkRule("networkRuleResource", NetworkRuleArgs.builder()
        .celExpression("string")
        .description("string")
        .name("string")
        .status("string")
        .terminationProtection(false)
        .build());
    
    network_rule_resource = formal.NetworkRule("networkRuleResource",
        cel_expression="string",
        description="string",
        name="string",
        status="string",
        termination_protection=False)
    
    const networkRuleResource = new formal.NetworkRule("networkRuleResource", {
        celExpression: "string",
        description: "string",
        name: "string",
        status: "string",
        terminationProtection: false,
    });
    
    type: formal:NetworkRule
    properties:
        celExpression: string
        description: string
        name: string
        status: string
        terminationProtection: false
    

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

    CelExpression string
    The CEL expression describing how this Network Rule matches and routes traffic.
    Description string
    Network Rule description.
    Name string
    Network Rule name.
    Status string
    Defines the current status of the Network Rule. It can be one of the following: 'draft' or 'active'.
    TerminationProtection bool
    If set to true, this Network Rule cannot be deleted.
    CelExpression string
    The CEL expression describing how this Network Rule matches and routes traffic.
    Description string
    Network Rule description.
    Name string
    Network Rule name.
    Status string
    Defines the current status of the Network Rule. It can be one of the following: 'draft' or 'active'.
    TerminationProtection bool
    If set to true, this Network Rule cannot be deleted.
    cel_expression string
    The CEL expression describing how this Network Rule matches and routes traffic.
    description string
    Network Rule description.
    name string
    Network Rule name.
    status string
    Defines the current status of the Network Rule. It can be one of the following: 'draft' or 'active'.
    termination_protection bool
    If set to true, this Network Rule cannot be deleted.
    celExpression String
    The CEL expression describing how this Network Rule matches and routes traffic.
    description String
    Network Rule description.
    name String
    Network Rule name.
    status String
    Defines the current status of the Network Rule. It can be one of the following: 'draft' or 'active'.
    terminationProtection Boolean
    If set to true, this Network Rule cannot be deleted.
    celExpression string
    The CEL expression describing how this Network Rule matches and routes traffic.
    description string
    Network Rule description.
    name string
    Network Rule name.
    status string
    Defines the current status of the Network Rule. It can be one of the following: 'draft' or 'active'.
    terminationProtection boolean
    If set to true, this Network Rule cannot be deleted.
    cel_expression str
    The CEL expression describing how this Network Rule matches and routes traffic.
    description str
    Network Rule description.
    name str
    Network Rule name.
    status str
    Defines the current status of the Network Rule. It can be one of the following: 'draft' or 'active'.
    termination_protection bool
    If set to true, this Network Rule cannot be deleted.
    celExpression String
    The CEL expression describing how this Network Rule matches and routes traffic.
    description String
    Network Rule description.
    name String
    Network Rule name.
    status String
    Defines the current status of the Network Rule. It can be one of the following: 'draft' or 'active'.
    terminationProtection Boolean
    If set to true, this Network Rule cannot be deleted.

    Outputs

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

    CreatedAt string
    When the Network Rule was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdatedAt string
    Last update time.
    CreatedAt string
    When the Network Rule was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdatedAt string
    Last update time.
    created_at string
    When the Network Rule was created.
    id string
    The provider-assigned unique ID for this managed resource.
    updated_at string
    Last update time.
    createdAt String
    When the Network Rule was created.
    id String
    The provider-assigned unique ID for this managed resource.
    updatedAt String
    Last update time.
    createdAt string
    When the Network Rule was created.
    id string
    The provider-assigned unique ID for this managed resource.
    updatedAt string
    Last update time.
    created_at str
    When the Network Rule was created.
    id str
    The provider-assigned unique ID for this managed resource.
    updated_at str
    Last update time.
    createdAt String
    When the Network Rule was created.
    id String
    The provider-assigned unique ID for this managed resource.
    updatedAt String
    Last update time.

    Look up Existing NetworkRule Resource

    Get an existing NetworkRule 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?: NetworkRuleState, opts?: CustomResourceOptions): NetworkRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cel_expression: Optional[str] = None,
            created_at: Optional[str] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            status: Optional[str] = None,
            termination_protection: Optional[bool] = None,
            updated_at: Optional[str] = None) -> NetworkRule
    func GetNetworkRule(ctx *Context, name string, id IDInput, state *NetworkRuleState, opts ...ResourceOption) (*NetworkRule, error)
    public static NetworkRule Get(string name, Input<string> id, NetworkRuleState? state, CustomResourceOptions? opts = null)
    public static NetworkRule get(String name, Output<String> id, NetworkRuleState state, CustomResourceOptions options)
    resources:  _:    type: formal:NetworkRule    get:      id: ${id}
    import {
      to = formal_networkrule.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:
    CelExpression string
    The CEL expression describing how this Network Rule matches and routes traffic.
    CreatedAt string
    When the Network Rule was created.
    Description string
    Network Rule description.
    Name string
    Network Rule name.
    Status string
    Defines the current status of the Network Rule. It can be one of the following: 'draft' or 'active'.
    TerminationProtection bool
    If set to true, this Network Rule cannot be deleted.
    UpdatedAt string
    Last update time.
    CelExpression string
    The CEL expression describing how this Network Rule matches and routes traffic.
    CreatedAt string
    When the Network Rule was created.
    Description string
    Network Rule description.
    Name string
    Network Rule name.
    Status string
    Defines the current status of the Network Rule. It can be one of the following: 'draft' or 'active'.
    TerminationProtection bool
    If set to true, this Network Rule cannot be deleted.
    UpdatedAt string
    Last update time.
    cel_expression string
    The CEL expression describing how this Network Rule matches and routes traffic.
    created_at string
    When the Network Rule was created.
    description string
    Network Rule description.
    name string
    Network Rule name.
    status string
    Defines the current status of the Network Rule. It can be one of the following: 'draft' or 'active'.
    termination_protection bool
    If set to true, this Network Rule cannot be deleted.
    updated_at string
    Last update time.
    celExpression String
    The CEL expression describing how this Network Rule matches and routes traffic.
    createdAt String
    When the Network Rule was created.
    description String
    Network Rule description.
    name String
    Network Rule name.
    status String
    Defines the current status of the Network Rule. It can be one of the following: 'draft' or 'active'.
    terminationProtection Boolean
    If set to true, this Network Rule cannot be deleted.
    updatedAt String
    Last update time.
    celExpression string
    The CEL expression describing how this Network Rule matches and routes traffic.
    createdAt string
    When the Network Rule was created.
    description string
    Network Rule description.
    name string
    Network Rule name.
    status string
    Defines the current status of the Network Rule. It can be one of the following: 'draft' or 'active'.
    terminationProtection boolean
    If set to true, this Network Rule cannot be deleted.
    updatedAt string
    Last update time.
    cel_expression str
    The CEL expression describing how this Network Rule matches and routes traffic.
    created_at str
    When the Network Rule was created.
    description str
    Network Rule description.
    name str
    Network Rule name.
    status str
    Defines the current status of the Network Rule. It can be one of the following: 'draft' or 'active'.
    termination_protection bool
    If set to true, this Network Rule cannot be deleted.
    updated_at str
    Last update time.
    celExpression String
    The CEL expression describing how this Network Rule matches and routes traffic.
    createdAt String
    When the Network Rule was created.
    description String
    Network Rule description.
    name String
    Network Rule name.
    status String
    Defines the current status of the Network Rule. It can be one of the following: 'draft' or 'active'.
    terminationProtection Boolean
    If set to true, this Network Rule cannot be deleted.
    updatedAt String
    Last update time.

    Package Details

    Repository
    formal formalco/pulumi-formal
    License
    MPL-2.0
    Notes
    This Pulumi package is based on the formal Terraform Provider.
    formal logo
    Viewing docs for Formal v1.2.0
    published on Saturday, Jun 6, 2026 by Formal

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial