3. Creating your first workflow using AWS Cloud Services
Now that an AWS target account has been added, let's create a workflow using this Cloud Service integration.
As discussed in our first step of adding a target AWS account, AWS API calls are notoriously hard to read, understand and use. Fylamynt's goal is to help users connect and execute individual API calls as a node in Fylamynt workflows. The node referred to is called AWS and is available to drag and drop from the Actions panel onto the canvas.
The AWS Action allows you to call any AWS API endpoint supported by the boto3 library. See boto3 documentation here: https://boto3.amazonaws.com/v1/documentation/api/latest/index.html
Input
Parameter Name
Description
Required
Service
The AWS Service you want to call.
True
Operation
The API call you want to make to the above service.
True
After you select a service (e.g. EC2, S3, IAM) and an operation (e.g. 'DescribeInstances', 'CreateBucket'), a further list of parameters for that call will appear on the right sidebar. These will be specific to the call you're making.
Output
The specific output of the AWS Execution Action depends on the Service and Operation selected above. The 'output' tab on the right panel will show a preview of the JSON output of the given operation.
Example Workflow using the AWS Action node
Suppose you have a blue-green deployment environment, where you have a set of EC2 instances tagged "Deployment:blue" and another set tagged "Deployment:green". Green is currently in production, and we want to get a list of the instance IDs of the blue instances so we can perform some other action on them later.
Creating a workflow in Fylamynt
We are going to use the AWS Action to get a list of the blue EC2 instances and then use a second AWS Action to send a 'stop_instances' to them.
Starting from a new workflow, drag an "AWS" action node onto the canvas from the left-hand "Add" sidebar.
For the input, configure the following:
Set the AWS Target account alias, which you created in the previous step.
Set the region for the AWS Target account.
Set the service to "Ec2" and the operation to "DescribeInstances".
Now we'll set up a filter so we only get the blue instances we're interested in. This is an implementation of AWS filters, which can get quite complex. More information here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html
Click "Add Filters".
For the "Name" field, enter "tag:Description".
Click "Add Value"
For the value, enter "blue".
Click Save in the "value" dialog.
Click Save again to save the whole filter.
The filters section should look like this:
Now we have a node that will find our 'blue' deployment EC2 instances.
The next step to add to the workflow is to stop the EC2 instance identified in the first step.
Drag and drop a second AWS Action from the left sidebar, then drag a line from the bottom of the first AWS node to the top of the second. Then click on the second node to select it.
For the input, configure the following:
Set the AWS Target account alias, which you created in the previous step.
Set the region for the AWS Target account.
Set the service to "Ec2" and the operation to "StopInstances".
A new field named "InstanceIds" will appear under the Service/Operation area. For most parameters, Fylamynt gives you the ability to set the values now, at runtime, or from the output of a previous step.
Click the gear to the left of the "InstanceIds" label gear image
Select "Set value from a previous step"
Click on "Choose a step".
Click on "Choose an output from the step"
Choose "output" from the dropdown.
Select the Name and number of the previous step action node called "Ec2 DescribeInstances"
A new previous step output field appears, select "output"
A new parameter called output appears, click on "Configure"
A listing of the JSON output from the previous step will appear. We want the Instance ID for each instance in the Instances list in that document. Find "Instances" and scroll down to "InstanceID". Click on that.
You will see a dialog that looks like this:
Click "Save Output".
The right sidebar should look like this:
If you decide to add additional AWS Action steps further down, it could also use the Instance ID list provided above.
Now we're ready to stop the blue instances.
Before saving the workflow you first need to add a required workflow description
Click "Workflow Settings"
Enter a description
Save the workflow, by clicking "Save new version"
Run the workflow, by clicking "Run" -> "Run Now"
A video walkthrough for creating your first workflow.
The next step is to integrate your favorite tools to enhance your workflows.
Last updated