What is Automation?

Automation is a building block for the bots. Any action to be taken as part of the bot execution are automations.

Example:

  • Send Message to Teams Channel.
  • Delete S3 bucket.
  • Update Azure Network Security Group Rule ...

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

View Automation

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

Create Automations.

  • Login to the platform
  • From the left pane navitgate to Bot Building Blocks -> Automations
  • List of existing automations will be preseneted.
  • Click on + New at the top right corner.
  • Automations are specific to integration types i.e. AWS, GCP, Conformity etc. Select the Integration Type from the dropdown.
  • Fill in the details.
    • Automation Name: You can provide any name for the automation. Make sure it is a meaningful name so identify later.
    • 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.
    • 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.
    • 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.
    • 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.
    • 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.
        • clients: The same clients you selected above from the multiselect dropdown.
        • parmas: The same parameters defined while creating the automation.
        • resources: The list of resources the automation will act upon.
        • 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" }]