Alarm on the AWS/Usage service quota metric for Fargate task count

Answer Correct answer: B — Alarm on the AWS/Usage service quota metric with a metric/SERVICE_QUOTA expression above 80 percent and notify via SNS.

A company is running a large containerized workload in the AWS Cloud. The workload consists of approximately 100 different services. The company uses Amazon Elastic Container Service (Amazon ECS) to orchestrate the workload. Recently the company’s development team started using AWS Fargate instead of Amazon EC2 instances in the ECS cluster. In the past, the workload has come close to running the maximum number of EC2 instances that are available in the account. The company is worried that the workload could reach the maximum number of ECS tasks that are allowed. A solutions architect must implement a solution that will notify the development team when Fargate reaches 80% of the maximum number of tasks. What should the solutions architect do to meet this requirement?

  1. Use Amazon CloudWatch to monitor the Sample Count statistic for each service in the ECS cluster. Set an alarm for when the math expression sample count/SERVICE_QUOTA(service)*100 is greater than 80. Notify the development team by using Amazon Simple Notification Service (Amazon SNS).
  2. Use Amazon CloudWatch to monitor service quotas that are published under the AWS/Usage metric namespace. Set an alarm for when the math expression metric/SERVICE_QUOTA(metric)*100 is greater than 80. Notify the development team by using Amazon Simple Notification Service (Amazon SNS). Correct Answer
  3. Create an AWS Lambda function to poll detailed metrics from the ECS cluster. When the number of running Fargate tasks is greater than 80, invoke Amazon Simple Email Service (Amazon SES) to notify the development team.
  4. Create an AWS Config rule to evaluate whether the Fargate SERVICE_QUOTA is greater than 80. Use Amazon Simple Email Service (Amazon SES) to notify the development team when the AWS Config rule is not compliant.

Community Votes

B
100%

100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

Service quotas publish their current usage in the AWS/Usage metric namespace, so a metric math expression dividing that usage by the corresponding service quota and thresholding at eighty percent is the direct way to express the requirement.

A company runs about 100 services in an ECS cluster, recently moved from EC2 instances to Fargate, and previously came close to the account's maximum EC2 instance count. They now need notification when Fargate reaches eighty percent of the maximum number of tasks allowed.

Monitoring the Sample Count statistic per ECS service. Sample Count reflects the number of data points in a period rather than the account's consumed task quota, and combining it with SERVICE_QUOTA in a math expression does not compare usage against a quota, so the alarm would not fire on the intended condition.

Community Discussion (4 comments)

kupo777 👍 5
B https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Quotas-Visualize-Alarms.html
Daniel76 👍 1 Selected: B
C and D are out due to using SES and not SNS for simple notification. Among A and B, A is out because CloudWatch alarm was set with SERVICE_QUOTA but the option choose to monitor sample count stats instead of service quota published.
Chakanetsa 👍 3 Selected: B
Why this is the correct choice: AWS/Usage metric namespace: This namespace provides detailed metrics for service usage and quotas, including the number of running ECS Fargate tasks. You can use this data to monitor how close you are to the service quotas. Service quota monitoring: The math expression metric/SERVICE_QUOTA(metric)*100 allows you to calculate the percentage of the quota being used, making it easy to set an alarm when usage reaches 80%. CloudWatch Alarm: This is a native and efficient way to monitor service usage, and you can easily configure notifications via Amazon SNS to alert the development team when the threshold is crossed.
c22ddd8 👍 2 Selected: B
Service Quota

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

The requirement is a percentage of a service quota, and AWS publishes service quota usage in the AWS/Usage metric namespace. A CloudWatch alarm can be built on that metric with a math expression of metric divided by SERVICE_QUOTA for the same metric, multiplied by 100, and set to alarm when the result exceeds 80. That expression compares actual consumed Fargate task count against the account's maximum task quota and fires precisely at the required threshold, and Amazon SNS notifies the development team. No polling code is required, so nothing has to be maintained between the metric and the alarm.

Why the Other Options Are Wrong

A: The Sample Count statistic reports how many data points exist for a statistic in a period, not how much of a service quota is consumed, so dividing it by SERVICE_QUOTA does not produce a utilisation percentage and the alarm would not represent the intended condition. C: A Lambda function that polls detailed metrics on a schedule is custom code to maintain, introduces polling delay, and uses Amazon SES for a notification that should be a simple topic-based alert, so it is the highest-effort answer with the wrong notification mechanism. D: AWS Config rules evaluate resource configuration compliance, not live service quota consumption, so a rule checking whether the Fargate SERVICE_QUOTA is above eighty percent is comparing the wrong values, since the quota itself is a static number rather than a measure of usage.

Community Comment Notes

The community voted 100 to 0 for B, and the top-voted comment linked the CloudWatch documentation on visualizing and alarming on service quotas. Another explained the elimination of A precisely, that the alarm in A was set with SERVICE_QUOTA but the option chose to monitor the Sample Count statistic instead, so the expression does not measure utilisation. Commenters also noted that C and D use Amazon SES rather than SNS, which is the wrong choice for a simple developer notification.

Official Reference

Related Analysis

Practice All SAP-C02 Questions

Access 85 questions with complete answers and detailed explanations.

View Full SAP-C02 Practice Test →

← Back to SAP-C02 Study Guide