# NetworkPolicy

[Snowflake Documentation](https://docs.snowflake.com/en/sql-reference/sql/create-network-policy)

A Network Policy in Snowflake defines a set of network rules and IP addresses that are allowed or blocked from accessing a Snowflake account. This helps in managing network traffic and securing access based on network policies.

## Examples

### Python

```python
network_policy = NetworkPolicy(
    name="some_network_policy",
    allowed_network_rule_list=[NetworkRule(name="rule1"), NetworkRule(name="rule2")],
    blocked_network_rule_list=[NetworkRule(name="rule3")],
    allowed_ip_list=["192.168.1.1", "192.168.1.2"],
    blocked_ip_list=["10.0.0.1"],
    comment="Example network policy"
)
```

### YAML

```yaml
network_policies:
  - name: some_network_policy
    allowed_network_rule_list:
      - rule1
      - rule2
    blocked_network_rule_list:
      - rule3
    allowed_ip_list: ["192.168.1.1", "192.168.1.2"]
    blocked_ip_list: ["10.0.0.1"]
    comment: "Example network policy"
```

## Fields

* `name` (string, required) - The name of the network policy.
* `allowed_network_rule_list` (list) - A list of allowed network rules.
* `blocked_network_rule_list` (list) - A list of blocked network rules.
* `allowed_ip_list` (list) - A list of allowed IP addresses.
* `blocked_ip_list` (list) - A list of blocked IP addresses.
* `comment` (string) - A comment about the network policy.
* `owner` (string or [Role](/titan-core/resources/role.md)) - The owner role of the network policy. Defaults to "SECURITYADMIN".


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://titan-core.gitbook.io/titan-core/resources/network_policy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
