integration/resources/templates/combination/connector_event_rule_to_lambda_write.yaml [1:37]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Resources:
  TriggerFunction:
    Type: AWS::Serverless::Function
    Properties:
      Runtime: nodejs18.x
      Handler: index.handler
      Timeout: 10  # in case eb has delay
      InlineCode: |
        const {
          EventBridge
        } = require("@aws-sdk/client-eventbridge"),
        {
          SQS
        } = require("@aws-sdk/client-sqs");

        exports.handler = async (event) => {
          const eb = new EventBridge();
          const response = await eb.putEvents({
            Entries: [{
              Source: process.env.EVENT_SOURCE,
              Detail: "{}",
              DetailType: "Test",
            }]
          });

          const sqs = new SQS();
          const data = await sqs.receiveMessage({
            QueueUrl: process.env.QUEUE_URL,
            WaitTimeSeconds: 5,
          });

          if (data.Messages.length == 0) {
            throw 'No messages in the queue!';
          }
        };
      Environment:
        Variables:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



integration/resources/templates/combination/connector_event_rule_to_sqs_write.yaml [1:37]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Resources:
  TriggerFunction:
    Type: AWS::Serverless::Function
    Properties:
      Runtime: nodejs18.x
      Handler: index.handler
      Timeout: 10  # in case eb has delay
      InlineCode: |
        const {
          EventBridge
        } = require("@aws-sdk/client-eventbridge"),
        {
          SQS
        } = require("@aws-sdk/client-sqs");

        exports.handler = async (event) => {
          const eb = new EventBridge();
          const response = await eb.putEvents({
            Entries: [{
              Source: process.env.EVENT_SOURCE,
              Detail: "{}",
              DetailType: "Test",
            }]
          });

          const sqs = new SQS();
          const data = await sqs.receiveMessage({
            QueueUrl: process.env.QUEUE_URL,
            WaitTimeSeconds: 5,
          });

          if (data.Messages.length == 0) {
            throw 'No messages in the queue!';
          }
        };
      Environment:
        Variables:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



