Lambda to forward logs from cloudwatch to coralogix Terraform module
This module implement forwarding cloudwatch logs to coralogix. The original Lambda code was taken from their github repo: Coralogix Github under src/cloudwatch, and then modified the appName and subName parameters to read from created triggers and correlate to the matching environment and application (Coralogix: ApplicationName and SubSystem):
let appName = process.env.app_name+"-"+resultParsed.subscriptionFilters[0];
let subName = resultParsed.logGroup;
* an environment equals in it's name to the Terraform workspace it runs under so when referring to an environment or workspace throughout this document their value is actually the same.
The following resources will be created:
- Lambda
- Role and Policy for the Lambda
- Log Group triggers for Lambda
The module requires some pre conditions
- Pre defined SSM Parameter: "/infra/coralogix/apikey
module "coralogix" {
source = "toluna-terraform/cloudwatch-integration/coralogix"
app_name = local.app_name
loggroup_envs = local.loggroup_envs
region = "us-east-1"
}
Name | Version |
---|---|
terraform | >= 1.0.0 |
aws | >= 3.59 |
Name | Version |
---|---|
aws | >= 3.59 |
null | >= 3.1.0 |
Name | Source | Version |
---|---|---|
coralogix | ../../ |
Name | Type |
---|---|
resource | |
aws_iam_role | resource |
aws_iam_policy | resource |
aws_iam_role_policy_attachment | resource |
aws_lambda_function | resource |
aws_lambda_permission | resource |
aws_cloudwatch_log_subscription_filter | resource |
null_resource | resource |
No inputs.
No outputs.