

# Create, clone, update, find, and cancel RFCs
Create, clone, update, find, and cancel RFCs

The following examples walk you through various RFC operations.

**Topics**
+ [

# Create an RFC
](ex-rfc-create-col.md)
+ [

# Clone RFCs (re-create) with the AMS console
](ex-clone-rfcs.md)
+ [

# Update RFCs
](ex-update-rfcs.md)
+ [

# Find RFCs
](ex-rfc-find-col.md)
+ [

# Cancel RFCs
](ex-cancel-rfcs.md)

# Create an RFC


## Creating an RFC with the console


The following is the first page of the RFC Create process in the AMS console, with **Quick cards** open and **Browse change types** active:

![\[Quick create section with options for common AWS stack operations and access management.\]](http://docs.aws.amazon.com/managedservices/latest/onboardingguide/images/quickCreate1.png)


The following is the first page of the RFC Create process in the AMS console, with **Select by category** active:

![\[Create RFC page with change type categorization options for managed services environment.\]](http://docs.aws.amazon.com/managedservices/latest/onboardingguide/images/guiRfcCreate1-2.png)


How it works:

1. Navigate to the **Create RFC** page: In the left navigation pane of the AMS console click **RFCs** to open the RFCs list page, and then click **Create RFC**.

1. Choose a popular change type (CT) in the default **Browse change types** view, or select a CT in the **Choose by category** view.
   + **Browse by change type**: You can click on a popular CT in the **Quick create** area to immediately open the **Run RFC** page. Note that you cannot choose an older CT version with quick create.

     To sort CTs, use the **All change types** area in either the **Card** or **Table** view. In either view, select a CT and then click **Create RFC** to open the **Run RFC** page. If applicable, a **Create with older version** option appears next to the **Create RFC** button.
   + **Choose by category**: Select a category, subcategory, item, and operation and the CT details box opens with an option to **Create with older version** if applicable. Click **Create RFC** to open the **Run RFC** page.

1. On the **Run RFC** page, open the CT name area to see the CT details box. A **Subject** is required (this is filled in for you if you choose your CT in the **Browse change types** view). Open the **Additional configuration** area to add information about the RFC.

   In the **Execution configuration** area, use available drop-down lists or enter values for the required parameters. To configure optional execution parameters, open the **Additional configuration** area.

1. When finished, click **Run**. If there are no errors, the **RFC successfully created** page displays with the submitted RFC details, and the initial **Run output**. 

1. Open the **Run parameters** area to see the configurations you submitted. Refresh the page to update the RFC execution status. Optionally, cancel the RFC or create a copy of it with the options at the top of the page.

## Creating an RFC with the CLI


How it works:

1. Use either the Inline Create (you issue a `create-rfc` command with all RFC and execution parameters included), or Template Create (you create two JSON files, one for the RFC parameters and one for the execution parameters) and issue the `create-rfc` command with the two files as input. Both methods are described here.

1. Submit the RFC: `aws amscm submit-rfc --rfc-id ID` command with the returned RFC ID.

   Monitor the RFC: `aws amscm get-rfc --rfc-id ID` command.

To check the change type version, use this command:

```
aws amscm list-change-type-version-summaries --filter Attribute=ChangeTypeId,Value=CT_ID
```
**Note**  
You can use any `CreateRfc` parameters with any RFC whether or not they are part of the schema for the change type. For example, to get notifications when the RFC status changes, add this line, `--notification "{\"Email\": {\"EmailRecipients\" : [\"email@example.com\"]}}"` to the RFC parameters part of the request (not the execution parameters). For a list of all CreateRfc parameters, see the [AMS Change Management API Reference](https://docs.aws.amazon.com/managedservices/latest/ApiReference-cm/API_CreateRfc.html).

*INLINE CREATE*:

Issue the create RFC command with execution parameters provided inline (escape quotes when providing execution parameters inline), and then submit the returned RFC ID. For example, you can replace the contents with something like this::

```
aws amscm create-rfc --change-type-id "CT_ID" --change-type-version "VERSION" --title "TITLE" --execution-parameters "{\"Description\": \"example\"}"
```

*TEMPLATE CREATE*:
**Note**  
This example of creating an RFC uses the Load Balancer (ELB) stack change type.

1. Find the relevant CT. The following command searches CT classification summaries for those that contain "ELB" in the **Item** name and creates output of the Category, Item, Operation, and ChangeTypeID in table form (Subcategory for both is `Advanced stack components`).

   ```
   aws amscm list-change-type-classification-summaries --query "ChangeTypeClassificationSummaries[?contains(Item,'ELB')].[Category,Item,Operation,ChangeTypeId]" --output table
   ```

   ```
   ---------------------------------------------------------------------
   |                            CtSummaries                            |
   +-----------+---------------------------+---------------------------+
   | Deployment| Load balancer (ELB) stack | Create | ct-123h45t6uz7jl |
   | Management| Load balancer (ELB) stack | Update | ct-0ltm873rsebx9 |
   +-----------+---------------------------+---------------------------+
   ```

1. Find the most current version of the CT:

   `ChangeTypeId` and `ChangeTypeVersion`: The change type ID for this walkthrough is `ct-123h45t6uz7jl` (create ELB), to find out the latest version, run this command:

   ```
   aws amscm list-change-type-version-summaries --filter Attribute=ChangeTypeId,Value=ct-123h45t6uz7jl
   ```

1. Learn the options and requirements. The following command outputs the schema to a JSON file named CreateElbParams.json.

   ```
   aws amscm get-change-type-version --change-type-id "ct-123h45t6uz7jl" --query "ChangeTypeVersion.ExecutionInputSchema" --output text > CreateElbParams.json
   ```

1. Modify and save the execution parameters JSON file. This example names the file CreateElbParams.json.

   For a provisioning CT, the StackTemplateId is included in the schema and must be submitted in the execution parameters.

   For TimeoutInMinutes, how many minutes are allowed for the creation of the stack before the RFC is failed, this setting will not delay the RFC execution, but you must give enough time (for example, don't specify "5"). Valid values are "60" up to "360," for CTs with long-running UserData: Create EC2 and Create ASG. We recommend the max allowed "60" for all other provisioning CTs.

   Provide the ID of the VPC where you want the stack to be created; you can get the VPC ID with the CLI command `aws amsskms list-vpc-summaries`.

   ```
   {
   "Description":      "ELB-Create-RFC", 
   "VpcId":            "VPC_ID", 
   "StackTemplateId":  "stm-sdhopv00000000000", 
   "Name":             "MyElbInstance",
   "TimeoutInMinutes": 60,
   "Parameters":   {
       "ELBSubnetIds":                     ["SUBNET_ID"],
       "ELBHealthCheckHealthyThreshold":   4,
       "ELBHealthCheckInterval":           5,
       "ELBHealthCheckTarget":             "HTTP:80/",
       "ELBHealthCheckTimeout":            60,
       "ELBHealthCheckUnhealthyThreshold": 5,
       "ELBScheme":                        false
       }
   }
   ```

1. Output the RFC JSON template to a file in your current folder named CreateElbRfc.json:

   ```
   aws amscm create-rfc --generate-cli-skeleton > CreateElbRfc.json
   ```

1. Modify and save the CreateElbRfc.json file. Because you created the execution parameters in a separate file, remove the `ExecutionParameters` line. For example, you can replace the contents with something like this:

   ```
   {
   "ChangeTypeVersion":    "2.0",
   "ChangeTypeId":         "ct-123h45t6uz7jl",
   "Title":                "Create ELB"
   }
   ```

1. Create the RFC. The following command specifies the execution parameters file and the RFC template file:

   ```
   aws amscm create-rfc --cli-input-json file://CreateElbRfc.json --execution-parameters file://CreateElbParams.json
   ```

   You receive the ID of the new RFC in the response and can use it to submit and monitor the RFC. Until you submit it, the RFC remains in the editing state and does not start.

## Tips


**Note**  
You can use the AMS API/CLI to create an RFC without creating an RFC JSON file or a CT execution parameters JSON file. To do this, you use the `create-rfc` command and add the required RFC and execution parameters to the command, this is called "Inline Create". Note that all provisioning CTs have contained within the `execution-parameters` block a `Parameters` array with the parameters for the resource. The parameters must have quote marks escaped with a back slash (\$1).  
The other documented method of creating an RFC is called "Template Create." This is where you create a JSON file for the RFC parameters and another JSON file for the execution parameters, and submit the two files with the `create-rfc` command. These files can serve as templates and be re-used for future RFCs.  
When creating RFCs with templates, you can use a command to create the JSON file with the contents you want by issuing a command as shown. The commands create a file named "parameters.json" with the shown content; you could also use these commands to create the RFC JSON file.

# Clone RFCs (re-create) with the AMS console


You can use the AMS console to clone an existing RFC.

To clone, or recreate, an RFC by using the AMS console, follow these steps:

1. Find the relevant RFC. From the left navigation, click **RFCs**. 

   The RFCs dashboard opens.

1. Scroll through the pages until you find the RFC you want to clone. Use the **Filter** option to narrow the list. Choose the RFC that you want to clone.

   The RFC details page opens.

1. Click **Create a Copy**.

   The **Create a request for change** page opens with all options set as in the original RFC.

1. Make the changes you want. To set additional options, change the **Basic** option to **Advanced**. After you have set all options, choose **Submit**.

   The active RFC details page opens with a new RFC ID for the cloned RFC and the cloned RFC appears in the RFC dashboard.

# Update RFCs


You can resubmit an RFC that has been rejected or that has not yet been submitted, by updating the RFC and then submitting it, or re-submitting it. Note that most RFCs are rejected because the specified `RequestedStartTime` has passed before submission or the specified TimeoutInMinutes is inadequate to run the RFC (since TimeoutInMinutes does not prolong a successful RFC, we recommend always setting this to at least "60" and up to "360" for an Amazon EC2 or an Amazon EC2 Auto Scaling group with long-running UserData). This section describes how to use the CLI version of the `UpdateRfc` command to update an RFC with a new RFC parameter, or new parameters using either stringified JSON or an updated parameters file.

This example describes using the CLI version of the AMS UpdateRfc API (see [Update RFC](https://docs.aws.amazon.com/managedservices/latest/ApiReference-cm/update-rfc.html)). While there are change types for updating some resources (DNS private and public, load balancer stacks, and stack patching configuration), there is no CT to update an RFC.

We recommend that you submit one UpdateRfc operation at a time. If you submit multiple updates, for example on a DNS stack, the updates might fail attempting to update the DNS at the same time.

REQUIRED DATA: `RfcId`: The RFC you're updating.

OPTIONAL DATA: `ExecutionParameters`: Unless you're updating a non-required field, like `Description`, you would submit modified execution parameters to address the issues that caused the RFC to be rejected or canceled. All submitted non-null values overwrite those values in the original RFC.

1. Find the relevant rejected or canceled RFC, you can use this command (you can substitute the value with `Canceled`):

   ```
   aws amscm list-rfc-summaries --filter Attribute=RfcStatusId,Value=Rejected
   ```

1. You can modify any of the following RFC parameters :

   ```
   {
       "Description": "string",
       "ExecutionParameters": "string",
       "ExpectedOutcome": "string",
       "ImplementationPlan": "string",
       "RequestedEndTime": "string",
       "RequestedStartTime": "string",
       "RfcId": "string",
       "RollbackPlan": "string",
       "Title": "string",
       "WorstCaseScenario": "string"}
   ```

   Example command updating the Description field:

   ```
   aws amscm update-rfc --description "AMSTestNoOpsActionRequired" --rfc-id "RFC_ID" --region us-east-1
   ```

   Example command updating the ExecutionParameters VpcId field:

   ```
   aws amscm update-rfc  --execution-parameters "{\"VpcId\":\"VPC_ID\"}" --rfc-id "RFC_ID" --region us-east-1
   ```

   Example command updating the RFC with an execution parameters file that contains the updates; see example execution parameters file in step 2 of: [EC2 stack \$1 Create](https://docs.aws.amazon.com/managedservices/latest/ctref/deployment-advanced-ec2-stack-create.html):

   ```
   aws amscm update-rfc --execution-parameters file://CreateEc2ParamsUpdate.json --rfc-id "RFC_ID" --region us-east-1
   ```

1. Resubmit the RFC using `submit-rfc` and the same RFC ID that you have from when the RFC was first created:

   ```
   aws amscm submit-rfc --rfc-id RFC_ID
   ```

   If the RFC succeeds, you receive no confirmation or error messages at the command line.

1. To monitor the status of the request and to view Execution Output, run the following command.

   ```
   aws amscm get-rfc --rfc-id RFC_ID
   ```

# Find RFCs


## Find a request for change (RFC) with the console


To find an RFC by using the AMS console, follow these steps.
**Note**  
This procedure applies only to scheduled RFCs, that is, RFCs that did not use the **ASAP** option.

1. From the left navigation, click **RFCs**.

   The RFCs dashboard opens.

1. Scroll through the list or use the **Filter** option to refine the list.

   The RFC list changes per filter criteria.

1. Choose the Subject link for the RFC you want.

   The RFC details page opens for that RFC with information including RFC ID.

1.  If there are many RFCs in the dashboard, you can use the **Filter** option to search by RFC:
   + **Subject**: The subject line, or title (in the API/CLI) given to the RFC when it was created.
   + **RFC ID**: The identifier for the RFC.
   + **Activity state**: If you know the RFC state, you can choose between **AwsOperatorAssigned** meaning an operator is currently looking at the RFC, **AwsActionPending** meaning that an AMS operator must perform something before the RFC execution can proceed or **CustomerActionPending** meaning that you need to take some action before the RFC execution can proceed.
   + **Status**: If you know the RFC status, you can choose between:
     + **Scheduled**: RFCs that were scheduled.
     + **Canceled**: RFCs that were canceled.
     + **In progress**: RFCs in progress.
     + **Success**: RFCs that executed successfully.
     + **Rejected**: RFCs that were rejected.
     + **Editing**: RFCs that are being edited.
     + **Failure**: RFCs that failed.
     + **Pending approval**: RFCs that cannot proceed until either AMS or you approve. Typically, this indicates that you need to approve the RFC. You will have gotten a service notification of this in your Service Requests list.
   + **Change type**: Pick the **Category**, **Subcategory**, **Item**, and **Operation**, and the change type ID is retrieved for you.
   + **Requested start time** or **Requested end time**: This filter option lets you choose **Before** or **After**, and then enter a **Date** and, optionally, a **Time** (hh:mm and time zone). This filter operates successfully only on scheduled RFCs (not ASAP RFCs).
   + **Status**: Either **Scheduled**, **Canceled**, **In progress**, **Success**, **Rejected**, **Editing**, or **Failure**.
   + **Subject**: The subject (or title, if the RFC was created with the API/CLI) that you gave the RFC.
   + **Change type ID**: Use the identifier for the change type submitted with the RFC.

   The search allows you to add the filters, as shown in the following screenshot.  
![\[Search or filter options including Subject, RFC ID, Activity state, and various time-related fields.\]](http://docs.aws.amazon.com/managedservices/latest/onboardingguide/images/filterRfcAllOptions3.png)

1. Click on the Subject link for the RFC you want.

   The RFC details page opens for that RFC with information including RFC ID.

## Finding a request for change (RFC) with the CLI


You can use multiple filters to find an RFC.

To check the change type version, use this command:

```
aws amscm list-change-type-version-summaries --filter Attribute=ChangeTypeId,Value=CT_ID
```
**Note**  
You can use any `CreateRfc` parameters with any RFC whether or not they are part of the schema for the change type. For example, to get notifications when the RFC status changes, add this line, `--notification "{\"Email\": {\"EmailRecipients\" : [\"email@example.com\"]}}"` to the RFC parameters part of the request (not the execution parameters). For a list of all CreateRfc parameters, see the [AMS Change Management API Reference](https://docs.aws.amazon.com/managedservices/latest/ApiReference-cm/API_CreateRfc.html).

If you don’t write down the RFC ID, and need to find it later, you can use the AMS change management (CM) system to search for it and narrow the results with a filter or query.

1. The CM API [ListRfcSummaries](https://docs.aws.amazon.com/managedservices/latest/ApiReference-cm/API_ListRfcSummaries.html) operation has filters. You can [Filter](https://docs.aws.amazon.com/managedservices/latest/ApiReference-cm/API_Filter.html) results based on an `Attribute` and `Value` combined in a logical AND operation, or based on an `Attribute`, a `Condition`, and `Values`.  
**RFC filtering**    
<a name="rfc-filtering-table"></a>[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/managedservices/latest/onboardingguide/ex-rfc-find-col.html)

   Examples:

   To find the IDs of all the RFCs related to SQS (where SQS is contained in the Item portion of the CT), you can use this command:

   ```
   list-rfc-summaries --query 'RfcSummaries[?contains(Item.Name,`SQS`)].[Category.Id,Subcategory.Id,Type.Id,Item.Id,RfcId]' --output table
   ```

   Which returns something like this:

   ```
   ----------------------------------------------------------------------------
   |                         ListRfcSummaries                                   |
   +----------+--------------------------------+-------+-------+----------------+
   |Deployment| Advanced Stack Components      |SQS    |Create |ct-123h45t6uz7jl|
   |Management| Monitoring & Notification  |SQS    |Update |ct-123h45t6uz7jl|
   +----------+--------------------------------+-------+-------+----------------+
   ```

   Another filter available for `list-rfc-summaries` is `AutomationStatusId`, to look for RFCs that are automated or manual:

   ```
   aws amscm list-rfc-summaries --filter Attribute=AutomationStatusId,Value=Automated
   ```

   Another filter available for `list-rfc-summaries` is `Title` (**Subject** in the console):

   ```
    Attribute=Title,Value=RFC-TITLE
   ```

   Example of the new request structure in JSON that returns RFCs where:
   + (Title CONTAINS the phrase "Windows 2012" OR "Amazon Linux") AND
   + (RfcStatusId EQUALS "Success" OR "InProgress") AND
   + (20170101T000000Z <= RequestedStartTime <= 20170103T000000Z) AND (ActualEndTime <= 20170103T000000Z)

   ```
   {
     "Filters": [
       {
         "Attribute": "Title",
         "Values": ["Windows 2012", "Amazon Linux"],
         "Condition": "Contains"
       },
       {
         "Attribute": "RfcStatusId",
         "Values": ["Success", "InProgress"],
         "Condition": "Equals"
       },
       {
         "Attribute": "RequestedStartTime",
         "Values": ["20170101T000000Z", "20170103T000000Z"],
         "Condition": "Between"
       },
       {
         "Attribute": "ActualEndTime",
         "Values": ["20170103T000000Z"],
         "Condition": "Before"
       }
     ]
   }
   ```
**Note**  
With more advanced `Filters`, AMS intends to deprecate the following fields in an upcoming release:  
Value: The Value field is part of the Filters field. Use the Values field that supports more advanced functionality.
RequestedEndTimeRange: Use the RequestedEndTime inside the Filters field that supports more advanced functionality
RequestedStartTimeRange: Use the RequestedStartTime inside the Filters field that supports more advanced functionality.

   For information about using CLI queries, see [ How to Filter the Output with the --query Option](https://docs.aws.amazon.com/cli/latest/userguide/controlling-output.html#controlling-output-filter) and the query language reference, [JMESPath Specification](http://jmespath.org/specification.html).

1. If you're using the AMS console:

   Go to the **RFCs** list page. If needed, you can filter on the RFC **Subject**, which is what you entered as the RFC `Title` when you created it.

## Tips


**Note**  
This procedure applies only to scheduled RFCs, that is, RFCs that did not use the **ASAP** option.

# Cancel RFCs


You can cancel an RFC using the Console or the AMS API/CLI.

To cancel an RFC with the console, find the RFC in your RFC list, open it, click **Cancel**.

Required Data:
+ `Reason`: Why you are canceling the RFC.
+ `RfcId`: The RFC you are canceling.

1. Typically you would cancel an RFC right after submitting it (so the RFC ID should be handy); otherwise, you would not be able to cancel it unless you scheduled it and it's before the specified start time. If you need to find the RFC ID, you can use this command (you can substitute the `Value` with `PendingApproval` for an RFC that is manually approved):

   ```
   aws amscm list-rfc-summaries --filter Attribute=RfcStatusId,Value=Scheduled
   ```

1. Example command to cancel an RFC:

   ```
   aws amscm cancel-rfc --reason "Bad Stack ID" --rfc-id "RFC_ID" --profile saml --region us-east-1
   ```