Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
Update docs version dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ngfgrant committed Dec 20, 2023
1 parent fee99a0 commit 190a658
Show file tree
Hide file tree
Showing 15 changed files with 147 additions and 35 deletions.
5 changes: 4 additions & 1 deletion dev/_modules/sceptre/config/reader.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ <h1>Source code for sceptre.config.reader</h1><div class="highlight"><pre>
<span class="s2">&quot;template_bucket_name&quot;</span><span class="p">:</span> <span class="n">strategies</span><span class="o">.</span><span class="n">child_wins</span><span class="p">,</span>
<span class="s2">&quot;template_key_value&quot;</span><span class="p">:</span> <span class="n">strategies</span><span class="o">.</span><span class="n">child_wins</span><span class="p">,</span>
<span class="s2">&quot;template&quot;</span><span class="p">:</span> <span class="n">strategies</span><span class="o">.</span><span class="n">child_wins</span><span class="p">,</span>
<span class="s2">&quot;template_path&quot;</span><span class="p">:</span> <span class="n">strategies</span><span class="o">.</span><span class="n">child_wins</span><span class="p">,</span>
<span class="s2">&quot;ignore&quot;</span><span class="p">:</span> <span class="n">strategies</span><span class="o">.</span><span class="n">child_wins</span><span class="p">,</span>
<span class="s2">&quot;obsolete&quot;</span><span class="p">:</span> <span class="n">strategies</span><span class="o">.</span><span class="n">child_wins</span><span class="p">,</span>
<span class="p">}</span>
Expand All @@ -268,6 +269,7 @@ <h1>Source code for sceptre.config.reader</h1><div class="highlight"><pre>
<span class="n">STACK_CONFIG_ATTRIBUTES</span> <span class="o">=</span> <span class="n">ConfigAttributes</span><span class="p">(</span>
<span class="p">{},</span>
<span class="p">{</span>
<span class="s2">&quot;template_path&quot;</span><span class="p">,</span>
<span class="s2">&quot;template&quot;</span><span class="p">,</span>
<span class="s2">&quot;dependencies&quot;</span><span class="p">,</span>
<span class="s2">&quot;hooks&quot;</span><span class="p">,</span>
Expand Down Expand Up @@ -655,7 +657,7 @@ <h1>Source code for sceptre.config.reader</h1><div class="highlight"><pre>
<span class="k">try</span><span class="p">:</span>
<span class="n">config</span> <span class="o">=</span> <span class="n">yaml</span><span class="o">.</span><span class="n">safe_load</span><span class="p">(</span><span class="n">rendered_template</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">err</span><span class="p">:</span>
<span class="n">message</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;Error parsing </span><span class="si">{</span><span class="n">abs_directory_path</span><span class="si">}{</span><span class="n">basename</span><span class="si">}</span><span class="s2">: </span><span class="se">\n</span><span class="si">{</span><span class="n">err</span><span class="si">}</span><span class="s2">&quot;</span>
<span class="n">message</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;Error parsing </span><span class="si">{</span><span class="n">abs_directory_path</span><span class="si">}{</span><span class="n">basename</span><span class="si">}</span><span class="s2">:</span><span class="se">\n</span><span class="si">{</span><span class="n">err</span><span class="si">}</span><span class="s2">&quot;</span>

<span class="k">if</span> <span class="n">logging_level</span><span class="p">()</span> <span class="o">==</span> <span class="n">logging</span><span class="o">.</span><span class="n">DEBUG</span><span class="p">:</span>
<span class="n">debug_file_path</span> <span class="o">=</span> <span class="n">write_debug_file</span><span class="p">(</span>
Expand Down Expand Up @@ -775,6 +777,7 @@ <h1>Source code for sceptre.config.reader</h1><div class="highlight"><pre>
<span class="n">stack</span> <span class="o">=</span> <span class="n">Stack</span><span class="p">(</span>
<span class="n">name</span><span class="o">=</span><span class="n">stack_name</span><span class="p">,</span>
<span class="n">project_code</span><span class="o">=</span><span class="n">config</span><span class="p">[</span><span class="s2">&quot;project_code&quot;</span><span class="p">],</span>
<span class="n">template_path</span><span class="o">=</span><span class="n">config</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;template_path&quot;</span><span class="p">),</span>
<span class="n">template_handler_config</span><span class="o">=</span><span class="n">config</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;template&quot;</span><span class="p">),</span>
<span class="n">region</span><span class="o">=</span><span class="n">config</span><span class="p">[</span><span class="s2">&quot;region&quot;</span><span class="p">],</span>
<span class="n">template_bucket_name</span><span class="o">=</span><span class="n">config</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;template_bucket_name&quot;</span><span class="p">),</span>
Expand Down
39 changes: 37 additions & 2 deletions dev/_modules/sceptre/stack.html
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ <h1>Source code for sceptre.stack</h1><div class="highlight"><pre>
<span class="kn">import</span> <span class="nn">logging</span>

<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">List</span><span class="p">,</span> <span class="n">Any</span><span class="p">,</span> <span class="n">Optional</span>
<span class="kn">from</span> <span class="nn">deprecation</span> <span class="kn">import</span> <span class="n">deprecated</span>

<span class="kn">from</span> <span class="nn">sceptre</span> <span class="kn">import</span> <span class="n">__version__</span>
<span class="kn">from</span> <span class="nn">sceptre.connection_manager</span> <span class="kn">import</span> <span class="n">ConnectionManager</span>
<span class="kn">from</span> <span class="nn">sceptre.exceptions</span> <span class="kn">import</span> <span class="n">InvalidConfigFileError</span>
<span class="kn">from</span> <span class="nn">sceptre.helpers</span> <span class="kn">import</span> <span class="p">(</span>
Expand All @@ -222,9 +225,14 @@ <h1>Source code for sceptre.stack</h1><div class="highlight"><pre>
<span class="sd"> :param project_code: A code which is prepended to the Stack names\</span>
<span class="sd"> of all Stacks built by Sceptre.</span>

<span class="sd"> :param template_path: The relative path to the CloudFormation, Jinja2,</span>
<span class="sd"> or Python template to build the Stack from. If this is filled,</span>
<span class="sd"> `template_handler_config` should not be filled. This field has been deprecated since</span>
<span class="sd"> version 4.0.0 and will be removed in version 5.0.0.</span>

<span class="sd"> :param template_handler_config: Configuration for a Template Handler that can resolve</span>
<span class="sd"> its arguments to a template string. Should contain the `type` property to specify</span>
<span class="sd"> the type of template handler to load.</span>
<span class="sd"> the type of template handler to load. Conflicts with `template_path`.</span>

<span class="sd"> :param region: The AWS region to build Stacks in.</span>

Expand Down Expand Up @@ -347,6 +355,7 @@ <h1>Source code for sceptre.stack</h1><div class="highlight"><pre>
<span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="n">project_code</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="n">region</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span>
<span class="n">template_path</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">template_handler_config</span><span class="p">:</span> <span class="nb">dict</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">template_bucket_name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">template_key_prefix</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
Expand Down Expand Up @@ -420,7 +429,15 @@ <h1>Source code for sceptre.stack</h1><div class="highlight"><pre>
<span class="n">role_arn</span><span class="p">,</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">template_bucket_name</span> <span class="o">=</span> <span class="n">template_bucket_name</span>
<span class="bp">self</span><span class="o">.</span><span class="n">template_handler_config</span> <span class="o">=</span> <span class="n">template_handler_config</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_set_field_with_deprecated_alias</span><span class="p">(</span>
<span class="s2">&quot;template_handler_config&quot;</span><span class="p">,</span>
<span class="n">template_handler_config</span><span class="p">,</span>
<span class="s2">&quot;template_path&quot;</span><span class="p">,</span>
<span class="n">template_path</span><span class="p">,</span>
<span class="n">required</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">preferred_config_name</span><span class="o">=</span><span class="s2">&quot;template&quot;</span><span class="p">,</span>
<span class="p">)</span>

<span class="bp">self</span><span class="o">.</span><span class="n">s3_details</span> <span class="o">=</span> <span class="n">s3_details</span>
<span class="bp">self</span><span class="o">.</span><span class="n">parameters</span> <span class="o">=</span> <span class="n">parameters</span> <span class="ow">or</span> <span class="p">{}</span>
<span class="bp">self</span><span class="o">.</span><span class="n">sceptre_user_data</span> <span class="o">=</span> <span class="n">sceptre_user_data</span> <span class="ow">or</span> <span class="p">{}</span>
Expand Down Expand Up @@ -478,6 +495,7 @@ <h1>Source code for sceptre.stack</h1><div class="highlight"><pre>
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">==</span> <span class="n">stack</span><span class="o">.</span><span class="n">name</span>
<span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">external_name</span> <span class="o">==</span> <span class="n">stack</span><span class="o">.</span><span class="n">external_name</span>
<span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">project_code</span> <span class="o">==</span> <span class="n">stack</span><span class="o">.</span><span class="n">project_code</span>
<span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">template_path</span> <span class="o">==</span> <span class="n">stack</span><span class="o">.</span><span class="n">template_path</span>
<span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">region</span> <span class="o">==</span> <span class="n">stack</span><span class="o">.</span><span class="n">region</span>
<span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">template_key_prefix</span> <span class="o">==</span> <span class="n">stack</span><span class="o">.</span><span class="n">template_key_prefix</span>
<span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">required_version</span> <span class="o">==</span> <span class="n">stack</span><span class="o">.</span><span class="n">required_version</span>
Expand Down Expand Up @@ -554,6 +572,23 @@ <h1>Source code for sceptre.stack</h1><div class="highlight"><pre>
<span class="p">)</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_template</span>

<span class="nd">@property</span>
<span class="nd">@deprecated</span><span class="p">(</span>
<span class="s2">&quot;4.0.0&quot;</span><span class="p">,</span> <span class="s2">&quot;5.0.0&quot;</span><span class="p">,</span> <span class="n">__version__</span><span class="p">,</span> <span class="s2">&quot;Use the template Stack Config key instead.&quot;</span>
<span class="p">)</span>
<span class="k">def</span> <span class="nf">template_path</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;The path argument from the template_handler config. This field is deprecated as of v4.0.0</span>
<span class="sd"> and will be removed in v5.0.0.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">template_handler_config</span><span class="p">[</span><span class="s2">&quot;path&quot;</span><span class="p">]</span>

<span class="nd">@template_path</span><span class="o">.</span><span class="n">setter</span>
<span class="nd">@deprecated</span><span class="p">(</span>
<span class="s2">&quot;4.0.0&quot;</span><span class="p">,</span> <span class="s2">&quot;5.0.0&quot;</span><span class="p">,</span> <span class="n">__version__</span><span class="p">,</span> <span class="s2">&quot;Use the template Stack Config key instead.&quot;</span>
<span class="p">)</span>
<span class="k">def</span> <span class="nf">template_path</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">template_handler_config</span> <span class="o">=</span> <span class="p">{</span><span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;file&quot;</span><span class="p">,</span> <span class="s2">&quot;path&quot;</span><span class="p">:</span> <span class="n">value</span><span class="p">}</span>

<span class="k">def</span> <span class="nf">_set_field_with_deprecated_alias</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span>
<span class="n">preferred_attribute_name</span><span class="p">,</span>
Expand Down
20 changes: 19 additions & 1 deletion dev/_sources/docs/stack_config.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Structure
A Stack config file is a ``yaml`` object of key-value pairs configuring a
particular Stack. The available keys are listed below.

- `template`_ *(required)*
- `template_path`_ or `template`_ *(required)*
- `dependencies`_ *(optional)*
- `hooks`_ *(optional)*
- `ignore`_ *(optional)*
Expand All @@ -34,6 +34,23 @@ particular Stack. The available keys are listed below.
- `stack_tags`_ *(optional)*
- `stack_timeout`_ *(optional)*

It is not possible to define both `template_path`_ and `template`_. If you do so,
you will receive an error when deploying the stack.

template_path
~~~~~~~~~~~~~~~~~~~~~~~~
* Resolvable: No
* Can be inherited from StackGroup: No

The path to the CloudFormation, Jinja2 or Python template to build the Stack
from. The path can either be absolute or relative to the Sceptre Directory.
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. It will be removed in version 5.0.0.

template
~~~~~~~~
Expand Down Expand Up @@ -611,6 +628,7 @@ Examples
tag_1: value_1
tag_2: value_2
.. _template_path: #template-path
.. _template: #template
.. _dependencies: #dependencies
.. _hooks: #hooks
Expand Down
7 changes: 7 additions & 0 deletions dev/_sources/docs/template_handlers.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Template handlers can be used to resolve a ``template`` config block to a CloudF
fetch templates from S3, for example. Users can create their own template handlers to easily add support for other
template loading mechanisms. See `Custom Template Handlers`_ for more information.

.. warning::

The ``template_path`` key is deprecated in favor of the ``template`` key.

Available Template Handlers
---------------------------

Expand All @@ -14,6 +18,9 @@ file
Loads a template from the local file system. This handler supports templates with .json, .yaml, .template, .j2
and .py extensions. This is the default template handler type, specifying the ``file`` type is optional.

For backwards compatability, when a ``template_path`` key is specified in the Stack config, it is wired to
use the ``file`` template handler.

Syntax:

.. code-block:: yaml
Expand Down
Loading

0 comments on commit 190a658

Please sign in to comment.