Integrating event-driven applications with Service Quotas using Amazon EventBridge - Service Quotas

Integrating event-driven applications with Service Quotas using Amazon EventBridge

With Amazon EventBridge rules, you can monitor Service Quotas events and AWS Health notifications to automate responses when quotas change or approach their limits. To monitor these Service Quotas events, you'll need to start Service Quotas Automatic Management. These events trigger remediation actions when quota utilization changes occur.

You do this by using Amazon EventBridge to route events from Service Quotas to other software components. Amazon EventBridge is a serverless service that uses events to connect application components together, making it easier for you to integrate AWS services like Service Quotas into event-driven architectures without additional code and operations.

How EventBridge routes Service Quotas events

Here's how EventBridge works with Service Quotas events:

As with many AWS services, Service Quotas generates and sends events to the EventBridge default event bus. An event bus is a router that receives events and routes them to the destinations, or targets, that you specify. Targets can include other AWS services, custom applications, and SaaS partner applications.

EventBridge routes events according to rules you create on the event bus. For each rule, you specify a filter, or event pattern, to select only the events you want. Whenever an event is sent to the event bus, EventBridge compares it against each rule. If the event matches the rule, EventBridge routes the event to the specified target(s).

AWS services send events to the EventBridge default event bus. If the event matches a rule's event pattern, EventBridge routes the event to the targets specified for that rule.

Service Quotas events

For a list of Service Quotas events sent to EventBridge, refer to the Service Quotas topic in the EventBridge Events Reference.

Event structure

All events from AWS services contain two types of data:

  • A common set of fields containing metadata about the event, such as the AWS service that is the source of the event, the time the event was generated, the account and region in which the event took place, and others. For definitions of these general fields, see Event structure in the Amazon EventBridge Events Reference.

  • A detail field that contains data specific to that particular service event.

Service Quotas event delivery via AWS CloudTrail

AWS services can send events directly to the EventBridge default event bus. In addition, AWS CloudTrail sends events originating from numerous AWS services to EventBridge as well. These events can include API calls, console signins and actions, service events, and CloudTrail Insights. For more information, see AWS service events delivered via AWS CloudTrail in the EventBridge User Guide.

Creating event patterns that match Service Quotas events

Event patterns are filters that specify the data to match the events you want to select.

Each event pattern is a JSON object that contains:

  • A source attribute that identifies the service sending the event. For Service Quotas events generated by Automatic Management, the source is aws.health.

  • A detail-type attribute set to AWS Health Events, which specifies the type of event.

  • A detail attribute containing the following fields:

    • A service field set to SERVICEQUOTAS

    • An eventTypeCode field that matches one or more of these values:

      • AWS_SERVICEQUOTAS_APPROACHING_THRESHOLD

      • AWS_SERVICEQUOTAS_THRESHOLD_BREACH

    • An eventTypeCategory field set to accountNotification

For example, the following event pattern would select all Event Name events from Service Quotas:

{ "source": ["aws.health"], "detail-type": ["AWS Health Event"], "detail": { "service": ["SERVICEQUOTAS"], "eventTypeCode": [ "AWS_SERVICEQUOTAS_THRESHOLD_BREACH", "AWS_SERVICEQUOTAS_APPROACHING_THRESHOLD" ], "eventTypeCategory": ["accountNotification"] } }

The following describes the different event type codes.

  • AWS_SERVICEQUOTAS_THRESHOLD_BREACH - Monitors Service Quotas that cannot be adjusted. You'll need to optimize your quota utilization to mitigate further Service Quotas threshold breach.

  • AWS_SERVICEQUOTAS_APPROACHING_THRESHOLD - Monitors Service Quotas that can be adjusted. You can optimize your quota utilization or Requesting a quota increase to mitigate further Service Quotas approaching threshold.

For more information on writing event patterns, see Event patterns in the EventBridge User Guide.

Receiving events from EventBridge

With Service Quotas Automatic Management, you can specify your custom applications as targets for EventBridge rules. This enables your applications to receive events from AWS services like Service Quotas. For more information, see Creating rules that react to events in the EventBridge User Guide.

For a full list of the AWS services that you can specify as targets, see Target types in the EventBridge Events Reference.