Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@cli.command('ssh', short_help="Connect to an ECS cluster machine")
@click.pass_context
@click.argument('service_name')
@click.option('--verbose/--no-verbose', '-v', default=False, help="Show all SSH output.")
@needs_config
def ssh(ctx, service_name, verbose):
"""
If the service SERVICE_NAME has any running tasks, randomly choose one of
the container instances on which one of those tasks is running and ssh into
it.
If the service SERVICE_NAME has no running tasks, randomly choose one of
the container instances in the cluster on which the service is defined.
"""
service = FriendlyServiceFactory.new(service_name, config=ctx.obj['CONFIG'])
service.ssh(verbose=verbose)
@cli.command('create', short_help="Create a service in AWS")
@click.pass_context
@click.argument('service_name')
@click.option('--update-configs/--no-update-configs', default=False, help="Update our config parameters in AWS")
@click.option('--dry-run/--no-dry-run', default=False, help="Don't actually create the service")
@click.option(
'--wait/--no-wait',
default=True,
help="Don't exit until the service is created and all its tasks are running"
)
@click.option('--asg/--no-asg', default=True, help="Scale your ASG to fit our service count")
@click.option(
'--force-asg/--no-force-asg',
default=False,
help="Force your ASG to scale outside of its MinCount or MaxCount"
)
@needs_config
def main():
load_local_click_modules()
cli(obj={})