Skip to content

Commit

Permalink
Document YAML and JSON codecs for the file lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkza committed Jul 3, 2018
1 parent bbd14dc commit 403a6a4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Upcoming/Master

- Add JSON and YAML codecs to file lookup

## 1.3.0 (2018-05-03)

- Support for provisioning stacks in multiple accounts and regions has been added [GH-553], [GH-551]
Expand Down
29 changes: 29 additions & 0 deletions docs/lookups.rst
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,35 @@ Supported codecs:
- parameterized-b64 - the same as parameterized, with the results additionally
wrapped in { "Fn::Base64": ... } , which is what you actually need for
EC2 UserData
- json - decode the file as JSON and return the resulting object
- json-parameterized - Same as ``json``, but applying templating rules from
``parameterized`` to every object *value*. Note that object *keys* are not
modified. Example (an external PolicyDocument)::

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"some:Action"
],
"Resource": "{{MyResource}}"
}
]
}

- yaml - decode the file as YAML and return the resulting object. All strings
are returned as ``unicode`` even in Python 2.
- yaml-parameterized - Same as ``json-parameterized``, but using YAML. Example::

Version: 2012-10-17
Statement
- Effect: Allow
Action:
- "some:Action"
Resource: "{{MyResource}}"


When using parameterized-b64 for UserData, you should use a local_parameter defined
as such::
Expand Down

0 comments on commit 403a6a4

Please sign in to comment.