published on Saturday, Jun 6, 2026 by Formal
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:
- 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.
- 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.
- 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.
- 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 Boolean - 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 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.
- 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 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:
- 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.
- 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.
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) -> NetworkRulefunc 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.
- 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.
- 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.
- 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.
- 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 Boolean - If set to true, this Network Rule cannot be deleted.
- updated
At 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 boolean - If set to true, this Network Rule cannot be deleted.
- updated
At 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.
- 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 Boolean - If set to true, this Network Rule cannot be deleted.
- updated
At String - Last update time.
Package Details
- Repository
- formal formalco/pulumi-formal
- License
- MPL-2.0
- Notes
- This Pulumi package is based on the
formalTerraform Provider.
published on Saturday, Jun 6, 2026 by Formal