Commit Graph

62 Commits

Author SHA1 Message Date
Laura Pacilio
f83c8e1d18 Merge pull request #31011 from dleser/patch-1
Added example with function argument expansion
2022-06-28 16:50:09 -04:00
Dirk Leser
ab93ef09ec Readded the new example below the description 2022-06-17 14:42:52 +02:00
Dirk Leser
37d18f4229 functions/merge: Added expanation for example
Co-authored-by: Laura Pacilio <83350965+laurapacilio@users.noreply.github.com>
2022-06-17 14:32:02 +02:00
Alisdair McDiarmid
718b0875ef lang: Remove defaults function
Now that we are able to specify optional object attribute defaults
inline in a type constraint, the separate `defaults` function is no
longer needed.
2022-06-01 06:40:37 -04:00
Dirk Leser
707f39b440 Added example with function argument expansion
Even if the expansion with three dots is explicity mentioned in https://www.terraform.io/language/expressions/function-calls#expanding-function-arguments the additional example would have helped me a lot as it is a common use case to "flatten" a list of maps.
2022-05-06 09:28:42 +02:00
Craig Wright
e217c0c53a Merge pull request #30938 from jensenbox/patch-1
chore: Typo fix (`retuns` -> `returns`)
2022-04-26 18:32:41 -07:00
Ryoh Akiyoshi
9b4600cc23 website: Fix an example for urlencode function
The example did not reflect the actual behavior of escaping spaces.
2022-04-26 17:38:47 -07:00
Christian Jensen
85a081bd2a chore: Typo fix
Fix a mispelled word.
2022-04-26 15:56:32 -07:00
george-mengelberg
d7316e79ca Description of '-' symbol as used in format()
The existing description for the '-' symbol as use in format() stated that the result would padded spaces to the left.  When tested in via 'terraform console' using format("%-10.1f", 3) the result was "3.0       "

Terraform v1.1.7
2022-03-26 08:26:44 -07:00
Loek Duys
c6fa1e70ef Update toset.mdx
Fix output in `toset`
```
toset(["a", "b", 3])
toset([
  "3",
  "a",
  "b",
])
```

This is the actual output from the tf console, using Terraform v1.1.5 on windows_amd64
2022-03-15 13:48:14 +01:00
Laura Pacilio
68e70d71d4 Merge pull request #30483 from bpar476/patch-1
Adds documentation to `substr` function to cover when `length` exceeds input length
2022-02-15 11:27:47 -05:00
Ben Partridge
252865c6a0 Improvements to wording of substr function documentation
Co-authored-by: Laura Pacilio <83350965+laurapacilio@users.noreply.github.com>
2022-02-15 10:23:37 +11:00
Alisdair McDiarmid
98f80bc5da website: Explain limitations of type function 2022-02-10 06:12:58 -05:00
Ben Partridge
fa8a87fab5 Adds documentation to substr function to cover when length longer than input string
The `substr` function allows the `length` parameter to be longer than the remaining characters in the input after the offset. This is useful for when you want to truncate a string to a maximum number of characters. However, the documentation isn't clear on this so I had to do a test deployment to confirm the behaviour after finding the behaviour in an old issue https://github.com/hashicorp/terraform/issues/15751
2022-02-07 15:12:22 +11:00
GiannakopoulosJ
13907690a2 Typo in zipmap documentation
zipmap does not produce a map with comma in terraform cli
tested with Terraform v1.1.3
2022-01-19 16:02:24 +02:00
Martin Atkins
e35c25da44 website: Try function documentation "provably" vs "probably" typo
This paragraph is trying to say that try only works for dynamic errors and
not for errors that are _not_ based on dynamic decision-making in
expressions.

I'm not sure if this typo was always here or if it was mistakenly "corrected"
at some point, but either way the word "probably" changes the meaning
of this sentence entirely, making it seem like Terraform is hedging
the likelihood of a problem rather than checking exactly for one.
2021-12-22 12:10:07 -08:00
Dylan Staley
21cbb5b392 migrate docs to mdx 2021-12-14 18:41:17 -08:00
Dylan Staley
0e48f58688 Revert "migrate docs to mdx"
This reverts commit 3cb12b5a52.
2021-11-22 15:57:25 -08:00
Dylan Staley
3cb12b5a52 migrate docs to mdx 2021-11-22 15:47:36 -08:00
Laura Pacilio
bd64d07e6b Apply suggestions from code review 2021-11-15 10:49:37 -05:00
Laura Pacilio
b838a93023 Add cidr block output example to setproduct function page 2021-11-05 10:51:59 -04:00
Krista LaFentres
1f08f7dba8 Clarify the way the trim() function works and add some more examples 2021-10-25 14:13:15 -05:00
Laura Pacilio
73a3bb2702 Merge pull request #28334 from paultyng/patch-1
Add null to type conversion docs
2021-09-02 14:47:38 -04:00
Laura Pacilio
03849d850a Merge pull request #28486 from joshschmitter/patch-1
setsubtract doc: use "Relative Complement" correctly
2021-08-23 15:49:51 -04:00
joshschmitter
cb41b158f1 concise use of "relative complement"
Co-authored-by: Laura Pacilio <83350965+laurapacilio@users.noreply.github.com>
2021-08-23 14:40:35 -05:00
Laura Pacilio
d427c81a89 Update jsonencode minified note 2021-08-23 15:01:38 -04:00
Laura Pacilio
dffb8b4a16 Merge pull request #29088 from brenthc/minify_jsonencode
note that output of jsonencode is minified
2021-08-23 14:24:37 -04:00
Brent Woodruff
ed84cb886e Apply suggested wording update. 2021-08-23 14:10:50 -04:00
Laura Pacilio
5863af448f Merge pull request #28784 from TAYTS/patch-2
Update range.html.md
2021-08-23 14:07:15 -04:00
Laura Pacilio
d0bc382797 Merge pull request #29359 from 45deg/45deg-patch-1
Fix a result in examples for urlencode.html.md
2021-08-23 13:57:27 -04:00
Laura Pacilio
e1b702b8d0 Merge pull request #29417 from jonesetc/patch-1
Fix link to index function
2021-08-18 18:24:54 -04:00
Laura Pacilio
b574c03dd1 Merge pull request #29271 from kebroad/patch-1
Fixed cidrhost() example 1 and 2 with correct function parameter
2021-08-18 18:22:06 -04:00
Kyle Jones
e4e5f5a1a4 Fix link to index function
The element function page previously linked to the index page for all functions where it meant to link to the index function page.
2021-08-18 15:08:19 -07:00
Martin Atkins
c23a7fce4e lang/funcs: Preserve IP address leading zero behavior from Go 1.16
Go 1.17 includes a breaking change to both net.ParseIP and net.ParseCIDR
functions to reject IPv4 address octets written with leading zeros.

