1. Packages
  2. Snowflake Provider
  3. API Docs
  4. NetworkRule
Snowflake v1.2.0 published on Monday, Apr 14, 2025 by Pulumi

snowflake.NetworkRule

Explore with Pulumi AI

Import

$ pulumi import snowflake:index/networkRule:NetworkRule example 'databaseName|schemaName|networkRuleName'
Copy

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,
                database: Optional[str] = None,
                mode: Optional[str] = None,
                schema: Optional[str] = None,
                type: Optional[str] = None,
                value_lists: Optional[Sequence[str]] = None,
                comment: Optional[str] = None,
                name: Optional[str] = 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: snowflake:NetworkRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. NetworkRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. NetworkRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. NetworkRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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 Snowflake.NetworkRule("networkRuleResource", new()
{
    Database = "string",
    Mode = "string",
    Schema = "string",
    Type = "string",
    ValueLists = new[]
    {
        "string",
    },
    Comment = "string",
    Name = "string",
});
Copy
example, err := snowflake.NewNetworkRule(ctx, "networkRuleResource", &snowflake.NetworkRuleArgs{
	Database: pulumi.String("string"),
	Mode:     pulumi.String("string"),
	Schema:   pulumi.String("string"),
	Type:     pulumi.String("string"),
	ValueLists: pulumi.StringArray{
		pulumi.String("string"),
	},
	Comment: pulumi.String("string"),
	Name:    pulumi.String("string"),
})
Copy
var networkRuleResource = new NetworkRule("networkRuleResource", NetworkRuleArgs.builder()
    .database("string")
    .mode("string")
    .schema("string")
    .type("string")
    .valueLists("string")
    .comment("string")
    .name("string")
    .build());
Copy
network_rule_resource = snowflake.NetworkRule("networkRuleResource",
    database="string",
    mode="string",
    schema="string",
    type="string",
    value_lists=["string"],
    comment="string",
    name="string")
Copy
const networkRuleResource = new snowflake.NetworkRule("networkRuleResource", {
    database: "string",
    mode: "string",
    schema: "string",
    type: "string",
    valueLists: ["string"],
    comment: "string",
    name: "string",
});
Copy
type: snowflake:NetworkRule
properties:
    comment: string
    database: string
    mode: string
    name: string
    schema: string
    type: string
    valueLists:
        - string
Copy

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:

