AWS SQS plug-in structure

In this topic you can find information about configuring AWS SQS event sources and AWS SQS event conditions.

Configuring a AWS SQS event source

An event source that receives AWS SQS event type can be configured in the following way:
AccessKeyID
  • Type: string
  • Required*
  • minlength: 1
  • maxlength: 1000
The Access Key ID is a specific security credential provided by Amazon Web Services.
Secret
  • Type: string
  • Required*
  • minlength: 1
  • maxlength: 1000
  • isPassword
You need to specify a secret cryptographic key.
roleArn
  • Type: string
  • Required*
  • minlength: 1
  • maxlength: 1000
You can specify the role assumed to receive a message and delete it from a queue.
roleSessionName
  • Type: string
  • Required*
  • minlength: 1
  • maxlength: 1000
You can specify the role session name assumed to receive a message and delete it from a queue.
Note: You do not need to specify the accessKeyID, secret, roleArn and roleSessionName values if the event manager container or pod is configured with an AWS command line interface, or if HCL Universal Orchestrator is running on an Amazon EKS cluster.
Region
  • Type: string
  • minlength: 1
  • maxlength: 1000
  • Default: if the region is not specified, the default value is taken from what is configured in the local environment. If no region is configured in the local environment, the default region is us-east-1
Specify the region where the resources you are interacting with are located to optimize performances.
QueueURL
  • Type: string
  • Required
  • minlength: 1
  • maxlength: 1000
Specify the URL of an existing AWS SQS queue.
maxMessages
  • Type: nonnegativeinteger
  • minlength: 1
  • maxlength: 1000
  • Default: if no value is specified, the maximum amount of messages that can be received is 10
Specify the maximum amount of messages that can be received from an AWS SQS queue.
pollInterval
  • Type: nonnegativeinteger
  • minlength: 1
  • maxlength: 1000
  • Default: if no value is specified, the interval between message polling instances is 1 second
You can define the interval between message polling instances.

Example

The following is an example of a generic type event source configured to receive AWS SQS event type:
$eventsource

EVENT_SOURCE /AWSEvents1
DESCRIPTION "AWSEvents testing"
PLUGIN AWSEvents
TYPE SQS
CONFIGURATION {

      "accessKeyID": "accessKeyIDvalue",
      "secret": "secretvalue",
      "queueURL": "queueURLvalue",
      "maxMessages": "1000",
      "pollinMS": "30"

         }
END

AWS SQS event condition

AWS SQS event conditions can be configured in workflows specifying the following required properties:
  • Name
    Restriction: If you want to start the event condition name with the prefix "in", ensure that the name is enclosed within double quotes.
  • Type
  • Event source
Note: When defining event conditions, all the relative fields are case insensitive
You can also specify any number of properties that filter the events received from the event source:
Message
  • Type: string
  • Operator: EQ("=") or NE("!=")
  • minlength: 1
  • maxlength: 1000
  • Wildcard allowed: true
  • Multiple filters: false
  • Single predicate: true
  • Case sensitive: false
Specify the AWS SQS message body to enable filtering of events that either match or do not match the specified input.
Attributes
  • Type: map
  • Operator: KEY_VALUE("keyvalue")
  • minlength: 1
  • maxlength: 1000
  • Wildcard allowed: true
  • Multiple filters: false
  • Single predicate: false
  • Case sensitive: false
Specify the attributes contained in the AWS SQS message to enable filtering of events that either match or do not match the specified input.
Message attributes
  • Type: map
  • Operator: KEY_VALUE("keyvalue")
  • minlength: 1
  • maxlength: 1000
  • Wildcard allowed: true
  • Multiple filters: false
  • Single predicate: false
  • Case sensitive: false
Specify the AWS SQS message metadata attributes to enable filtering of events that either match or do not match the specified input.
Message ID
  • Filtering allowed
The AWS SQS message ID to enable filtering of events that either match or do not match the specified input.

Example

The following is an example of a workflow with two AWS SQS event conditions:
$jobstream

WORKFLOW /WS_AGT_1#/WF_EVT_TRIGGER_AWS
  TRIGGER TRIGGER_AWS DESCRIPTION "Sample event trigger AWS" TIMEOUT PT3M CONDITIONS
    NAME EC TYPE "AWSEvents/SqsEvent" SOURCE /AWS1 FILTERS messageAttributes keyvalue {keyAttr,valAttr}
    NAME EC_2 TYPE "AWSEvents/SqsEvent" SOURCE /AWS1 FILTERS message = "test message"
  ENDTRIGGER
:
END