0
0
AWScloud~10 mins

Operational excellence pillar in AWS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a CloudWatch alarm that monitors CPU utilization.

AWS
resource "aws_cloudwatch_metric_alarm" "cpu_alarm" {
  alarm_name          = "HighCPU"
  comparison_operator = "[1]"
  evaluation_periods  = 2
  metric_name         = "CPUUtilization"
  namespace           = "AWS/EC2"
  period              = 300
  statistic           = "Average"
  threshold           = 80
  alarm_description   = "Alarm when CPU exceeds 80%"
}
Drag options to blanks, or click blank then click option'
ALessThanThreshold
BNotEqualToThreshold
CEqualToThreshold
DGreaterThanThreshold
Attempts:
3 left
💡 Hint
Common Mistakes
Using LessThanThreshold will alert when CPU is low, which is not desired here.
Using EqualToThreshold is too strict and rarely triggers.
2fill in blank
medium

Complete the code to enable detailed monitoring on an EC2 instance.

AWS
resource "aws_instance" "web" {
  ami           = "ami-12345678"
  instance_type = "t2.micro"
  monitoring    = [1]
}
Drag options to blanks, or click blank then click option'
A"enabled"
Bfalse
Ctrue
D"detailed"
Attempts:
3 left
💡 Hint
Common Mistakes
Using string values like "enabled" or "detailed" instead of boolean true.
Setting monitoring to false disables detailed monitoring.
3fill in blank
hard

Fix the error in the CloudFormation snippet to correctly create an S3 bucket with versioning enabled.

AWS
Resources:
  MyBucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: my-app-bucket
      VersioningConfiguration:
        Status: [1]
Drag options to blanks, or click blank then click option'
AEnabled
Benabled
CTrue
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase 'enabled' causes deployment failure.
Using boolean true or True is invalid here.
4fill in blank
hard

Fill both blanks to create an IAM policy statement that allows reading objects from a specific S3 bucket.

AWS
Statement:
  - Effect: Allow
    Action: [1]
    Resource: [2]
Drag options to blanks, or click blank then click option'
A"s3:GetObject"
B"s3:PutObject"
C"arn:aws:s3:::example-bucket/*"
D"arn:aws:s3:::example-bucket"
Attempts:
3 left
💡 Hint
Common Mistakes
Using PutObject action instead of GetObject.
Specifying the bucket ARN without /* does not cover objects.
5fill in blank
hard

Fill all three blanks to define a CloudWatch Logs subscription filter that sends error logs to a Lambda function.

AWS
resource "aws_cloudwatch_log_subscription_filter" "error_filter" {
  name            = "ErrorFilter"
  log_group_name  = [1]
  filter_pattern  = [2]
  destination_arn = [3]
}
Drag options to blanks, or click blank then click option'
A"/aws/lambda/my-function"
B"ERROR"
C"arn:aws:lambda:us-east-1:123456789012:function:my-lambda-function"
D"/aws/logs/my-log-group"
Attempts:
3 left
💡 Hint
Common Mistakes
Using the Lambda function name as log group name.
Using incorrect filter pattern syntax.
Confusing destination ARN with log group name.