Skip to main content

AWS CloudFormation logs

Get observability into your AWS CloudFormation events in Coralogix. An EventBridge rule matches the events your account emits and forwards them to an API destination pointed at Coralogix, so stack status changes land alongside the rest of your AWS telemetry.

What you need

  • A Coralogix account on the domain matching the region your data should be stored in. Sign up if you do not have one.
  • A Coralogix Send-Your-Data API key.
  • An AWS account with permission to manage Lambda functions, signed in as an administrator.
  • The events endpoint for your Coralogix domain. Use the domain selector at the top of this page to resolve it: https://ingress./aws/event-bridge

Create a stack

This stack gives you something that emits CloudFormation events. Skip it if you already have stacks to observe.

1.
Start the stack

On the CloudFormation page, select Create stack, then With new resources.

2.
Supply the template

Under the stack options, select Template is ready, then upload a .yaml file from S3 or your machine. For example:

Resources:
LambdaFunction:
Type: 'AWS::Lambda::Function'
Properties:
FunctionName: AwsLambdaExample
Handler: index.handler
Runtime: nodejs20.x
Role: !GetAtt LambdaFunctionRole.Arn
MemorySize: 1024
Code:
ZipFile: |
exports.handler = async (event) => {
return "Hello World!";
};
LambdaFunctionRole:
Type: 'AWS::IAM::Role'
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service:
- lambda.amazonaws.com
Action:
- sts:AssumeRole
Path: "/"
Policies:
- PolicyName: AppendToLogsPolicy
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
Resource: "*"
3.
Name and submit it

Select Next, give the stack a name, then select Next and submit. No other changes are needed.

Note

CloudFormation may create IAM resources as part of this stack.

Create the API destination

1.
Start the destination

In Amazon EventBridge, select Create API destination in the API destinations section, and give it a name.

2.
Point it at Coralogix

Enter the events endpoint for your Coralogix domain as the endpoint, set HTTP method to POST, and set the invocation rate limit per second to 300.

3.
Authorize it

Set Authorization type to API Key. Name the key x-amz-event-bridge-access-key and enter your Send-Your-Data API key as its value.

EventBridge connection form with destination type Other, authorization type API Key, and the API key name and value fields

Shows the connection that carries the Coralogix API key on every forwarded event.

Create the EventBridge rule

1.
Name the rule

Create a rule named CoralogixRule, leaving the other settings at their defaults, and select Next.

2.
Match the events

Select All Events, then Next.

3.
Set the target

Select EventBridge API destination and pick the destination you created.

4.
Create it

Select Next through the remaining steps, then create the rule.

Warning

Matching all events forwards every event in the account, which can increase your AWS costs. Narrow the pattern if you only need CloudFormation events.

Validate

In Coralogix, filter the Explore screen by the aws.cloudformation subsystem. Each stack status change arrives with its detail-type, source, stack ARN, and status.

Coralogix Explore screen showing a CloudFormation Stack Status Change event with source and status fields marked

Shows a stack reaching CREATE_COMPLETE, filed under the aws.cloudformation subsystem.

The Lambda execution logs arrive alongside them.

Coralogix log entries from the Lambda extension showing request ID, extension state, and subscribed event types

Shows the Lambda side of the same stack operation.

Last updated on
On this page
Was this page helpful?