Database
This property is required.
Changes to this property will trigger replacement.
string
The database in which to create the network rule.
Mode
This property is required.
Changes to this property will trigger replacement.
string
Specifies what is restricted by the network rule. Valid values are INGRESS, INTERNAL_STAGE and EGRESS; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
Schema
This property is required.
Changes to this property will trigger replacement.
string
The schema in which to create the network rule.
Type
This property is required.
Changes to this property will trigger replacement.
string
Specifies the type of network identifiers being allowed or blocked. A network rule can have only one type. Allowed values are IPV4, AWSVPCEID, AZURELINKID and HOST_PORT; allowed values are determined by the mode of the network rule; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
ValueLists This property is required. List<string>
Specifies the network identifiers that will be allowed or blocked. Valid values in the list are determined by the type of network rule, see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
Comment string
Specifies a comment for the network rule.
Name Changes to this property will trigger replacement. string
Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
Database
This property is required.
Changes to this property will trigger replacement.
string
The database in which to create the network rule.
Mode
This property is required.
Changes to this property will trigger replacement.
string
Specifies what is restricted by the network rule. Valid values are INGRESS, INTERNAL_STAGE and EGRESS; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
Schema
This property is required.
Changes to this property will trigger replacement.
string
The schema in which to create the network rule.
Type
This property is required.
Changes to this property will trigger replacement.
string
Specifies the type of network identifiers being allowed or blocked. A network rule can have only one type. Allowed values are IPV4, AWSVPCEID, AZURELINKID and HOST_PORT; allowed values are determined by the mode of the network rule; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
ValueLists This property is required. []string
Specifies the network identifiers that will be allowed or blocked. Valid values in the list are determined by the type of network rule, see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
Comment string
Specifies a comment for the network rule.
Name Changes to this property will trigger replacement. string
Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
database
This property is required.
Changes to this property will trigger replacement.
String
The database in which to create the network rule.
mode
This property is required.
Changes to this property will trigger replacement.
String
Specifies what is restricted by the network rule. Valid values are INGRESS, INTERNAL_STAGE and EGRESS; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
schema
This property is required.
Changes to this property will trigger replacement.
String
The schema in which to create the network rule.
type
This property is required.
Changes to this property will trigger replacement.
String
Specifies the type of network identifiers being allowed or blocked. A network rule can have only one type. Allowed values are IPV4, AWSVPCEID, AZURELINKID and HOST_PORT; allowed values are determined by the mode of the network rule; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
valueLists This property is required. List<String>
Specifies the network identifiers that will be allowed or blocked. Valid values in the list are determined by the type of network rule, see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
comment String
Specifies a comment for the network rule.
name Changes to this property will trigger replacement. String
Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
database
This property is required.
Changes to this property will trigger replacement.
string
The database in which to create the network rule.
mode
This property is required.
Changes to this property will trigger replacement.
string
Specifies what is restricted by the network rule. Valid values are INGRESS, INTERNAL_STAGE and EGRESS; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
schema
This property is required.
Changes to this property will trigger replacement.
string
The schema in which to create the network rule.
type
This property is required.
Changes to this property will trigger replacement.
string
Specifies the type of network identifiers being allowed or blocked. A network rule can have only one type. Allowed values are IPV4, AWSVPCEID, AZURELINKID and HOST_PORT; allowed values are determined by the mode of the network rule; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
valueLists This property is required. string[]
Specifies the network identifiers that will be allowed or blocked. Valid values in the list are determined by the type of network rule, see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
comment string
Specifies a comment for the network rule.
name Changes to this property will trigger replacement. string
Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
database
This property is required.
Changes to this property will trigger replacement.
str
The database in which to create the network rule.
mode
This property is required.
Changes to this property will trigger replacement.
str
Specifies what is restricted by the network rule. Valid values are INGRESS, INTERNAL_STAGE and EGRESS; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
schema
This property is required.
Changes to this property will trigger replacement.
str
The schema in which to create the network rule.
type
This property is required.
Changes to this property will trigger replacement.
str
Specifies the type of network identifiers being allowed or blocked. A network rule can have only one type. Allowed values are IPV4, AWSVPCEID, AZURELINKID and HOST_PORT; allowed values are determined by the mode of the network rule; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
value_lists This property is required. Sequence[str]
Specifies the network identifiers that will be allowed or blocked. Valid values in the list are determined by the type of network rule, see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
comment str
Specifies a comment for the network rule.
name Changes to this property will trigger replacement. str
Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
database
This property is required.
Changes to this property will trigger replacement.
String
The database in which to create the network rule.
mode
This property is required.
Changes to this property will trigger replacement.
String
Specifies what is restricted by the network rule. Valid values are INGRESS, INTERNAL_STAGE and EGRESS; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
schema
This property is required.
Changes to this property will trigger replacement.
String
The schema in which to create the network rule.
type
This property is required.
Changes to this property will trigger replacement.
String
Specifies the type of network identifiers being allowed or blocked. A network rule can have only one type. Allowed values are IPV4, AWSVPCEID, AZURELINKID and HOST_PORT; allowed values are determined by the mode of the network rule; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
valueLists This property is required. List<String>
Specifies the network identifiers that will be allowed or blocked. Valid values in the list are determined by the type of network rule, see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
comment String
Specifies a comment for the network rule.
name Changes to this property will trigger replacement. String
Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.

Outputs

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

