Skip to main content

AWS Kinesis Firehose Integration to Coralogix

This template can be used to deploy an AWS Kinesis Firehose Integration to send resource logs Coralogix.

For a more detailed description of the settigns and architecture of this AWS Kinesis Data Firehose setup, please refer to the Coralogix documentation on AWS Kinesis Data Firehose – Logs.

Prerequisites

  • AWS account.
  • Coralogix account.

Main Parameters

ParameterDescriptionDefault ValueRequired
CoralogixRegionThe region of your Coralogix Account. If set to Custom, you must provide a CustomDomain otherwise url will be invalid.Allowed Values:
- Custom
- EU1
- EU2
- AP1
- AP2
- AP3
- US1
- US2
- US3
Default: Custom
CustomDomainThe Custom Coralogix domain. If set, will be the domain to send telemetry.
ApiKeyYour Coralogix Private Key. Required unless ApiKeySecretArn is set.✅ (unless using ApiKeySecretArn)
ApiKeySecretArnARN of a Secrets Manager secret holding the Coralogix API key as JSON {"api_key": "..."}. When set, Firehose reads the key at runtime so rotating the secret takes effect without a stack update. Must be in the same region as the delivery stream. See AWS Firehose Secrets Manager.✅ (unless using ApiKey)
ApiKeyKmsKeyArnARN of the KMS key used to encrypt the Secrets Manager secret. Required only when the secret uses a customer-managed key (CMK).
ApplicationNameYour Coralogix Application name
SubsystemNameYour Coralogix Subsystem name

Log Stream Parameters

ParameterDescriptionDefault ValueRequired
IntegrationTypeLogsThe data structure of the Firehose delivery stream for logsAllowed Values:
- CloudWatch_JSON
- WAF
- CloudWatch_CloudTrail
- EksFargate
- Default
- RawText
DynamicMetadataLogsWhen set to true, it fetches the applicationName / subsystemName dynamically for logsfalse
KinesisStreamAsSourceARNIf KinesisStreamAsSource for logs is desired, input the ARN of the Kinesis stream

Optional Parameters

ParameterDescriptionDefault ValueRequired
CloudwatchRetentionDaysDays of retention in Cloudwatch retention days1

Notes:

  • Provide either ApiKey or ApiKeySecretArn (or both; the secret wins). ApiKeySecretArn requires a JSON secret {"api_key": "..."} — a different format from plaintext secrets used with ApiKey or CloudFormation {{resolve:secretsmanager:...}} dynamic references.
  • Switching an existing stack from ApiKey to ApiKeySecretArn replaces the Firehose delivery stream (the stream name becomes auto-generated). Update any CloudWatch Logs subscription filters that target the previous stream ARN after the update.
  • When ApiKeySecretArn is set, the Coralogix integration status notifier is omitted (it cannot read the runtime secret).
  • If you want to use the Kinesis Stream as a source for logs, you must create the Kinesis Stream before deploying the Cloudformation template and set the KinesisStreamAsSourceARN parameter to the ARN of the Kinesis Stream.

Dynamic Values Table for Logs

For ApplicationName and/or SubsystemName to be set dynamically in relation to their integrationType resource fields (e.g. CloudWatch_JSON's loggroup name, EksFargate's k8s namespace). The source's var has to be mapped as a string literal to the integrationType's as a DyanamicFromFrield with pre-defined values:

FieldSource varExpected String LiteralIntegration TypeNotes
applicationName field in logsapplicationName${applicationName}Defaultneed to be supplied in the log to be used
subsystemName field in logssubsystemName${subsystemName}Defaultneed to be supplied in the log to be used
CloudWatch LogGroup namelogGroup${logGroup}CloudWatch_JSON
CloudWatch_CloudTrail
supplied by aws
kubernetes.namespace_name fieldkubernetesNamespaceName${kubernetesNamespaceName}EksFargatesupplied by the default configuration
kubernetes.container_name fieldkubernetesContainerName${kubernetesContainerName}EksFargatesupplied by the default configuration
name part of the log.webaclId fieldwebAclName${webAclName}WAFsupplied by aws

For more information - visit Kinesis Data Firehose - Logs.

Note: RawText integrationType does not support dynamic values.

Deploy the Cloudformation template using aws cli

With the aws cli installed and configured, run the following command:

aws cloudformation create-stack --stack-name <stack_name> --template-body template.yaml --capabilities CAPABILITY_AUTO_EXPAND CAPABILITY_IAM CAPABILITY_NAMED_IAM --parameter-overrides CoralogixDomain=<domain> ApiKey=<coralogix_api_key> ApplicationName=<application_name> SubsystemName=<subsystem_name>

or with a parameters json file example:

aws cloudformation create-stack --stack-name <stack_name> --template-body template.yaml --parameters parameters.json --capabilities CAPABILITY_AUTO_EXPAND CAPABILITY_IAM CAPABILITY_NAMED_IAM
Last updated on