-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into fix-scim
- Loading branch information
Showing
174 changed files
with
11,475 additions
and
2,325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
--- | ||
page_title: "snowflake_network_policies Data Source - terraform-provider-snowflake" | ||
subcategory: "" | ||
description: |- | ||
Datasource used to get details of filtered network policies. Filtering is aligned with the current possibilities for SHOW NETWORK POLICIES https://docs.snowflake.com/en/sql-reference/sql/show-network-policies query (like is supported). The results of SHOW and DESCRIBE are encapsulated in one output collection. | ||
--- | ||
|
||
!> **V1 release candidate** This resource was reworked and is a release candidate for the V1. We do not expect significant changes in it before the V1. We will welcome any feedback and adjust the resource if needed. Any errors reported will be resolved with a higher priority. We encourage checking this resource out before the V1 release. Please follow the [migration guide](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/MIGRATION_GUIDE.md#v0920--v0930) to use it. | ||
|
||
# snowflake_network_policies (Data Source) | ||
|
||
Datasource used to get details of filtered network policies. Filtering is aligned with the current possibilities for [SHOW NETWORK POLICIES](https://docs.snowflake.com/en/sql-reference/sql/show-network-policies) query (`like` is supported). The results of SHOW and DESCRIBE are encapsulated in one output collection. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
# Simple usage | ||
data "snowflake_network_policies" "simple" { | ||
} | ||
output "simple_output" { | ||
value = data.snowflake_network_policies.simple.network_policies | ||
} | ||
# Filtering (like) | ||
data "snowflake_network_policies" "like" { | ||
like = "network-policy-name" | ||
} | ||
output "like_output" { | ||
value = data.snowflake_network_policies.like.network_policies | ||
} | ||
# Without additional data (to limit the number of calls make for every found network policy) | ||
data "snowflake_network_policies" "only_show" { | ||
# with_describe is turned on by default and it calls DESCRIBE NETWORK POLICY for every network policy found and attaches its output to network_policies.*.describe_output field | ||
with_describe = false | ||
} | ||
output "only_show_output" { | ||
value = data.snowflake_network_policies.only_show.network_policies | ||
} | ||
# Ensure the number of network policies is equal to at least one element (with the use of postcondition) | ||
data "snowflake_network_policies" "assert_with_postcondition" { | ||
starts_with = "network-policy-name" | ||
lifecycle { | ||
postcondition { | ||
condition = length(self.network_policies) > 0 | ||
error_message = "there should be at least one network policy" | ||
} | ||
} | ||
} | ||
# Ensure the number of network policies is equal to at exactly one element (with the use of check block) | ||
check "network_policy_check" { | ||
data "snowflake_network_policies" "assert_with_check_block" { | ||
like = "network-policy-name" | ||
} | ||
assert { | ||
condition = length(data.snowflake_network_policies.assert_with_check_block.network_policies) == 1 | ||
error_message = "Network policies filtered by '${data.snowflake_network_policies.assert_with_check_block.like}' returned ${length(data.snowflake_network_policies.assert_with_check_block.network_policies)} network policies where one was expected" | ||
} | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Optional | ||
|
||
- `like` (String) Filters the output with **case-insensitive** pattern, with support for SQL wildcard characters (`%` and `_`). | ||
- `with_describe` (Boolean) Runs DESC NETWORK POLICY for each network policy returned by SHOW NETWORK POLICIES. The output of describe is saved to the description field. By default this value is set to true. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
- `network_policies` (List of Object) Holds the aggregated output of all network policies details queries. (see [below for nested schema](#nestedatt--network_policies)) | ||
|
||
<a id="nestedatt--network_policies"></a> | ||
### Nested Schema for `network_policies` | ||
|
||
Read-Only: | ||
|
||
- `describe_output` (List of Object) (see [below for nested schema](#nestedobjatt--network_policies--describe_output)) | ||
- `show_output` (List of Object) (see [below for nested schema](#nestedobjatt--network_policies--show_output)) | ||
|
||
<a id="nestedobjatt--network_policies--describe_output"></a> | ||
### Nested Schema for `network_policies.describe_output` | ||
|
||
Read-Only: | ||
|
||
- `allowed_ip_list` (String) | ||
- `allowed_network_rule_list` (String) | ||
- `blocked_ip_list` (String) | ||
- `blocked_network_rule_list` (String) | ||
|
||
|
||
<a id="nestedobjatt--network_policies--show_output"></a> | ||
### Nested Schema for `network_policies.show_output` | ||
|
||
Read-Only: | ||
|
||
- `comment` (String) | ||
- `created_on` (String) | ||
- `entries_in_allowed_ip_list` (Number) | ||
- `entries_in_allowed_network_rules` (Number) | ||
- `entries_in_blocked_ip_list` (Number) | ||
- `entries_in_blocked_network_rules` (Number) | ||
- `name` (String) |
Oops, something went wrong.