6 Replies Latest reply on May 15, 2020 1:18 PM by baban shrestha

    Pattern to discover AWS via External Event(Lambda).

    baban shrestha
      Share This:

      Hello all,

       

      I am working on writing a custom pattern to trigger a scan based of event for AWS Cloud discovery. We are using Lambda functions as the event source..

       

      Please do share ideas knowledge if anyone had success on event based trigger .

       

       

       

      tpl 1.15 module CMDB.ExtendData.AWS.Event.trigger;

      pattern AssetID 2.0

        """

        This is a template pattern for triggering off an external event.

        """

       

        metadata

          products := EC2;

          publishers := AWS;

        end metadata;

       

        overview

          tags Event, AWS;

        end overview;

       

        // Optional constants section used here to declare the type of

        // event type to match against.

        constants

          event_type := "aws";

        end constants;

       

        triggers

          // Trigger when External Event is received from external source.

          on event := ExternalEvent created where type = @event_type;

        end triggers;

       

        body

          // The pattern can now take the event information accessible on the

          // event node and perform the relevant actions, e.g. update the model,

          // initiate a new scan of an endpoint or initiate a CMDB sync of a device.

       

          // Initiate a scan of an endpoint.

          discovery.scan($$endpoint$$); // which endpoint to use ?

       

          // Initiate a CMDB Sync of a device.

          //system.cmdbSync($$device_to_sync$$);

       

        end body;

       

      end pattern;