Registry / aws / aws-cdk-aws-autoscaling

aws-cdk-aws-autoscaling

JSON →
library1.204.0pypypiunverified

The `aws-cdk-aws-autoscaling` package provides CDK constructs for AWS Auto Scaling services, enabling infrastructure-as-code deployment of Auto Scaling Groups, lifecycle hooks, and scaling policies. This specific package is part of the AWS CDK v1 ecosystem. As of version 1.204.0, it is actively maintained within the v1 branch but the primary development focus has shifted to AWS CDK v2, which consolidates all constructs into `aws-cdk-lib`. CDK releases are frequent, typically weekly or bi-weekly.

pip install aws-cdk-aws-autoscaling aws-cdk.core aws-cdk.aws-ec2
INSTALL
IMPORT
SIG · AWS-CDK-AWS-AUTOSC
A
aws-cdk-aws-autoscaling
awspythonv1.204.0
Install
12.7s avg
Import
Disk
68MB
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.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 64.9MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 12.7s · import 0.000s · 65MB
68MB installed
● package 68MB
Code
Verified usage

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

AutoScalingGroup
from aws_cdk.aws_autoscaling import AutoScalingGroup
from aws_cdk import aws_autoscaling
This package (`aws-cdk-aws-autoscaling`) is for AWS CDK v1.x. The v2 import style (`from aws_cdk import aws_autoscaling`) is used with `aws-cdk-lib`.
CfnAutoScalingGroup
from aws_cdk.aws_autoscaling import CfnAutoScalingGroup
CDK v1 L1 (CloudFormation) construct import.

This quickstart demonstrates how to define a basic AWS Auto Scaling Group using AWS CDK v1 constructs. It creates a new VPC, an Auto Scaling Group with a specified instance type and Amazon Linux 2 AMI, and sets min/max capacity. To deploy, run `cdk bootstrap` (if not already done) and then `cdk deploy`.

import os from aws_cdk import ( core as cdk, aws_ec2 as ec2, aws_autoscaling as autoscaling, ) class MyAutoScalingStack(cdk.Stack): def __init__(self, scope: cdk.Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, construct_id, **kwargs) # Create a VPC for the Auto Scaling Group vpc = ec2.Vpc(self, "MyVpc", max_azs=2) # Define an Auto Scaling Group asg = autoscaling.AutoScalingGroup( self, "ASG", vpc=vpc, instance_type=ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.MICRO), machine_image=ec2.AmazonLinuxImage(generation=ec2.AmazonLinuxGeneration.AMAZON_LINUX_2), min_capacity=1, max_capacity=1, group_metrics=[autoscaling.GroupMetrics.all()], # Example for monitoring health_check=autoscaling.HealthCheck.ec2() ) app = cdk.App() MyAutoScalingStack(app, "MyAutoScalingStack", env=cdk.Environment(account=os.environ.get('CDK_DEFAULT_ACCOUNT', ''), region=os.environ.get('CDK_DEFAULT_REGION', '')) ) app.synth()
Debug
Known issues
breakingAWS CDK v2 consolidates all constructs into a single `aws-cdk-lib` package. This `aws-cdk-aws-autoscaling` package is specifically for CDK v1. If you are using CDK v2, you should install `aws-cdk-lib` and use the v2 import paths.
fix
For CDK v2, install `aws-cdk-lib` (`pip install aws-cdk-lib`) and update your import statements from `from aws_cdk.aws_autoscaling import ...` to `from aws_cdk import aws_autoscaling` and access constructs via `aws_autoscaling.AutoScalingGroup`.
affects: All versions of aws-cdk-aws-autoscaling (v1.x) when migrating to CDK v2.
gotchaCDK v1 requires installing individual construct libraries (e.g., `aws-cdk.core`, `aws-cdk.aws-ec2`, `aws-cdk-aws-autoscaling`) separately. Missing a dependency will lead to `ModuleNotFoundError`.
fix
Ensure all required individual construct libraries for your CDK v1 project are installed via `pip install <package-name>`. For most projects, `aws-cdk.core` and relevant `aws-cdk.aws-*` packages are needed.
affects: All v1.x versions.
gotchaPython version compatibility for CDK v1.x packages is typically limited to `~=3.7`. Newer Python versions might cause issues or not be supported by older CDK v1 dependencies.
fix
Ensure your Python environment is compatible with the installed CDK v1 packages, ideally Python 3.7. Consider migrating to AWS CDK v2 for broader Python version support and ongoing updates.
affects: All v1.x versions with Python 3.8+.
Upgrade
Version history
1.204.0latest on PyPI · released Jun 19, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
16
OpenAI (training)
2
Resources
aws-cdk-aws-autoscaling — pip install aws-cdk-aws-autoscaling · libregistry