Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@catch_exceptions
def list_change_sets(ctx, path):
"""
List change sets for stack.
\f
:param path: Path to execute the command on.
:type path: str
"""
context = SceptreContext(
command_path=path,
project_path=ctx.obj.get("project_path"),
user_variables=ctx.obj.get("user_variables"),
output_format=ctx.obj.get("output_format"),
options=ctx.obj.get("options"),
ignore_dependencies=ctx.obj.get("ignore_dependencies")
)
@catch_exceptions
def create_command(ctx, path, change_set_name, yes):
"""
Creates a stack for a given config PATH. Or if CHANGE_SET_NAME is specified
creates a change set for stack in PATH.
\f
:param path: Path to a Stack or StackGroup
:type path: str
:param change_set_name: A name of the Change Set - optional
:type change_set_name: str
:param yes: A flag to assume yes to all questions.
:type yes: bool
"""
context = SceptreContext(
command_path=path,
project_path=ctx.obj.get("project_path"),
@catch_exceptions
def generate_command(ctx, path):
"""
Prints the template used for stack in PATH.
\f
:param path: Path to execute the command on.
:type path: str
"""
context = SceptreContext(
command_path=path,
project_path=ctx.obj.get("project_path"),
user_variables=ctx.obj.get("user_variables"),
options=ctx.obj.get("options"),
output_format=ctx.obj.get("output_format"),
ignore_dependencies=ctx.obj.get("ignore_dependencies")
)
@catch_exceptions
def delete_command(ctx, path, change_set_name, yes):
"""
Deletes a stack for a given config PATH. Or if CHANGE_SET_NAME is specified
deletes a change set for stack in PATH.
\f
:param path: Path to execute command on.
:type path: str
:param change_set_name: The name of the change set to use - optional
:type change_set_name: str
:param yes: Flag to answer yes to all CLI questions.
:type yes: bool
"""
context = SceptreContext(
command_path=path,
project_path=ctx.obj.get("project_path"),
@catch_exceptions
def describe_change_set(ctx, path, change_set_name, verbose):
"""
Describes the change set.
\f
:param path: Path to execute the command on.
:type path: str
:param change_set_name: Name of the Change Set to use.
:type change_set_name: str
:param verbose: A flag to display verbose output.
:type verbose: bool
"""
context = SceptreContext(
command_path=path,
project_path=ctx.obj.get("project_path"),
user_variables=ctx.obj.get("user_variables"),
@catch_exceptions
def estimate_cost_command(ctx, path):
"""
Prints a URI to STOUT that provides an estimated cost based on the
resources in the stack. This command will also attempt to open a web
browser with the returned URI.
\f
:param path: Path to execute the command on.
:type path: str
"""
context = SceptreContext(
command_path=path,
project_path=ctx.obj.get("project_path"),
user_variables=ctx.obj.get("user_variables"),
options=ctx.obj.get("options"),
output_format=ctx.obj.get("output_format"),
@catch_exceptions
@click.pass_context
def new_stack_group(ctx, stack_group):
"""
Creates StackGroup folder in the project and a config.yaml with any
required properties.
\f
:param stack_group: Name of the StackGroup directory to create.
:type stack_group: str
"""
cwd = ctx.obj.get("project_path")
for item in os.listdir(cwd):
# If already a config folder create a sub stack_group
if os.path.isdir(item) and item == "config":
config_dir = os.path.join(os.getcwd(), "config")
_create_new_stack_group(config_dir, stack_group)
@catch_exceptions
def describe_policy(ctx, path):
"""
Displays the stack policy used.
\f
:param path: Path to execute the command on.
:type path: str
"""
context = SceptreContext(
command_path=path,
project_path=ctx.obj.get("project_path"),
user_variables=ctx.obj.get("user_variables"),
options=ctx.obj.get("options"),
output_format=ctx.obj.get("output_format"),
no_colour=ctx.obj.get("no_colour"),
ignore_dependencies=ctx.obj.get("ignore_dependencies")
@catch_exceptions
def list_outputs(ctx, path, export):
"""
List outputs for stack.
\f
:param path: Path to execute the command on.
:type path: str
:param export: Specify the export formatting.
:type export: str
"""
context = SceptreContext(
command_path=path,
project_path=ctx.obj.get("project_path", None),
user_variables=ctx.obj.get("user_variables", {}),
options=ctx.obj.get("options", {}),
output_format=ctx.obj.get("output_format"),
@catch_exceptions
def validate_command(ctx, path):
"""
Validates the template used for stack in PATH.
\f
:param path: Path to execute the command on.
:type path: str
"""
context = SceptreContext(
command_path=path,
project_path=ctx.obj.get("project_path"),
user_variables=ctx.obj.get("user_variables"),
options=ctx.obj.get("options"),
output_format=ctx.obj.get("output_format"),
ignore_dependencies=ctx.obj.get("ignore_dependencies")
)