0
0
AWScloud~30 mins

Log groups and log streams in AWS - Mini Project: Build & Apply

Choose your learning style9 modes available
PMC: Log groups and log streams
📖 Scenario: You are setting up logging for a simple application running on AWS. Logs help you see what is happening inside your app. AWS uses log groups to organize logs and log streams to hold the actual log entries.Think of a log group as a folder and log streams as files inside that folder. You want to create a log group and then add a log stream inside it.
🎯 Goal: Create an AWS CloudFormation template that defines a log group named MyAppLogGroup and a log stream named MyAppLogStream inside that log group.
📋 What You'll Learn
Create a CloudFormation resource for a log group named MyAppLogGroup
Create a CloudFormation resource for a log stream named MyAppLogStream
The log stream must be inside the MyAppLogGroup log group
Use valid AWS CloudFormation syntax for both resources
💡 Why This Matters
🌍 Real World
Logging is essential for monitoring and troubleshooting applications running on AWS. Organizing logs into groups and streams helps keep logs manageable and accessible.
💼 Career
Cloud engineers and DevOps professionals often create and manage log groups and streams using infrastructure as code tools like CloudFormation to automate deployments and maintain consistency.
Progress0 / 4 steps
1
Create the log group resource
Create a CloudFormation resource named MyAppLogGroup of type AWS::Logs::LogGroup with the property LogGroupName set to MyAppLogGroup.
AWS
Need a hint?

Use the Resources section to define your log group resource with the exact name and type.

2
Add the log stream resource
Add a CloudFormation resource named MyAppLogStream of type AWS::Logs::LogStream with the property LogStreamName set to MyAppLogStream. Do not link it to the log group yet.
AWS
Need a hint?

Define the log stream resource under Resources with the exact name and type.

3
Link the log stream to the log group
Add the property LogGroupName with the value MyAppLogGroup to the MyAppLogStream resource to link it to the log group.
AWS
Need a hint?

Inside the Properties of MyAppLogStream, add LogGroupName: MyAppLogGroup.

4
Complete the CloudFormation template
Add the YAML document start marker --- at the very top of the template to complete the CloudFormation template.
AWS
Need a hint?

The YAML document start marker is three dashes --- at the very top of the file.