Skip to content

Commit

Permalink
Document deprecation of the template_path key (#1112)
Browse files Browse the repository at this point in the history
We now have template handlers (PR #1088)
with a new `template` key in sceptre cconfig.  This means we can
deprecate the `template_path` key.
  • Loading branch information
zaro0508 committed Oct 16, 2021
1 parent 7b309ca commit 8a3eb94
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 25 deletions.
8 changes: 6 additions & 2 deletions docs/_source/docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ CloudFormation Example:

.. code-block:: yaml
template_path: generated/lambda-packaged.json
template:
path: generated/lambda-packaged.json
type: file
stack_name: cfn-lambda-example
hooks:
before_launch:
Expand All @@ -117,7 +119,9 @@ SAM Example:

.. code-block:: yaml
template_path: generated/sam-packaged.yaml
template:
path: generated/sam-packaged.yaml
type: file
stack_name: sam-example
hooks:
before_launch:
Expand Down
10 changes: 6 additions & 4 deletions docs/_source/docs/get_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,15 @@ Add the following configuration to ``config/dev/vpc.yaml``:

.. code-block:: yaml
template_path: vpc.yaml
template:
path: templates/vpc.yaml
type: file
parameters:
CidrBlock: 10.0.0.0/16
``template_path`` specifies the relative path to the CloudFormation, Python or
``template`` specifies the relative path to the CloudFormation, Python or
Jinja2 template to use to launch the Stack. Sceptre will use the ``templates``
directory as the root templates directory to base your ``template_path`` from.
directory as the root templates directory to base your ``path`` from.

``parameters`` lists the parameters which are supplied to the template
``vpc.yaml``.
Expand All @@ -134,7 +136,7 @@ You should now have a Sceptre project that looks a bit like:
..
Note: You do not need to make sure the Template and Stack config names
match, since you define the ``template_path`` in your Stack config, but it
match, since you define the ``template`` in your Stack config, but it
can be useful to keep track of what is going on.

You will also notice that we have two ``config.yaml`` files, one in ``config/``
Expand Down
12 changes: 9 additions & 3 deletions docs/_source/docs/hooks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ specified:

.. code-block:: yaml
template_path: templates/example.py
template:
path: templates/example.py
type: file
parameters:
ExampleParameter: example_value
hooks:
Expand Down Expand Up @@ -196,7 +198,9 @@ This hook can be used in a Stack config file with the following syntax:

.. code-block:: yaml
template_path: <...>
template:
path: <...>
type: <...>
hooks:
before_create:
- !custom_hook_command_name <argument> # The argument is accessible via self.argument
Expand All @@ -208,7 +212,9 @@ Assume a Sceptre `copy` hook that calls the `cp command`_:

.. code-block:: yaml
template_path: <...>
template:
path: <...>
type: <...>
hooks:
before_create:
- !copy "-r from_dir to_dir"
Expand Down
8 changes: 6 additions & 2 deletions docs/_source/docs/resolvers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ This resolver can be used in a Stack config file with the following syntax:

.. code-block:: yaml
template_path: <...>
template:
path: <...>
type: <...>
parameters:
param1: !<custom_resolver_command_name> <value> <optional-aws-profile>
Expand All @@ -221,7 +223,9 @@ Resolver arguments can be a simple string or a complex data structure.

.. code-block:: yaml
template_path: <...>
template:
path: <...>
type: <...>
parameters:
Param1: !ssm "/dev/DbPassword"
Param2: !ssm {"name": "/dev/DbPassword"}
Expand Down
12 changes: 10 additions & 2 deletions docs/_source/docs/stack_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ Sceptre treats the template as CloudFormation, Jinja2 or Python depending on
the template’s file extension. Note that the template filename may be different
from the Stack config filename.

.. warning::

This key is deprecated in favor of the `template`_ key.

template
~~~~~~~~

Expand Down Expand Up @@ -316,14 +320,18 @@ Examples

.. code-block:: yaml
template_path: templates/example.py
template:
path: templates/example.py
type: file
parameters:
param_1: value_1
param_2: value_2
.. code-block:: yaml
template_path: example.yaml
template
path: templates/example.yaml
type: file
dependencies:
- dev/vpc.yaml
hooks:
Expand Down
22 changes: 11 additions & 11 deletions docs/_source/docs/template_handlers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,10 @@ template loading mechanisms. See `Custom Template Handlers`_ for more informatio

When a ``template_path`` property is specified in the Stack config, it is wired into a ``file`` template handler by
default. This saves you from having to specify a full ``template`` block if you just want to load a file from disk.
Sceptre implements resolvers, which can be used to resolve a value of a
CloudFormation ``parameter`` or ``sceptre_user_data`` value at runtime. This is
most commonly used to chain the outputs of one Stack to the inputs of another.

Syntax:
.. warning::

.. code-block:: yaml
template:
type: s3
path: <bucket>/<key>
The ``template_path`` key is deprecated in favor of the ``template`` key.

Available Template Handlers
---------------------------
Expand All @@ -28,7 +21,7 @@ file
Loads a template from disk. Supports JSON, YAML, Jinja2 and Python files. Will be used if the ``template_path`` Stack
config property is set, for backwards compatibility reasons.

This is the default template handler type, setting the ``file`` type is option.
This is the default template handler type, setting the ``file`` type is optional.

Syntax:

Expand All @@ -45,10 +38,17 @@ Example:
template:
path: storage/bucket.yaml
.. note::

The path for the ``template_path`` property is relative to the sceptre_dir/templates directory while the path for
this template ``path`` property is relative to the current working directory.


s3
~~~~~~~~~~~~~

Downloads a template from an S3 bucket. The bucket is accessed with the same credentials that is used to run sceptre. This handler supports templates with .json, .yaml, .template, .j2 and .py extensions.
Downloads a template from an S3 bucket. The bucket is accessed with the same credentials that is used to run sceptre.
This handler supports templates with .json, .yaml, .template, .j2 and .py extensions.

Syntax:

Expand Down
4 changes: 3 additions & 1 deletion docs/_source/docs/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ Stack:

.. code-block:: yaml
template_path: dns-extras.j2
template
path: templates/dns-extras.j2
type: file
dependencies:
- prod/route53/domain-zone.yaml
parameters:
Expand Down

0 comments on commit 8a3eb94

Please sign in to comment.