Registry / aws / aws-cdk-aws-cloudwatch

aws-cdk-aws-cloudwatch

JSON →
library1.204.0pypypiunverified

The `aws-cdk-aws-cloudwatch` library is part of the AWS Cloud Development Kit (CDK) v1, providing Python constructs for provisioning and managing AWS CloudWatch resources, including metrics, alarms, and dashboards. This specific package, version 1.204.0, was released on June 19, 2023. AWS CDK v1 officially reached End-of-Support on June 1, 2023, meaning it no longer receives maintenance, updates, patches, or technical support. Users are strongly recommended to migrate to AWS CDK v2.

pip install aws-cdk.aws-cloudwatch aws-cdk.core
INSTALL
IMPORT
SIG · AWS-CDK-AWS-CLOUDW
A
aws-cdk-aws-cloudwatch
awspythonv1.204.0
Install
10.4s avg
Import
Disk
555MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.204.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.940 runs
installs and imports cleanly · install 0.0s · import 0.000s · 480MB
glibc
py 3.103.940 runs
installs and imports cleanly · install 10.4s · import 0.000s · 551MB
555MB installed
● package 555MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

aws_cloudwatch
from aws_cdk import aws_cloudwatch
from aws_cdk_lib import aws_cloudwatch
For CDK v1, `aws_cdk` is the top-level namespace. `aws_cdk_lib` is part of CDK v2's consolidated package.
Alarm
from aws_cdk.aws_cloudwatch import Alarm
Metric
from aws_cdk.aws_cloudwatch import Metric

This quickstart demonstrates how to create a basic AWS CloudWatch alarm using AWS CDK v1. It defines an SQS queue and sets up an alarm that triggers if the number of visible messages in the queue exceeds a specified threshold.

import os from aws_cdk import ( aws_cloudwatch as cw, aws_sqs as sqs, core as cdk ) class MyCloudWatchStack(cdk.Stack): def __init__(self, scope: cdk.Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, construct_id, **kwargs) queue = sqs.Queue(self, "MyQueue") # Create a metric for the number of visible messages in the SQS queue # Using a default SQS queue for demonstration purposes. queue_metric = queue.metric_approximate_number_of_messages_visible( period=cdk.Duration.minutes(5) ) # Create an alarm if the number of visible messages exceeds 100 cw.Alarm(self, "QueueHighMessagesAlarm", metric=queue_metric, threshold=100, evaluation_periods=1, comparison_operator=cw.ComparisonOperator.GREATER_THAN_THRESHOLD, alarm_description="Alarm when queue visible messages are too high" ) app = cdk.App() # Specify account and region for deployment (optional, but good practice) # env = cdk.Environment(account=os.environ.get('CDK_DEFAULT_ACCOUNT'), region=os.environ.get('CDK_DEFAULT_REGION')) MyCloudWatchStack(app, "CloudWatchV1Stack") app.synth()
cdk --version
Debug
Known issues
breakingAWS CDK v1 reached End-of-Support on June 1, 2023. It is no longer maintained, receives no updates, security patches, or technical support. Continuing to use v1 can expose your applications to security vulnerabilities and unaddressed bugs.
fix
Migrate your CDK applications to AWS CDK v2 immediately. Refer to the official 'Migrating to AWS CDK v2' guide.
affects: <=1.204.0
breakingThe AWS CDK v1 architecture uses separate PyPI packages for each AWS service (e.g., `aws-cdk.aws-cloudwatch`, `aws-cdk.aws-sqs`). AWS CDK v2 consolidates all stable constructs into a single package, `aws-cdk-lib`, simplifying dependency management but requiring import path changes.
fix
After installing `aws-cdk-lib`, update your import statements from `from aws_cdk import aws_service` (v1) to `from aws_cdk import aws_service` (v2), ensuring `aws_service` is imported from `aws_cdk-lib`. The `constructs` package is now a separate dependency.
affects: <=1.204.0
gotchaAWS CDK v2 requires a new 'modern' bootstrapping process for your AWS accounts. If you attempt to deploy v2 applications with an old v1 bootstrap, deployments will likely fail.
fix
Run `cdk bootstrap` with the AWS CDK v2 CLI installed (globally or locally via `npx aws-cdk bootstrap`). Ensure your CLI version is up-to-date with your `aws-cdk-lib` version.
affects: <=1.204.0
gotchaHardcoding resource names, ARNs, and environment-specific details makes CDK applications non-portable and difficult to maintain across different environments (dev, staging, prod).
fix
Utilize CDK's context system, environment variables, or AWS SSM Parameter Store/Secrets Manager to dynamically reference values. Specify `env` property in your stacks for clarity.
affects: *
Upgrade
Version history
1.204.0latest on PyPI · released Jun 19, 2023
Audit
Dependencies
aws-cdk.corerequiredRequired core library for AWS CDK v1 applications.
constructsrequiredCore library for defining constructs in CDK.
jsiioptionalRequired for inter-language operability in CDK.
typeguardoptionalRequired for runtime type checking in CDK's Python bindings.
Agent activity
16 hits · last 30 days
node
14
Resources
aws-cdk-aws-cloudwatch — pip install aws-cdk-aws-cloudwatch · libregistry