FullyQualifiedName string
Fully qualified name of the resource. For more information, see object name resolution.
Id string
The provider-assigned unique ID for this managed resource.
FullyQualifiedName string
Fully qualified name of the resource. For more information, see object name resolution.
Id string
The provider-assigned unique ID for this managed resource.
fullyQualifiedName String
Fully qualified name of the resource. For more information, see object name resolution.
id String
The provider-assigned unique ID for this managed resource.
fullyQualifiedName string
Fully qualified name of the resource. For more information, see object name resolution.
id string
The provider-assigned unique ID for this managed resource.
fully_qualified_name str
Fully qualified name of the resource. For more information, see object name resolution.
id str
The provider-assigned unique ID for this managed resource.
fullyQualifiedName String
Fully qualified name of the resource. For more information, see object name resolution.
id String
The provider-assigned unique ID for this managed resource.

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,
        comment: Optional[str] = None,
        database: Optional[str] = None,
        fully_qualified_name: Optional[str] = None,
        mode: Optional[str] = None,
        name: Optional[str] = None,
        schema: Optional[str] = None,
        type: Optional[str] = None,
        value_lists: Optional[Sequence[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: snowflake:NetworkRule    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Comment string
Specifies a comment for the network rule.
Database Changes to this property will trigger replacement. string
The database in which to create the network rule.
FullyQualifiedName string
Fully qualified name of the resource. For more information, see object name resolution.
Mode Changes to this property will trigger replacement. string
Specifies what is restricted by the network rule. Valid values are INGRESS, INTERNAL_STAGE and EGRESS; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
Name Changes to this property will trigger replacement. string
Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
Schema Changes to this property will trigger replacement. string
The schema in which to create the network rule.
Type Changes to this property will trigger replacement. string
Specifies the type of network identifiers being allowed or blocked. A network rule can have only one type. Allowed values are IPV4, AWSVPCEID, AZURELINKID and HOST_PORT; allowed values are determined by the mode of the network rule; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
ValueLists List<string>
Specifies the network identifiers that will be allowed or blocked. Valid values in the list are determined by the type of network rule, see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
Comment string
Specifies a comment for the network rule.
Database Changes to this property will trigger replacement. string
The database in which to create the network rule.
FullyQualifiedName string
Fully qualified name of the resource. For more information, see object name resolution.
Mode Changes to this property will trigger replacement. string
Specifies what is restricted by the network rule. Valid values are INGRESS, INTERNAL_STAGE and EGRESS; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
Name Changes to this property will trigger replacement. string
Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
Schema Changes to this property will trigger replacement. string
The schema in which to create the network rule.
Type Changes to this property will trigger replacement. string
Specifies the type of network identifiers being allowed or blocked. A network rule can have only one type. Allowed values are IPV4, AWSVPCEID, AZURELINKID and HOST_PORT; allowed values are determined by the mode of the network rule; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
ValueLists []string
Specifies the network identifiers that will be allowed or blocked. Valid values in the list are determined by the type of network rule, see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
comment String
Specifies a comment for the network rule.
database Changes to this property will trigger replacement. String
The database in which to create the network rule.
fullyQualifiedName String
Fully qualified name of the resource. For more information, see object name resolution.
mode Changes to this property will trigger replacement. String
Specifies what is restricted by the network rule. Valid values are INGRESS, INTERNAL_STAGE and EGRESS; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
name Changes to this property will trigger replacement. String
Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
schema Changes to this property will trigger replacement. String
The schema in which to create the network rule.
type Changes to this property will trigger replacement. String
Specifies the type of network identifiers being allowed or blocked. A network rule can have only one type. Allowed values are IPV4, AWSVPCEID, AZURELINKID and HOST_PORT; allowed values are determined by the mode of the network rule; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
valueLists List<String>
Specifies the network identifiers that will be allowed or blocked. Valid values in the list are determined by the type of network rule, see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
comment string
Specifies a comment for the network rule.
database Changes to this property will trigger replacement. string
The database in which to create the network rule.
fullyQualifiedName string
Fully qualified name of the resource. For more information, see object name resolution.
mode Changes to this property will trigger replacement. string
Specifies what is restricted by the network rule. Valid values are INGRESS, INTERNAL_STAGE and EGRESS; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
name Changes to this property will trigger replacement. string
Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
schema Changes to this property will trigger replacement. string
The schema in which to create the network rule.
type Changes to this property will trigger replacement. string
Specifies the type of network identifiers being allowed or blocked. A network rule can have only one type. Allowed values are IPV4, AWSVPCEID, AZURELINKID and HOST_PORT; allowed values are determined by the mode of the network rule; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
valueLists string[]
Specifies the network identifiers that will be allowed or blocked. Valid values in the list are determined by the type of network rule, see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
comment str
Specifies a comment for the network rule.
database Changes to this property will trigger replacement. str
The database in which to create the network rule.
fully_qualified_name str
Fully qualified name of the resource. For more information, see object name resolution.
mode Changes to this property will trigger replacement. str
Specifies what is restricted by the network rule. Valid values are INGRESS, INTERNAL_STAGE and EGRESS; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
name Changes to this property will trigger replacement. str
Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
schema Changes to this property will trigger replacement. str
The schema in which to create the network rule.
type Changes to this property will trigger replacement. str
Specifies the type of network identifiers being allowed or blocked. A network rule can have only one type. Allowed values are IPV4, AWSVPCEID, AZURELINKID and HOST_PORT; allowed values are determined by the mode of the network rule; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
value_lists Sequence[str]
Specifies the network identifiers that will be allowed or blocked. Valid values in the list are determined by the type of network rule, see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
comment String
Specifies a comment for the network rule.
database Changes to this property will trigger replacement. String
The database in which to create the network rule.
fullyQualifiedName String
Fully qualified name of the resource. For more information, see object name resolution.
mode Changes to this property will trigger replacement. String
Specifies what is restricted by the network rule. Valid values are INGRESS, INTERNAL_STAGE and EGRESS; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
name Changes to this property will trigger replacement. String
Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
schema Changes to this property will trigger replacement. String
The schema in which to create the network rule.
type Changes to this property will trigger replacement. String
Specifies the type of network identifiers being allowed or blocked. A network rule can have only one type. Allowed values are IPV4, AWSVPCEID, AZURELINKID and HOST_PORT; allowed values are determined by the mode of the network rule; see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.
valueLists List<String>
Specifies the network identifiers that will be allowed or blocked. Valid values in the list are determined by the type of network rule, see https://docs.snowflake.com/en/sql-reference/sql/create-network-rule#required-parameters for details.

Package Details

Repository
Snowflake pulumi/pulumi-snowflake
License
Apache-2.0
Notes
This Pulumi package is based on the snowflake Terraform Provider.