Skip to main content

Quick start

Below is a quick start tutorial that walks you through the process of building a CloudFlow in the DoiT console.

Goal and objectives

  • Goal: To create a workflow that publishes an Amazon SNS message when a certain Amazon EC2 instance stops running.

  • Objectives: In this tutorial, you'll learn how to:

    • Define a custom schedule to trigger the flow.

    • Interact with AWS services to check EC2 instance status and publish SNS messages.

    • Use conditions in the flow.

    • Test an action by a dry run.

Start building

The workflow in this tutorial is straightforward. To start building it:

  1. Sign in to the DoiT console, select Governance from the top navigation bar, and then select CloudFlow.

  2. Select Create CloudFlow.

Step 1: Add a trigger

Add a custom schedule as the trigger of the flow.

  1. In the What should start your flow block, select Custom schedule.

  2. Set the schedule to Daily 9 AM.

    Condition configuration

Step 2: Describe EC2 instances

  1. In the What do you want to do block, select Perform an action.

  2. Search for AWS EC2 DescribeInstances and choose it as the action to perform.

  3. On the Parameters tab, select the AWS account and region.

    Configure an action

  4. On the Permissions tab, select Check for requiredpermissions.

    If you have the necessary permissions, you'll see a successful message; otherwise, you'll see instructions about what you need to do.

  5. On the Test tab, select Use Data from Parameters for Data In, and then select Test.

    If successful, the response is displayed in Data out. Note down the InstanceId in the response for the next step.

    Test an action

  6. Go back to the Parameters tab, select Add additional parameters, and then select InstanceIds. Paste the Instance ID returned in the previous step.

    Test an action

  7. Save the configuration.

Step 3: Check the condition of the instance

  1. Add an IF statement node.

  2. Select the node to open the side panel for configuration.

  3. For the Data source, select DescribeInstances, which is the node before the current one.

  4. Define the condition check.

    1. Select Add new condition.

    2. Use the plus button (+) to choose DescribeInstances.Reservations.Instances.State.Name as the subject operand, then select the == operator and set the value to stopped.

      Add new filter

    3. Select Add condition.

Step 4: Publish an SNS message

Now we need to define activities for the two branches.

  1. Under the True branch, add a Perform an action node, search for the Amazon SNS Publish action and add it.

  2. Configure the node:

    1. On the Parameters tab, select the AWS account and region, and add the message to publish.

      Add new filter

    2. On the Permissions tab, select Check for required permissions. If the check fails, follow the intructions provided in the DoiT console to add permissions.

    3. On the Test tab, select Use Data from Parameters for Data In, and then select Test.

Publish the CloudFlow

The last step is to publish the CloudFlow.

Add new filter

Once published, you can choose to Edit, Run, or Unpublish a CloudFlow on the same screen, or you can choose Close to return to the main screen.