resume

Usage

fugue [global options] resume [options] (<alias> | <FID>)

Arguments

<alias> | <FID>
FID or alias of the process to resume

Options

Global options are detailed here.

--json
Emit output as JSON. The JSON flag displays command output in JSON format, which is useful for automation.
--dry-run
Execute a “dry-run” of a process resume (output plan of operations). The dry-run flag allows you to see how AWS will provision your infrastructure in a composition using run, update, resume, or kill without actually executing the command. The Fugue CLI outputs a JSON document of the create, modify, and delete actions that would be executed on your infrastructure, allowing you to preview the changes before you make them.
-y | --yes
Suppress confirmation dialogs. The yes flag suppresses confirmation dialogs and bypasses interactive prompts by providing input to aid scripting.
-h | --help
Show help text. The help flag is available throughout the CLI in both an application-level and command-level context. It enables a user to view help text for any command within the Fugue CLI.

Definition

The resume command resumes automatic enforcement and maintenance of a suspended process, changing its state from Suspended to Running. When the process resumes, Fugue begins actively managing its resources again.

Examples

Resuming Enforcement Of A Suspended Process

Suppose you’ve suspended a process – perhaps to reassess your infrastructure’s configuration – and now you need to resume automatic enforcement and maintenance. You can use the resume command to let Fugue actively manage the process’s resources again.

In this example, we’ve assigned the process an alias of staging.

fugue resume staging

The Fugue CLI asks you to confirm that you want to resume the specified process.

[ fugue resume ] Resuming process with Alias: staging

[ WARN ] Are you sure you want to resume the process with Alias: staging ? [y/N]:

If y, the Fugue CLI sends a request to the Fugue Conductor asking it to resume the process. When the request is accepted, the CLI displays a success message.

Requesting the Conductor to resume process ...
[ DONE ] Process with Alias: staging is being resumed.

[ HELP ] Run the 'fugue status' command to view details and status of this process resume.

Using Suspend to Cancel a Kill

You may cancel a kill by first suspending the desired process and then resuming it.

To suspend the kill:

  1. Execute fugue suspend -y TARGET as soon as possible, where TARGET is the FID or alias of the desired process.
  2. Confirm that the process is in Suspended state by executing fugue status.

From here, you have two options:

  • To cancel the kill and return the process to Running state:

Execute fugue resume -y TARGET.

  • To continue the kill and return the process to Killing state:

Execute fugue kill -y TARGET.

Note: The -y flag is included in this example to save time by suppressing warnings.

Using --dry-run To Preview resume Changes To Your Infrastructure

In Fugue, a dry-run attempts to test an action through progressive parts of the system, returning either failures encountered, or the expected results of success. This allows you to see how Fugue will provision your infrastructure in a composition using run, update, resume, or kill without actually executing the command. You can see this in the output of a dry-run, which is a JSON document describing the create, modify, and delete actions that would be executed on your infrastructure.

Some update operations are mutative, meaning the resource can be changed with “modify” actions, and some update operations are destructive, meaning the resource must be destroyed and created anew with “delete” and “create” actions. You can often determine whether an update is mutative or destructive based on the RequestType in the dry-run document.

You can execute resume with the --dry-run option to see what operations Fugue would take upon resuming a suspended process without actually executing the command. This is useful for determining whether resuming the process would require a significant amount of action, particularly if it has been suspended for a long period of time, or if it was suspended in the middle of executing a kill or update command.

$ fugue resume --dry-run (<alias> | <FID>)

Say you executed run on this composition, and gave it the alias mycomposition:

composition

import Fugue.Core.AWS.Common as AWS
       Fugue.Core.AWS.EC2 as EC2

#########################
# NETWORKS
#########################
my-example-vpc: EC2.Vpc({
  cidrBlock: "10.0.0.0/16",
  tags: [],
  instanceTenancy: EC2.DefaultTenancy,
  region: AWS.Us-west-2,
  dhcpOptions: None
})

Once the infrastructure has been created and you’ve used status to confirm that the process is in Running state, you can suspend the process. At this stage, executing a dry-run of resume, like so...

fugue resume --dry-run mycomposition

...will produce JSON output like the following:

{
    "job_id": "1474999374",
    "fid": "b866637d-5755-4e8c-a333-e991f2a7c95c"
}

The job_id refers to the dry-run job that was created. The fid is, of course, the FID of the process. The output doesn’t list any operations because in this case, resuming the process requires no create, delete, or modify actions. The infrastructure was already created; maintenance and enforcement was simply paused, and since we’ve done nothing to interfere with the infrastructure, nothing needs to happen to return it to the state defined in the composition.

