Automation (also called Action)

An automation is an action script that the Bot executes. These actions can include tasks like sending a message to a Teams channel, updating a security group rule in Azure, or deleting an S3 bucket in AWS. Users can use the pre-built automations provided by our platform, as well as create, update, or delete their own custom automations. Each automation is specific to a certain integration type, such as AWS, GCP, or Conformity. When creating a custom automation, users can specify -

  • The Automation Name,
  • Clients (i.e., the required clients to operate the automation),
  • Automation type (i.e., mutation or communication),
  • Parameters:
    1. When executing an automation, you can pass values as parameters to customize its behavior. These parameters can be static or dynamic, and they allow for greater flexibility and reusability of the automation.
  • Approval (whether the automation requires approval or not).

The automation will run the Python code provided by users.

In summary, automations in our platform are pre-built or custom-defined actions or tasks that bots can execute. Users can create, update, or delete them, and they are specific to integration types.

Example:

  1. Send Message to Teams Channel.
  2. Delete S3 bucket.
  3. Update Azure Network Security Group Rule ...

There are around 20 ready to use automations available. User can create/update/delete automations.

View Automation

  1. Login to the platform
  2. From the left pane navitgate to Bot Building Blocks -> Automations
  3. List of existing automations will be preseneted.
  4. Click on any of the Automations to see the details.

Create Automations

  1. From the left pane navitgate to Bot Building Blocks -> Automations

  2. List of existing automations will be preseneted.

  3. Click on + New at the top right corner.

  4. Automations are specific to integration types i.e. AWS, GCP, Conformity etc. Select the Integration Type from the dropdown.

  5. Fill in the details.

    1. Automation Name: You can provide any name for the automation. Make sure it is a meaningful name so identify later.
    2. Clients: The automations requires clients to operation. The selected clients will be prepared by the platform and will be passed to your code, all the authentication will be done by the platform system.
      • Example AWS: You can select s3, ec2 or any other available clients.
      • Example Azure: ComputeManagementClient, ResourceManagementClient etc.
    3. Automation Type:
      • Mutation: This indicates that the automation will do certain activity which will mutate your resources like addin tags to resource, delete s3 bucket etc.
      • Communication: This type indicates that the automation will no t do any mutation and only notify on different platforms like teams, sms, slack etc. This type is mostly needed if you are using a new communication integration which is not available in the platform by default.
    4. Parameters:
      • The parameters are defined here and default value is provided. While building the bot, you can override the parameters.
      • The parameters will be passed on to the Autoamtion when executed. These are static params available to the automation.
      • Example: Teams Message default title and body is provided here but while building the bot I want to have a specific Title when the message is sent out to teams for that specific bot.
      • Example: The automation is adding a tag to aws resource, while building bot, you can specify the tag name and tag value.
    5. Approval
      • This indicates if the automation requires approval. In most mutation cases approval is required whereas in the case of communication the approval is not required. This depends on the mutation type of, example if you are just adding a new tag to resource approval is not required but when you are updating/deleting something it is advisable to have the approval enabled.
    6. Code:
      • This is the Python code that will run when the autoation is executed.

      • The sample code will be provide and the same format has to be used while building custom automation.

      • The funciton signature is as follows:

        def execute(clients, params, resources=[], test=False): ### you code
      • The function parameters are.

        1. clients: The same clients you selected above from the multiselect dropdown.
        2. parmas: The same parameters defined while creating the automation.
        3. resources: The list of resources the automation will act upon.
        4. test: This is for testing purpose so you can define dryrun for the automation while testing.
      • The function must return list of resources with relevant details like the action succeded or failed.

      • Example:

        [{ "id": "1", "success": true }, { "id": "2", "success": false, "error_message": "Unauthorised Exception" }]

Testing an Automation

Step 1: Go to the Automations Page, by Clicking on Automations in the left panel.

Step 2: Click on the Automation you want to Test, in this case, Click on the name of the Automation you gave in the previous section.

Step 3: Click on the Test in the Top Right corner.

Step 4: Select the integration you want to Test with, Select AWS integration we connected earlier.

Step 5: Input Params if any.

Step 6: Click on Run.

Step 7: Check the output.

Done!