From 1f9f7d400b9e0adccaaedd730b884baeb0f2d89c Mon Sep 17 00:00:00 2001 From: Matt Schuchard Date: Wed, 25 Oct 2023 17:28:42 -0400 Subject: [PATCH] preparing v1.1.1 release --- CHANGELOG.md | 2 +- docs/data-sources/equal_map.md | 7 +++---- docs/data-sources/flatten_map.md | 5 ++--- docs/data-sources/has_key.md | 8 +++----- docs/data-sources/has_keys.md | 32 +++++++++++++++++++++++++------- docs/data-sources/has_value.md | 8 +++----- docs/data-sources/has_values.md | 32 +++++++++++++++++++++++++------- docs/data-sources/key_delete.md | 5 ++--- docs/data-sources/keys_delete.md | 5 ++--- docs/data-sources/last_char.md | 8 +++----- 10 files changed, 69 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7baa728..c0c3a7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 1.1.1 (Next) +### 1.1.1 - Add `all` parameter to `has_keys` and `has_values`. ### 1.1.0 diff --git a/docs/data-sources/equal_map.md b/docs/data-sources/equal_map.md index 853c44a..5091afb 100644 --- a/docs/data-sources/equal_map.md +++ b/docs/data-sources/equal_map.md @@ -14,20 +14,18 @@ Return whether the two input map parameters contain the same key-value pairs (eq ```terraform # Reports whether the two maps contain the same key/value pairs. -# {"hello" = "world"}, {"hello" = "world"} -# => true data "stdlib_equal_map" "foo" { map_one = { "hello" = "world" } map_two = { "hello" = "world" } } +# => true # Reports whether the two maps contain the same key/value pairs. -# {"hello" = "world"}, {"foo" = "bar"} -# => false data "stdlib_equal_map" "bar" { map_one = { "hello" = "world" } map_two = { "foo" = "bar" } } +# => false ``` @@ -40,4 +38,5 @@ data "stdlib_equal_map" "bar" { ### Read-Only +- `id` (String) Aliased to string input parameter(s) for efficiency and proper plan diff detection. - `result` (Boolean) Function result storing whether the two maps are equal. diff --git a/docs/data-sources/flatten_map.md b/docs/data-sources/flatten_map.md index a287d3a..8f4822e 100644 --- a/docs/data-sources/flatten_map.md +++ b/docs/data-sources/flatten_map.md @@ -14,14 +14,13 @@ Return the flattened map of an input list of maps parameter. Note that if a key ```terraform # Flatten a list(map) into map: -# [{"hello" = "world"}, {"foo" = "bar"}] -# => {"hello" = "world", "foo = "bar} data "stdlib_flatten_map" "foo" { param = [ { "hello" = "world" }, { "foo" = "bar" } ] } +# => {"hello" = "world", "foo = "bar} ``` @@ -33,5 +32,5 @@ data "stdlib_flatten_map" "foo" { ### Read-Only -- `id` (String) Aliased to string input parameter for efficiency. +- `id` (String) Aliased to string input parameter(s) for efficiency and proper plan diff detection. - `result` (Map of String) Function result storing the flattened map. diff --git a/docs/data-sources/has_key.md b/docs/data-sources/has_key.md index e47c870..114aa05 100644 --- a/docs/data-sources/has_key.md +++ b/docs/data-sources/has_key.md @@ -14,8 +14,6 @@ Return whether the input key parameter is present in the input map parameter. Th ```terraform # Check existence of "foo" key in map: -# {"hello" = "world", "foo" = "bar"}, "foo" -# => true data "stdlib_has_key" "foo" { map = { "hello" = "world", @@ -23,10 +21,9 @@ data "stdlib_has_key" "foo" { } key = "foo" } +# => true # Check existence of "bar" key in map: -# {"hello" = "world", "foo" = "bar"}, "bar" -# => false data "stdlib_has_key" "bar" { map = { "hello" = "world", @@ -34,6 +31,7 @@ data "stdlib_has_key" "bar" { } key = "bar" } +# => false ``` @@ -46,5 +44,5 @@ data "stdlib_has_key" "bar" { ### Read-Only -- `id` (String) Aliased to string input parameter for efficiency. +- `id` (String) Aliased to string input parameter(s) for efficiency and proper plan diff detection. - `result` (Boolean) Function result storing whether the key exists in the map. diff --git a/docs/data-sources/has_keys.md b/docs/data-sources/has_keys.md index b9468bb..2e2c3ee 100644 --- a/docs/data-sources/has_keys.md +++ b/docs/data-sources/has_keys.md @@ -3,19 +3,17 @@ page_title: "stdlib_has_keys Data Source - stdlib" subcategory: "" description: |- - Return whether any of the input keys parameter are present in the input map parameter. The input map must be single-level. + Return whether any or all of the input key parameters are present in the input map parameter. The input map must be single-level. --- # stdlib_has_keys (Data Source) -Return whether any of the input keys parameter are present in the input map parameter. The input map must be single-level. +Return whether any or all of the input key parameters are present in the input map parameter. The input map must be single-level. ## Example Usage ```terraform # Check existence of either "bar" or "foo" keys in map: -# {"hello" = "world", "foo" = "bar", "baz" = "bat"}, ["bar", "foo"] -# => true data "stdlib_has_keys" "bar_foo" { map = { "hello" = "world", @@ -24,10 +22,9 @@ data "stdlib_has_keys" "bar_foo" { } keys = ["bar", "foo"] } +# => true # Check existence of either "bar" or "pizza" keys in map: -# {"hello" = "world", "foo" = "bar", "baz" = "bat"}, ["bar", "pizza"] -# => false data "stdlib_has_keys" "bar_pizza" { map = { "hello" = "world", @@ -36,6 +33,23 @@ data "stdlib_has_keys" "bar_pizza" { } keys = ["bar", "pizza"] } +# => false + +# Check existence of "bar" and "foo" keys in map: +data "stdlib_has_keys" "bar_foo_all" { + map = { "hello" = "world", "foo" = "bar", "baz" = "bat" } + keys = ["bar", "foo"] + all = true +} +# => false + +# Check existence of "hello", "foo", and "baz" keys in map: +data "stdlib_has_keys" "three_keys_all" { + map = { "hello" = "world", "foo" = "bar", "baz" = "bat" } + keys = ["hello", "foo", "baz"] + all = true +} +# => true ``` @@ -46,7 +60,11 @@ data "stdlib_has_keys" "bar_pizza" { - `keys` (List of String) Names of the keys to check for existence in the map. - `map` (Map of String) Input map parameter from which to check a key's existence. +### Optional + +- `all` (Boolean) Whether to check for all of the keys instead of the default any of the keys. + ### Read-Only -- `id` (String) Aliased to string input parameter for efficiency. +- `id` (String) Aliased to string input parameter(s) for efficiency and proper plan diff detection. - `result` (Boolean) Function result storing whether the key exists in the map. diff --git a/docs/data-sources/has_value.md b/docs/data-sources/has_value.md index 84db151..132486c 100644 --- a/docs/data-sources/has_value.md +++ b/docs/data-sources/has_value.md @@ -14,8 +14,6 @@ Return whether the input key parameter is present in the input map parameter. Th ```terraform # Check existence of "foo" value in map: -# {"hello" = "world", "foo" = "bar"}, "foo" -# => false data "stdlib_has_value" "foo" { map = { "hello" = "world", @@ -23,10 +21,9 @@ data "stdlib_has_value" "foo" { } value = "foo" } +# => false # Check existence of "bar" value in map: -# {"hello" = "world", "foo" = "bar"}, "bar" -# => true data "stdlib_has_value" "bar" { map = { "hello" = "world", @@ -34,6 +31,7 @@ data "stdlib_has_value" "bar" { } value = "bar" } +# => true ``` @@ -46,5 +44,5 @@ data "stdlib_has_value" "bar" { ### Read-Only -- `id` (String) Aliased to string input parameter for efficiency. +- `id` (String) Aliased to string input parameter(s) for efficiency and proper plan diff detection. - `result` (Boolean) Function result storing whether the key exists in the map. diff --git a/docs/data-sources/has_values.md b/docs/data-sources/has_values.md index 3ed278a..15987ce 100644 --- a/docs/data-sources/has_values.md +++ b/docs/data-sources/has_values.md @@ -3,19 +3,17 @@ page_title: "stdlib_has_values Data Source - stdlib" subcategory: "" description: |- - Return whether the input key parameter is present in the input map parameter. The input map must be single-level. + Return whether any or all of the input value parameters are present in the input map parameter. The input map must be single-level. --- # stdlib_has_values (Data Source) -Return whether the input key parameter is present in the input map parameter. The input map must be single-level. +Return whether any or all of the input value parameters are present in the input map parameter. The input map must be single-level. ## Example Usage ```terraform # Check existence of either "foo" or "bar" values in map: -# {"hello" = "world", "foo" = "bar", "baz" = "bat"}, ["foo", "bar"] -# => true data "stdlib_has_keys" "foo_bar" { map = { "hello" = "world", @@ -24,10 +22,9 @@ data "stdlib_has_keys" "foo_bar" { } keys = ["foo", "bar"] } +# => true # Check existence of either "foo" or "pizza" keys in map: -# {"hello" = "world", "foo" = "bar", "baz" = "bat"}, ["foo", "pizza"] -# => false data "stdlib_has_keys" "foo_pizza" { map = { "hello" = "world", @@ -36,6 +33,23 @@ data "stdlib_has_keys" "foo_pizza" { } keys = ["foo", "pizza"] } +# => false + +# Check existence of "foo" and "bar" values in map: +data "stdlib_has_values" "foo_bar_all" { + map = { "hello" = "world", "foo" = "bar", "baz" = "bat" } + values = ["foo", "bar"] + all = true +} +# => false + +# Check existence of "hello", "bar", and "bat" values in map: +data "stdlib_has_values" "three_values_all" { + map = { "hello" = "world", "foo" = "bar", "baz" = "bat" } + values = ["world", "bar", "bat"] + all = true +} +# => true ``` @@ -46,7 +60,11 @@ data "stdlib_has_keys" "foo_pizza" { - `map` (Map of String) Input map parameter from which to check a value's existence. - `values` (List of String) Names of the values to check for existence in the map. +### Optional + +- `all` (Boolean) Whether to check for all of the values instead of the default any of the values. + ### Read-Only -- `id` (String) Aliased to string input parameter for efficiency. +- `id` (String) Aliased to string input parameter(s) for efficiency and proper plan diff detection. - `result` (Boolean) Function result storing whether the key exists in the map. diff --git a/docs/data-sources/key_delete.md b/docs/data-sources/key_delete.md index 0e5d7bb..a8471ac 100644 --- a/docs/data-sources/key_delete.md +++ b/docs/data-sources/key_delete.md @@ -14,8 +14,6 @@ Return the input map parameter with the key parameter deleted from the map. ```terraform # Remove the "foo" key from a map: -# {"hello" = "world", "foo" = "bar"}, "foo" -# => {"hello" = "world"} data "stdlib_key_delete" "foo" { map = { "hello" = "world", @@ -23,6 +21,7 @@ data "stdlib_key_delete" "foo" { } key = "foo" } +# => {"hello" = "world"} ``` @@ -35,5 +34,5 @@ data "stdlib_key_delete" "foo" { ### Read-Only -- `id` (String) Aliased to string input parameter for efficiency. +- `id` (String) Aliased to string input parameter(s) for efficiency and proper plan diff detection. - `result` (Map of String) Function result storing the map with the key removed. diff --git a/docs/data-sources/keys_delete.md b/docs/data-sources/keys_delete.md index cdb45f6..eb6d92e 100644 --- a/docs/data-sources/keys_delete.md +++ b/docs/data-sources/keys_delete.md @@ -14,8 +14,6 @@ Return the input map parameter with the key parameter deleted from the map. ```terraform # Remove the "foo" and "baz" keys from a map: -# {"hello" = "world", "foo" = "bar", "baz" => "bat"}, ["foo", "baz"] -# => {"hello" = "world"} data "stdlib_keys_delete" "foo" { map = { "hello" = "world", @@ -24,6 +22,7 @@ data "stdlib_keys_delete" "foo" { } keys = ["foo", "baz"] } +# => {"hello" = "world"} ``` @@ -36,5 +35,5 @@ data "stdlib_keys_delete" "foo" { ### Read-Only -- `id` (String) Aliased to string input parameter for efficiency. +- `id` (String) Aliased to string input parameter(s) for efficiency and proper plan diff detection. - `result` (Map of String) Function result storing the map with the key removed. diff --git a/docs/data-sources/last_char.md b/docs/data-sources/last_char.md index 7337a63..1ccadfa 100644 --- a/docs/data-sources/last_char.md +++ b/docs/data-sources/last_char.md @@ -14,19 +14,17 @@ Return the last character(s) of an input string parameter. ```terraform # Return the last character of a string; -# "hello" -# => "o" data "stdlib_last_char" "hello" { param = "hello" } +# => "o" # Return the last three characters of a string: -# "hello", 3 -# => "llo" data "stdlib_last_char" "llo" { param = "hello" num_chars = 3 } +# => "llo" ``` @@ -42,5 +40,5 @@ data "stdlib_last_char" "llo" { ### Read-Only -- `id` (String) Aliased to string input parameter for efficiency. +- `id` (String) Aliased to string input parameter(s) for efficiency and proper plan diff detection. - `result` (String) Function result storing the last character of the input string.