Using a Resume Dry-Run to Preview Enforcement Changes

But what happens if the process is modified while it is in Suspended state? Executing resume turns maintenance and enforcement back on, returning the process to the state defined in the composition, so in this case some kind of create, modify, or delete action would be required.

For example, while our mycomposition process is in Suspended state, we can access the VPC dashboard of the AWS Management Console in the Oregon region and change the name of the VPC from my-example-vpc to my-suspend-test-vpc, as shown in the figure below:

Manually changing VPC name in the AWS dashboard

Manually changing a VPC name in the AWS dashboard.

Now, when you execute a dry-run of resume, you should see JSON output like the following:

{
    "job_id": "1475001056",
    "fid": "b866637d-5755-4e8c-a333-e991f2a7c95c",
    "requests": [
        {
            "guid": "b866637d-5755-4e8c-a333-e991f2a7c95c.3d846bc1-8a2a-5379-b883-beb718194ff7.tags",
            "region": "us-west-2",
            "request_type": "aws.ec2.create_tags",
            "params": {
                "Tags": [
                    {
                        "Value": "my-example-vpc",
                        "Key": "Name"
                    }
                ],
                "Resources": [
                    "vpc-e00d1b84"
                ]
            }
        }
    ]
}

In addition to the job_id and fid fields, there’s a requests field showing other operations. Pay special attention to the request_type field, which describes each AWS API call the Conductor would make if the resume command was executed without --dry-run. In this case, that’s an aws.ec2.create_tags call to change the VPC’s name to the value my-example-vpc. Thus, the dry-run shows exactly what will happen to your process when you execute resume.

Using a Resume Dry-Run to Preview a Canceled Kill

Similarly, if you suspend a process from a Killing state in order in order to cancel a kill, you can use a dry-run of resume to preview the operations that would restore your process to Running.

If the process reaches Suspended state after some infrastructure is terminated but before the kill procedure is completed, then executing resume would recreate the deleted resources, in order to return the process to the state defined in the composition.

For example, if our example process mycomposition is in this situation, executing fugue resume --dry-run mycomposition would result in JSON output like this:

{
    "job_id": "1475003278",
    "fid": "b866637d-5755-4e8c-a333-e991f2a7c95c",
    "requests": [
        {
            "guidMap": {
                "b866637d-5755-4e8c-a333-e991f2a7c95c.3d846bc1-8a2a-5379-b883-beb718194ff7": "aK5JEiX3rr"
            },
            "params": {
                "CidrBlock": "10.0.0.0/16",
                "InstanceTenancy": "default"
            },
            "guid": "b866637d-5755-4e8c-a333-e991f2a7c95c.3d846bc1-8a2a-5379-b883-beb718194ff7",
            "request_type": "aws.ec2.create_vpc",
            "region": "us-west-2"
        },
        {
            "guidMap": {
                "b866637d-5755-4e8c-a333-e991f2a7c95c.3d846bc1-8a2a-5379-b883-beb718194ff7": "aK5JEiX3rr"
            },
            "params": {
                "Resources": [
                    "aK5JEiX3rr"
                ],
                "Tags": [
                    {
                        "Key": "Name",
                        "Value": "my-example-vpc"
                    },
                    {
                        "Key": "Fugue ID",
                        "Value": "b866637d-5755-4e8c-a333-e991f2a7c95c.3d846bc1-8a2a-5379-b883-beb718194ff7"
                    }
                ]
            },
            "guid": "b866637d-5755-4e8c-a333-e991f2a7c95c.3d846bc1-8a2a-5379-b883-beb718194ff7.tags",
            "request_type": "aws.ec2.create_tags",
            "region": "us-west-2"
        }
    ]
}

Naturally, the exact output depends on how many resources were terminated during the interrupted kill and need to be recreated upon resume.

JSON Object Fields in a Dry-Run

job_id
Unique ID for the dry-run operation
requests
Array of params, guid, guidMap, region, request_type per each API request in the dry-run operation
params
Dictionary of arguments passed to the AWS API in order to create, modify, or delete the resources
guid
Globally unique ID for the resource being acted upon. NOTE: guid is not unique for resource properties (e.g., tags, security group rules, routes)
guidMap
A unique token that maps to the guid and resource reference string
region
AWS region; see list of valid codes in AWS docs
request_type
Type of request for an AWS API action in aws.service.action_resource format
fid
Fugue ID, or the process’s unique identifier