The cloud.aws.cloudwatch.events tag identifies log events generated by the Amazon CloudWatch Events service. For more information about CloudWatch and this kind of information it makes available to you, consult the vendor documentation.
The tag has four levels which are fixed as cloud.aws.cloudwatch.events. All events sent with this tag are saved in a Devo data table of the same name.
For more information, read more about Devo tags.
Forwarding the events
To collect and forward data from CloudWatch Events to Devo, you will create an AWS Lambda function designed to receive data from a CloudWatch rule and forward them securely to Devo. We provide the source code and files required to create the function. You only need to use these files to create the function, customize a few environment variables, and set up the CloudWatch rule that will start forwarding data.
This article takes you step-by-step through the configuration process:
Download the source code files
Click here to download the cloudwatch-to-devo zip file. It contains two folders and three files at the root level.
Download your Devo domain certificate files
Log into the Devo web application, go to Administration → Credentials → X.509 Certificates and download the X.509 Certificate and Private Key to the /certs folder of the source code files.
Prepare the ZIP file for upload
Having added the certificate files, your source code is complete.
For troubleshooting the initial setup, you can enable the logging of additional events related to the Lambda function's activity. These will appear in the function's log file available in CloudWatch - Logs. To enable this logging, open the index.js file and uncomment the lines that start with console.log. Later, when you have confirmed that events are being correctly streamed to your Devo domain, you can edit the file and recomment the console.log lines.
Create a .zip file containing the certs and node_modules folders, index.js, and package.json. You can name it anything you like.
Create the Lambda function
This procedure guides you through creating the new Lambda function that will receive the CloudWatch events.
Log into your AWS Console, go to Lambda → Functions. Click Create function.
Select Author from scratch, then enter the Basic information required:
- Function name: SendCloudWatchEventsToDevo
- Runtime: Node js 8.10
- Execution role: Create a new role with basic Lambda permissions
Click Create function.
In the Function code area, select Upload a .zip file as the Code entry type. Click Upload and select the .zip file you created in the last main step. Click Save.
In the Environment variables area, define the following variables:
chain_eu.crt (for the EU region)
chain_us.crt (for the US region)
eu.elb.relay.logtrust.net (for the EU region)
us.elb.relay.logtrust.net (for the US region)
In the Tags area, we recommend that you define the following tags (although it's not obligatory, it's good practice):
In Basic settings area, enter a useful Description like This function receives events from a CloudWatch rule and sends them to Devo <domain name>. You can accept the default values for Memory (128MB) and Timeout (3 seconds).
- Establish version-tracking by selecting Publish new version from the Actions menu. Enter a description if you like and click Publish.
Your new Lambda function is now ready to receive data from CloudWatch Events. Next, you will set up the rule that will send the data to the Lambda function.
Set up the CloudWatch rule
- Log into your AWS Console, go to CloudWatch → Rules. Click Create rule. This launches a wizard.
- In Step 1, under Event Source, select Event Pattern and Build event pattern to match all events. Under Targets, select Lambda function, then select the name and version of the function you just created. Click Configure details.
In Step 2, under Rule definition, enter a Name for the new rule, for example, SendCloudWatchEventstoLambdaFunction. You may optionally enter a description but be sure to select the State checkbox to enable the rule. Click Create rule.
With both the rule and the Lambda function enabled, events should begin to flow to your Devo domain. Look out for the cloud.aws.cloudwatch.events table to appear in your Finder.
If the table doesn't appear in your domain's Finder after 10 minutes, here are some things you can do to troubleshoot the problem:
- Go to CloudWatch - Logs and open the Log Group for the Lambda function you created. If there are errors, they will appear here.
- Make sure the Lambda function's environment variable definitions match the certificate file names in the .zip that you uploaded.
- Select your Lambda function and click Test to make sure the function is working properly. We recommend that you copy the JSON of an existing event from the function's CloudWatch log to use in the test event.
- Go to CloudWatch - Rules and make sure that your rule Status is active.