This node performs the action that you define on the resources selected and filtered earlier; the actual automation is accomplished in this node. This node can access every AWS API that’s available, meaning any action that could be performed on the AWS SDK, will be available on the TotalCloud console in the Action Node. (Again, this ‘Action Node’ is relevant to AWS only, for Azure and VMware actions, we have the ‘Azure Action’ node and the ‘VMware Action’ node available, discussed later).
The action node performs an action automatically on a specific set of AWS resources fetched from the previous node. Each action in this node is unique to an AWS service and is dependent on the inputs defined in the preceding nodes as well as current specifications.
To add an action node, click on the ‘+’ and select Action. This usually comes initially, as the node after the Resource & Filter nodes (or the nodes that define the selection of your resources). Click on the node and select ‘edit’ to open the parameters options for the nodes.
Once you edit the action node, you have to ‘select resource to perform action on’. This is a concept similar to the selection you make in the Filter node as well. Before defining an action, you would have selected certain resources and addons to perform actions on, and maybe even used a filter node to filter them out further. Every resource attribute will have a ‘Resource ID’, and the Filtered resources will have a ‘Filter Node ID’. These are available to you in the drop-down options.
Once you’ve selected the resource, in this example, the resource is the output of the ‘Filter Node’ used previously, that is why the box says ‘Filter.Instances’. In order to select the actual action (remember, every action available here is an AWS API), you’ll have to select the service, and then select the relevant Action (API).
Once you select the a service & action, you can see the ‘params mapping’ box below. The params that are made available to you here are the same params associated with every AWS API.
You can refer to the corresponding AWS API documentation page while passing the additional parameters. For example: The additional parameters supported for EC2 Volumes would be whatever AWS supports in describeVolumes API. For parameters that are optional, you can see the ‘<optional>’ tag against the parameter. The other become the minimum or mandatory parameters you have to define.
Using Global Variables while defining Parameters: If you have defined parameters in your Global Variables and want to refer to them here, you can type “$wf.variables <variable_name>” in the relevant parameter/object. As you start typing out the notation, you’ll see a dropdown of all available global variables, you can simply select the relevant one, or type it out. (Learn more about global variables and how to configure them here.)
In this example, we’ve defined the InstanceID in the global variables. And in the action node, we’ve selected the action “EC2 Stop Instances”. We have to define the InstanceIDs in the params mapping box compulsorily, so we’ve referred to the globally defined variable with the notation “$wf.variables.instanceids”. ‘Wait for actions to complete’ is a checkbox which when ticked, will ensure that the next node executes only after the action in this Action Node has finished performing. Some AWS actions like deleting or creating instances might take a few minutes to execute, that’s when this option comes in handy. This also depends on your use case.