Sceptre Cmd Resolver

raw JSON →
2.0.0 verified Mon Apr 27 auth: no python

A Sceptre resolver for executing generic shell commands during stack resolution. This package allows Sceptre to dynamically resolve stack parameters by running arbitrary commands. The current version is 2.0.0, with irregular releases.

pip install sceptre-cmd-resolver
error ModuleNotFoundError: No module named 'sceptre.cmd_resolver'
cause The package is not installed or you are using an old Sceptre version that doesn't include the resolver.
fix
Install the package: pip install sceptre-cmd-resolver
error ImportError: cannot import name 'CmdResolver' from 'sceptre.cmd_resolver'
cause Incorrect import path; the resolver might have been renamed.
fix
Use: from sceptre.cmd_resolver import CmdResolver
deprecated Version 2.x may not be compatible with older versions of Sceptre. Ensure Sceptre >= 2.0.0 is installed.
fix Upgrade Sceptre to at least 2.0.0.
gotcha The resolver executes arbitrary shell commands. Ensure commands are sanitized to avoid command injection.
fix Do not use user-provided input directly in the command.
gotcha The resolver does not automatically capture stderr; only stdout is returned.
fix Redirect stderr to stdout in the command (e.g., 2>&1).

Basic usage of CmdResolver.

from sceptre.cmd_resolver import CmdResolver

# Example usage in a Sceptre config
# resolver: !cmd echo hello
# This would resolve to "hello"
# The resolver can be instantiated directly for testing:
resolver = CmdResolver(command='echo hello')
result = resolver.resolve()
print(result)  # Output: hello