--- id: aws-cdk-aws-ec2 version: "1.204.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # aws-cdk.aws-ec2 — The CDK Construct Library for AWS::EC2 License: permissive · Maintenance: active · Downloads: 195.6K/mo ## What it is and what it does aws-cdk.aws-ec2 is the EC2 construct library for AWS CDK v1, a framework for defining cloud infrastructure using Python code. It abstracts EC2 networking primitives—VPCs, subnets (public, private-with-NAT, and isolated), availability zones, security groups, and instances—into reusable constructs that generate CloudFormation templates. You define your infrastructure declaratively, and CDK synthesizes it into deployable AWS resources. The package is part of the broader AWS CDK ecosystem and depends on core CDK modules (aws-cdk.core, aws-cdk.cx-api, constructs) plus related AWS service libraries (IAM, KMS, S3, CloudWatch, Logs, SSM). It is designed for developers building cloud applications who want to express infrastructure in Python rather than writing CloudFormation YAML or JSON directly. Use it for: - Define a VPC with public and private subnets, then launch EC2 instances into them as part of a CDK stack. - Create VPC endpoints and configure subnet selection by availability zone and subnet type for high-availability deployments. - Provision security groups and network ACLs to control inbound and outbound traffic to EC2 resources. - Integrate EC2 networking with other AWS services by specifying VPC and subnet configuration in a single CDK app. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides AWS CDK constructs for defining EC2 networking and compute resources (VPCs, subnets, instances) as infrastructure-as-code in Python. No, unless you are maintaining an existing CDK v1 codebase. AWS CDK v1 reached end-of-support on 2023-06-01 and is no longer being updated. New projects should use AWS CDK v2 instead. If you are already on v1, plan a migration to v2 rather than starting new work with this package. ## Install pip install aws-cdk-aws-ec2 uv add aws-cdk-aws-ec2 poetry add aws-cdk-aws-ec2 ## Installing aws-cdk.aws-ec2 Before you install: Low install friction with a pure-Python wheel. However, this is AWS CDK v1, which reached end-of-support on 2023-06-01 and is no longer being updated; users should migrate to AWS CDK v2. License in practice: Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions. Quickstart: pip install aws-cdk.aws-ec2 import aws_cdk.aws_ec2 as ec2 vpc = ec2.Vpc(self, "VPC") Requires Python 3.7 or later; AWS CDK v1 reached end-of-support on 2023-06-01. Verify before relying: - Whether v1-to-v2 migration tooling or automated upgrade paths are available to ease the transition. - Current security posture and whether v1 receives any backported security patches post-EOL. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 195.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags aws ec2 infrastructure as code, vpc subnet construct library, aws cdk networking, ec2 instance provisioning cdk, aws network infrastructure python, infrastructure-as-code, aws-cdk-v1-eol [View on SkillFed](https://skillfed.io/packages/aws-cdk-aws-ec2) · [View on PyPI](https://pypi.org/project/aws-cdk-aws-ec2/)