Our use of these functions as part of the various CIDR functions in the
Terraform language doesn't have the same security concerns that the Go
team had in evaluating this change to the standard library, and so we
can't justify an exception to our v1.0 compatibility promises on the same
sort of security grounds that the Go team used to justify their
compatibility exception.

For that reason, we'll now use our own fork of the Go library functions
which has the new check disabled in order to preserve the prior behavior.
We're taking this path, rather than pre-normalizing the IP address before
calling into the standard library, because an additional normalization
layer would be entirely new code and additional complexity, whereas this
fork is relatively minor in terms of code size and avoids any significant
changes to our own calls to these functions.

Thanks to the Kubernetes team for their prior work on carving out a subset
of the "net" package for their similar backward-compatibility concern.
Our "ipaddr" package here is a lightly-modified fork of their fork, with
only the comments changed to talk about Terraform instead of Kubernetes.

This fork is not intended for use in any other future feature
implementations, because they wouldn't be subject to the same
compatibility constraints as our existing functions. We will use these
forked implementations for new callers only if consistency with the
behavior of the existing functions is a key requirement.
2021-08-17 15:20:05 -07:00
45deg
494043ed24 Fix a result in examples for urlencode.html.md 2021-08-12 13:47:27 +09:00
Kevin Broadbridge
f5cbe59386 Fixed cidrhost example 1 and 2 with correct function parameter 2021-07-29 16:30:18 -05:00
Laura Pacilio
06a2fdcf9d Merge branch 'main' into description-metadata-language-docs 2021-07-21 16:24:59 -04:00
Laura Pacilio
a780f625e9 Fix metadata description format on all pages 2021-07-19 12:11:10 -04:00
Kristin Laemmert
563f1436eb various docs updates (#29018)
* website/docs: add sensitivity warning to output documentation

fixes #28005

* website/docs: add note about ** to fileset documentation

closes #24220

* website/docs: add note that `dynamic` expressions aren't included in json config output

closes #28346

* website: the provider installer isn't necessarily concurrency safe

closes #28367
2021-07-15 12:22:17 -04:00
Laura Pacilio
bc9065334e Update description metadata per PR feedback 2021-07-14 16:54:26 -04:00
Laura Pacilio
952cb33103 Add description metadata to functions overview page 2021-07-09 15:42:58 -04:00
Brent Woodruff
3a66236c14 note that output of jsonencode is minified 2021-07-02 15:36:47 -04:00
Laura Pacilio
577c3653f2 Merge pull request #28983 from KurtLehnardt/patch-1
fixed typo
2021-06-30 08:54:04 -04:00
Laura Pacilio
de97a03528 Merge pull request #28908 from kondr57/patch-1
fix typo
2021-06-30 08:43:26 -04:00
Radek Simko
bb868606ea docs: Document naming conventions for templates & backend configs (#28924)
* docs: Document naming conventions for templates & backend configs

* Update website/docs/cli/config/config-file.html.md

Co-authored-by: Alisdair McDiarmid <alisdair@users.noreply.github.com>

* Update website/docs/language/functions/templatefile.html.md

Co-authored-by: Alisdair McDiarmid <alisdair@users.noreply.github.com>

Co-authored-by: Alisdair McDiarmid <alisdair@users.noreply.github.com>
2021-06-18 17:20:00 +01:00
Kurt Lehnardt
165b2a2509 fixed typo 2021-06-18 09:59:56 -06:00
Kristin Laemmert
9ca3cb4233 website/docs: move type func docs to a useful location (#28940)
* website/docs: move type func docs to a useful location

* docs don't exist if you don't put them in the index (again)
2021-06-14 08:54:27 -04:00
Vladimir Kondratiev
58a5207dc4 fix typo 2021-06-09 13:13:08 +03:00
TAY TS
511011335a Update range.html.md
Fix the condition in the negative direction range pseudo code
2021-05-23 09:43:38 +08:00
James Bardin
760a59b3a7 negative substring 2021-05-18 16:04:47 -04:00