tb_pulumi.cloudwatch

Infrastructural patterns related to AWS CloudWatch.

class tb_pulumi.cloudwatch.AlbAlarmGroup(name: str, project: ThunderbirdPulumiProject, resource: LoadBalancer, monitoring_group: CloudWatchMonitoringGroup, opts: ResourceOptions = None, **kwargs)

Bases: AlarmGroup

Pulumi Type: tb:cloudwatch:AlbAlarmGroup

A set of alarms for Application Load Balancers. Contains the following configurable alarms:

  • alb_5xx: Alarms on the number of HTTP responses sourced within the load balancer with status codes in the 500-599 range, indicating a count of internal server errors. This metric concerns the load balancer itself, and does not contain any response codes generated by the targets. Defaults to alarming on 10 errors in 1 minute.

  • target_5xx: Alarms on the number of HTTP responses sourced within the load balancer’s targets with status codes in the 500-599 range, indicating a count of internal server errors. This metric concerns the applications the load balancer points to, and does not contain any response codes generated by the load balancer itself. Defaults to alarming on 10 errors in 1 minute.

  • response_time: Alarms on the average response time of HTTP requests. Defaults to alarming if the average response time over a minute is longer than 1 second.

Further detail on these metrics and others can be found within Amazon’s ALB metrics documentation.

Parameters:
  • name (str) – The name of the the AlbAlarmGroup resource.

  • project (tb_pulumi.ThunderbirdPulumiProject) – The ThunderbirdPulumiProject being monitored.

  • resource (aws.lb.load_balancer.LoadBalancer) – The aws.lb.load_balancer.LoadBalancer being monitored.

  • monitoring_group (CloudWatchMonitoringGroup) – The CloudWatchMonitoringGroup this alarm group belongs to.

  • opts (pulumi.ResourceOptions, optional) – Additional pulumi.ResourceOptions to apply to this resource. Defaults to None.

  • kwargs – Any other keyword arguments which will be passed as inputs to the tb_pulumi.monitoring.AlarmGroup superconstructor.

class tb_pulumi.cloudwatch.AlbTargetGroupAlarmGroup(name: str, project: ThunderbirdPulumiProject, resource: TargetGroup, monitoring_group: CloudWatchMonitoringGroup, opts: ResourceOptions = None, **kwargs)

Bases: AlarmGroup

Pulumi Type: tb:cloudwatch:CloudFrontDistributionAlarmGroup

A set of alarms for ALB target groups. Contains the following configurable alarms:

  • unhealthy_hosts: Alarms on the number of unhealthy hosts in a target group. Defaults to alarm when the average of unhealthy hosts is over 1 in 1 minute.

Further detail on these metrics and others can be found within Amazon’s Target Group metric documentation.

Parameters:
  • name (str) – The name of the the AlbTargetGroupAlarmGroup resource.

  • project (tb_pulumi.ThunderbirdPulumiProject) – The ThunderbirdPulumiProject being monitored.

  • resource (aws.lb.target_group.TargetGroup) – The aws.lb.target_group.TargetGroup being monitored.

  • monitoring_group (CloudWatchMonitoringGroup) – The CloudWatchMonitoringGroup this alarm group belongs to.

  • opts (pulumi.ResourceOptions, optional) – Additional pulumi.ResourceOptions to apply to this resource. Defaults to None.

  • kwargs – Any other keyword arguments which will be passed as inputs to the tb_pulumi.monitoring.AlarmGroup superconstructor.

class tb_pulumi.cloudwatch.CloudFrontDistributionAlarmGroup(name: str, project: ThunderbirdPulumiProject, resource: Distribution, monitoring_group: CloudWatchMonitoringGroup, opts: ResourceOptions = None, **kwargs)

Bases: AlarmGroup

Pulumi type: tb:cloudwatch:CloudFrontDistributionAlarmGroup

A set of alarms for CloudFront distributions. Contains the following configurable alarms:

  • distro_4xx: Alarms on the rate of HTTP responses with status codes in the 400-499 range, indicating an elevated number of calls to invalid files. This value is reported as a percentage of all responses. Defaults to alarm on at least 10% 4xx codes in 1 minute.

Further details about these metrics and more can be found in Amazon’s CloudFront distribution documentation.

Parameters:
  • name (str) – The name of the CloudFrontDistributionAlarmGroup resource.

  • project (tb_pulumi.ThunderbirdPulumiProject) – The ThunderbirdPulumiProject being monitored.

  • resource (aws.cloudfront.Distribution) – The aws.cloudfront.Distribution being monitored.

  • monitoring_group (CloudWatchMonitoringGroup) – The CloudWatchMonitoringGroup this alarm group belongs to.

  • opts (pulumi.ResourceOptions, optional) – Additional pulumi.ResourceOptions to apply to this resource. Defaults to None.

  • kwargs – Any other keyword arguments which will be passed as inputs to the tb_pulumi.monitoring.AlarmGroup superconstructor.

class tb_pulumi.cloudwatch.CloudFrontFunctionAlarmGroup(name: str, project: ThunderbirdPulumiProject, resource: Function, monitoring_group: CloudWatchMonitoringGroup, opts: ResourceOptions = None, **kwargs)

Bases: AlarmGroup

Pulumi Type: tb:cloudwatch:CloudFrontFunctionAlarmGroup

A set of alarms for CloudFront functions. Contains the following configurable alarms:

  • cpu_utilization: Alarms when the function’s compute utilization is excessive. This value is reported as a percentage of its allotted CPU. Defaults to alarm when the function’s CPU usage has been over 80% on average for 1 minute.

