Skip to content

Latest commit

 

History

History

aws-lambda-invoke-controlm-services

Handle AWS Events as triggers for Control-M Actions

This is an implementation of AWS SQS messages triggering a Lambda function that in turn invokes Control-M services. The current version processes SQS messages with the specific format described in the SQSMessages.txt file below.

This example consists of the following:

  • ctmEventHandler.py: Python code for the Lambda function
  • SQSMessages.txt: SQ message text and format that is consumed by the Lambda function
  • JGO_Std.template: JSON job definitions that serve as a template. These reside in an S3 bucket and can contain variables

To install the example:

  1. Define an SQS queue named ctmrequests.
  2. Define a role with access to Amazon SQS, Amazon S3 and Amazon Secrets Manager
  3. Define Control-M environments in Amazon Secrets Manager. Each Environment should have the following attributes:
    • The Secret name should be CTMEnvironment_"environment name". The "environment name" is specified as an attribute in the SQS message
    • Each Secret should contain four key/value pairs as follows.
      • endpoint contains the Control-M endpoint in the format https://hostname:port/automation-api
      • username contains the user name
      • password contains the password
      • bucket contains the S3 bucket where templates for this environment as stored
  4. Define the ctmEventHandler Lambda Function with a Python 3.6 runtime
  5. Upload the Pythom code below
  6. Select SQS as the event trigger and select the ctmrequests queue

This is a work in progress with additional details for implementation to follow as well as support for SNS and S3 events.