1. Packages
  2. Snowflake
  3. API Docs
  4. NetworkRule
Snowflake v0.55.0 published on Friday, Jun 7, 2024 by Pulumi

snowflake.NetworkRule

Explore with Pulumi AI

snowflake logo
Snowflake v0.55.0 published on Friday, Jun 7, 2024 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as snowflake from "@pulumi/snowflake";
    
    const rule = new snowflake.NetworkRule("rule", {
        name: "rule",
        database: "EXAMPLE_DB",
        schema: "EXAMPLE_SCHEMA",
        comment: "A rule.",
        type: "IPV4",
        mode: "INGRESS",
        valueLists: [
            "192.168.0.100/24",
            "29.254.123.20",
        ],
    });
    
    import pulumi
    import pulumi_snowflake as snowflake
    
    rule = snowflake.NetworkRule("rule",
        name="rule",
        database="EXAMPLE_DB",
        schema="EXAMPLE_SCHEMA",
        comment="A rule.",
        type="IPV4",
        mode="INGRESS",
        value_lists=[
            "192.168.0.100/24",
            "29.254.123.20",
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-snowflake/sdk/go/snowflake"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := snowflake.NewNetworkRule(ctx, "rule", &snowflake.NetworkRuleArgs{
    			Name:     pulumi.String("rule"),
    			Database: pulumi.String("EXAMPLE_DB"),
    			Schema:   pulumi.String("EXAMPLE_SCHEMA"),
    			Comment:  pulumi.String("A rule."),
    			Type:     pulumi.String("IPV4"),
    			Mode:     pulumi.String("INGRESS"),
    			ValueLists: pulumi.StringArray{
    				pulumi.String("192.168.0.100/24"),
    				pulumi.String("29.254.123.20"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Snowflake = Pulumi.Snowflake;
    
    return await Deployment.RunAsync(() => 
    {
        var rule = new Snowflake.NetworkRule("rule", new()
        {
            Name = "rule",
            Database = "EXAMPLE_DB",
            Schema = "EXAMPLE_SCHEMA",
            Comment = "A rule.",
            Type = "IPV4",
            Mode = "INGRESS",
            ValueLists = new[]
            {
                "192.168.0.100/24",
                "29.254.123.20",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.snowflake.NetworkRule;
    import com.pulumi.snowflake.NetworkRuleArgs;
    import java.util.List;
    import java.util.ArrayList;
    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 rule = new NetworkRule("rule", NetworkRuleArgs.builder()
                .name("rule")
                .database("EXAMPLE_DB")
                .schema("EXAMPLE_SCHEMA")
                .comment("A rule.")
                .type("IPV4")
                .mode("INGRESS")
                .valueLists(            
                    "192.168.0.100/24",
                    "29.254.123.20")
                .build());
    
        }
    }
    
    resources:
      rule:
        type: snowflake:NetworkRule
        properties:
          name: rule
          database: EXAMPLE_DB
          schema: EXAMPLE_SCHEMA
          comment: A rule.
          type: IPV4
          mode: INGRESS
          valueLists:
            - 192.168.0.100/24
            - 29.254.123.20
    

    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 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 Snowflake.NetworkRule("networkRuleResource", new()
    {
        Database = "string",
        Mode = "string",
        Schema = "string",
        Type = "string",
        ValueLists = new[]
        {
            "string",
        },
        Comment = "string",
        Name = "string",
    });
    
    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"),
    })
    
    var networkRuleResource = new NetworkRule("networkRuleResource", NetworkRuleArgs.builder()
        .database("string")
        .mode("string")
        .schema("string")
        .type("string")
        .valueLists("string")
        .comment("string")
        .name("string")
        .build());
    
    network_rule_resource = snowflake.NetworkRule("networkRuleResource",
        database="string",
        mode="string",
        schema="string",
        type="string",
        value_lists=["string"],
        comment="string",
        name="string")
    
    const networkRuleResource = new snowflake.NetworkRule("networkRuleResource", {
        database: "string",
        mode: "string",
        schema: "string",
        type: "string",
        valueLists: ["string"],
        comment: "string",
        name: "string",
    });
    
    type: snowflake:NetworkRule
    properties:
        comment: string
        database: string
        mode: string
        name: string
        schema: string
        type: string
        valueLists:
            - string
    

    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

    The NetworkRule resource accepts the following input properties:

    Database string
    The database in which to create the network rule.
    Mode 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 string
    The schema in which to create the network rule.
    Type 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.
    Name string
    Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
    Database string
    The database in which to create the network rule.
    Mode 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 string
    The schema in which to create the network rule.
    Type 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.
    Name string
    Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
    database String
    The database in which to create the network rule.
    mode 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 String
    The schema in which to create the network rule.
    type 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.
    name String
    Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
    database string
    The database in which to create the network rule.
    mode 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 string
    The schema in which to create the network rule.
    type 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.
    name string
    Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
    database str
    The database in which to create the network rule.
    mode 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 str
    The schema in which to create the network rule.
    type 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 str
    Specifies a comment for the network rule.
    name str
    Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
    database String
    The database in which to create the network rule.
    mode 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 String
    The schema in which to create the network rule.
    type 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.
    name 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:

    Id string
    The provider-assigned unique ID for this managed resource.
    QualifiedName string
    Qualified name of the network rule.
    Id string
    The provider-assigned unique ID for this managed resource.
    QualifiedName string
    Qualified name of the network rule.
    id String
    The provider-assigned unique ID for this managed resource.
    qualifiedName String
    Qualified name of the network rule.
    id string
    The provider-assigned unique ID for this managed resource.
    qualifiedName string
    Qualified name of the network rule.
    id str
    The provider-assigned unique ID for this managed resource.
    qualified_name str
    Qualified name of the network rule.
    id String
    The provider-assigned unique ID for this managed resource.
    qualifiedName String
    Qualified name of the network rule.

    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,
            mode: Optional[str] = None,
            name: Optional[str] = None,
            qualified_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)
    Resource lookup is not supported in YAML
    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:
    Comment string
    Specifies a comment for the network rule.
    Database string
    The database in which to create the network rule.
    Mode 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 string
    Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
    QualifiedName string
    Qualified name of the network rule.
    Schema string
    The schema in which to create the network rule.
    Type 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 string
    The database in which to create the network rule.
    Mode 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 string
    Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
    QualifiedName string
    Qualified name of the network rule.
    Schema string
    The schema in which to create the network rule.
    Type 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 String
    The database in which to create the network rule.
    mode 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 String
    Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
    qualifiedName String
    Qualified name of the network rule.
    schema String
    The schema in which to create the network rule.
    type 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 string
    The database in which to create the network rule.
    mode 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 string
    Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
    qualifiedName string
    Qualified name of the network rule.
    schema string
    The schema in which to create the network rule.
    type 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 str
    The database in which to create the network rule.
    mode 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 str
    Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
    qualified_name str
    Qualified name of the network rule.
    schema str
    The schema in which to create the network rule.
    type 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 String
    The database in which to create the network rule.
    mode 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 String
    Specifies the identifier for the network rule; must be unique for the database and schema in which the network rule is created.
    qualifiedName String
    Qualified name of the network rule.
    schema String
    The schema in which to create the network rule.
    type 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.

    Import

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

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Snowflake pulumi/pulumi-snowflake
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the snowflake Terraform Provider.
    snowflake logo
    Snowflake v0.55.0 published on Friday, Jun 7, 2024 by Pulumi