Further details about these metrics and more can be found in Amazon’s CloudFront Functions documentation.

Parameters:
  • name (str) – The name of the the CloudFrontFunctionAlarmGroup resource.

  • project (tb_pulumi.ThunderbirdPulumiProject) – The ThunderbirdPulumiProject being monitored.

  • resource (aws.cloudfront.Function) – The aws.cloudfront.Function being monitored.

  • monitoring_group (CloudWatchMonitoringGroup) – The CloudWatchMonitoringGroup this alarm group belongs to.

  • opts (pulumi.ResourceOptions, optional) – Additional pulumi.ResourceOptions to apply to this resource. Defaults to None.

  • kwargs – Any other keyword arguments which will be passed as inputs to the tb_pulumi.monitoring.AlarmGroup superconstructor.

class tb_pulumi.cloudwatch.CloudWatchMonitoringGroup(name: str, project: ThunderbirdPulumiProject, config: dict = {}, notify_emails: list[str] = [], opts: ResourceOptions = None, tags: dict = {})

Bases: MonitoringGroup

Pulumi Type: tb:cloudwatch:CloudWatchMonitoringGroup

A MonitoringGroup that monitors AWS-based resources using AWS’s CloudWatch service and sends alerts using SNS-to-email.

Produces the following resources:

  • sns_topic - aws.sns.Topic to notify when an alarm in this monitoring group is triggered.

  • sns_subscriptions - A list of aws.sns.TopicSubscription <https://www.pulumi.com/registry/packages/aws/api-docs/sns/topicsubscription/>`_s, one for each entry in ``notify_emails`.

  • alarms - A list of alarms contained in this monitoring group. These may be any kind of alarm in the aws.cloudwatch library.

Parameters:
  • name (str) – The name of the CloudWatchMonitoringGroup resource.

  • project (tb_pulumi.ThunderbirdPulumiProject) – The ThunderbirdPulumiProject to build monitoring resources for.

  • config (dict, optional) – A configuration dictionary for this monitoring group. Documentation for tb_pulumi.monitoring.MonitoringGroup defines the overall structure of this dict. The monitors are defined as CloudWatch Metric Alarms and can be configured with the inputs documented here. Defaults to {}.

  • notify_emails (list, optional) – A list of email addresses to notify when an alarm activates.

  • opts (pulumi.ResourceOptions, optional) – Additional pulumi.ResourceOptions to apply to this resource. Defaults to None.

  • tags (dict, optional) – Key/value pairs to merge with the default tags which get applied to all resources in this group. Defaults to {}.

monitor(outputs)

This function gets called only after all outputs in the project have been resolved into values. It constructs all monitors for the resources in this project.

Parameters:

outputs (list) – A list of resolved outputs discovered in the project.

class tb_pulumi.cloudwatch.EcsServiceAlarmGroup(name: str, project: ThunderbirdPulumiProject, resource: Service, monitoring_group: CloudWatchMonitoringGroup, opts: ResourceOptions = None, **kwargs)

Bases: AlarmGroup

Pulumi Type: tb:cloudwatch:EcsServiceAlarmGroup

A set of alarms for ECS services. Contains the following configurable alarms:

  • cpu_utilization: Alarms on the overall CPU usage of the entire service, all tasks combined. Threshold is a percentage.

  • memory_utilization: Alarms on the overall memory usage of the entire service, all tasks combined. Threshold is a percentage.

Further detail on these metrics and more can be found on Amazon’s documentation <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/available-metrics.html>_.

Parameters:
  • name (str) – The name of the EcsServiceAlarmGroup resource.

  • project (tb_pulumi.ThunderbirdPulumiProject) – The ThunderbirdPulumiProject being monitored.

  • resource (aws.ecs.Service) – The Pulumi resource being monitored.

  • monitoring_group (CloudWatchMonitoringGroup) – The CloudWatchMonitoringGroup this is a member of.

  • opts (pulumi.ResourceOptions, optional) – Additional pulumi.ResourceOptions to apply to this resource. Defaults to None.

  • kwargs – Any other keyword arguments which will be passed as inputs to the tb_pulumi.monitoring.AlarmGroup superconstructor.

class tb_pulumi.cloudwatch.LoadBalancerAlarmGroup(name: str, project: ThunderbirdPulumiProject, resource: LoadBalancer, monitoring_group: CloudWatchMonitoringGroup, opts: ResourceOptions = None, **kwargs)

Bases: AlarmGroup

In AWS, a load balancer can have a handful of types: application , gateway , or network . The metrics emitted by the load balancer - and therefore the kinds of alarms we can build - depend on which type it is. However, all types are represented by the same class, aws.lb.load_balancer.LoadBalancer . This necessitates a class for disambiguation. The load_balancer_type is an Output, so here we wait until we can determine that type, then build the appropriate AlarmGroup class for the resource.

Parameters:
  • name (str) – The name of the alarm group resource.

  • monitoring_group (MonitoringGroup) – The MonitoringGroup that this AlarmGroup belongs to.

  • project (tb_pulumi.ThunderbirdPulumiProject) – The ThunderbirdPulumiProject whose resources are being monitored.

  • resource (pulumi.Resource) – The Pulumi Resource object this AlarmGroup is building alarms for.

  • opts (pulumi.ResourceOptions, optional) – Additional pulumi.ResourceOptions to apply to this resource. Defaults to None.

  • kwargs – Any other keyword arguments which will be passed as inputs to the tb_pulumi.monitoring.AlarmGroup superconstructor.