Install the module using pip
:
pip install -U sceptre-package-template-handler
or if you're using docker-dev, add
sceptre-package-template-handler
to requirements.txt
and restart docker-dev.
Create a repository variable in sceptre/config/config.yaml
:
sig_repo:
name: sig-shared-sceptre
base_url: https://github.com/sigdba/sig-shared-sceptre
In your stack configuration, use the package
template handler:
template:
type: package
name: EcsWebService
release: 5
repository: {{ sig_repo }}
Note: The template
block replaces template_path
in a Sceptre stack
configuration.
The package template handler works by downloading versioned zip files from a "repository" web site. The packages are unzipped into the Sceptre repository so that they can be retained in local version control. All packages are versioned to ensure that all changes are opt-in.
The repository
object supports the following keys:
name
- string - required - The name of the repository. This should be unique and is used to name the sub-directory oftemplates
into which packages will be installed.base_url
- string - required - The URL of the repository. In a GitHub-hosted repository, this will usually be the root page.template_zip_url_format
- string - A string which will be passed to Python's string formatter to compute the URL for a given package.- Default:
{repo.base_url}/releases/download/r{release}/{package_name}-{release}.zip
- The formatter will pass the following values:
repo
- Therepository
object itself.package_name
- Thename
value fromtemplate
.release
- Therelease
value fromtemplate
.
- Default:
All that is required to host a repository is a website in which the packages are available at consistent URLs. For an example, see sig-shared-sceptre where packages are published under releases. It also includes a GitHub workflow to automatically document and publish new releases.