Metadata-Version: 2.2
Name: aws-cdk-cli
Version: 2.177.0
Summary: Python wrapper for AWS CDK CLI with smart Node.js runtime management
Home-page: https://github.com/rvben/aws-cdk-wrapper
Author-email: "Ruben J. Jongejan" <ruben.jongejan@gmail.com>
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: setuptools
Requires-Dist: requests
Requires-Dist: tqdm
Requires-Dist: semver>=3.0.0
Requires-Dist: importlib_resources; python_version < "3.9"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: twine>=4.0.0; extra == "dev"
Requires-Dist: build>=0.10.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=6.0.0; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=1.2.0; extra == "docs"
Dynamic: home-page
Dynamic: requires-python

# AWS CDK Python Wrapper

A Python package that provides a wrapper around the AWS CDK CLI tool, allowing Python developers to install and use AWS CDK via pip/uv instead of npm. This package downloads and uses a platform-specific Node.js runtime during installation, eliminating the need for a separate npm/Node.js installation.

## How It Works

This package uses a source-only distribution approach:
1. When installed, it downloads the appropriate Node.js binaries for your specific platform (Windows, macOS, or Linux)
2. It bundles the AWS CDK JavaScript code but downloads platform-specific binaries on demand
3. This approach keeps the package size small while ensuring compatibility across platforms

## Why Use This Package?

If you're a Python developer working with AWS CDK, you typically need to install Node.js and npm first, then install the CDK CLI globally using npm. This wrapper eliminates that requirement by downloading a minimal Node.js runtime and bundling the CDK CLI code directly into a Python package.

Benefits:
- No need to install or configure Node.js/npm
- Works in environments where npm installation is restricted
- Keeps AWS CDK installations isolated in Python virtual environments
- Consistent CDK versioning tied to your Python dependencies
- Optimized package size with platform-specific binary downloads

## Installation

```bash
# Using pip
pip install aws-cdk-wrapper

# Using uv
uv pip install aws-cdk-wrapper

# Install a specific version
pip install aws-cdk-wrapper==2.108.0
```

Note: During installation, the package will download the appropriate Node.js binaries for your platform. This requires an internet connection for the initial setup.

## Features

- **Zero npm dependency**: No need to install Node.js or npm on your system
- **Platform support**: Downloads appropriate Node.js binaries for Windows, macOS, and Linux
- **Automatic updates**: Stays in sync with official AWS CDK releases
- **Seamless integration**: Use the same CDK commands you're familiar with
- **Offline caching**: Downloaded binaries are cached for offline usage
- **License compliance**: Includes all necessary license texts
- **Optimized size**: Only downloads the binaries needed for your platform
- **Uses bundled Node.js runtime**
- **Can use system Node.js if available (optional)**
- **Supports Bun as an alternative JavaScript runtime (optional)**
- **Compatible with Windows, macOS, and Linux**
- **Supports both x86_64 and ARM64 architectures**

## Usage

After installation, you can use the `cdk` command just as you would with the npm version:

```bash
# Initialize a new CDK project
cdk init app --language python

# Deploy a CDK stack
cdk deploy

# List all CDK stacks
cdk list

# Show version information
cdk --version

# Additional wrapper-specific commands
cdk --verbose     # Show detailed installation information
cdk --license     # Show license information
cdk --update      # Update to the latest AWS CDK version
cdk --offline     # Run in offline mode using cached packages
```

## JavaScript Runtime Options

The wrapper supports various JavaScript runtimes in the following priority order:

### Using system Node.js (default)

By default, the wrapper first checks if you have Node.js installed on your system. It will use your system Node.js installation if it meets the minimum required version for AWS CDK (typically v14.15.0+).

> **Note:** Node.js version compatibility warnings are silenced by default. If you want to see these warnings:
> ```bash
> cdk --show-node-warnings [commands...]
> ```

If you want to force using your system Node.js regardless of version:

```bash
cdk --use-system-node [commands...]
```

### Using Bun (if explicitly enabled)

Bun is a fast JavaScript runtime with 100% Node.js compatibility. Enable it with:

```bash
cdk --use-bun [commands...]
```

Requirements for using Bun:
- Bun v1.1.0 or higher must be installed on your system
- The wrapper will verify that Bun's reported Node.js version is compatible with CDK requirements

### Using bundled Node.js (fallback)

If no compatible system Node.js is found, the wrapper will use its bundled Node.js runtime, which is downloaded during installation. This is guaranteed to be a version that's compatible with AWS CDK.

### Forcing download of bundled Node.js

```bash
cdk --force-download-node [commands...]
```

This forces downloading and using the bundled Node.js even if a compatible system Node.js is available.

## Environment Variables

The package respects the following environment variables:

- `AWS_CDK_OFFLINE`: Set to "1" to use cached packages without network access
- `AWS_CDK_DEBUG`: Set to "1" for verbose debug output
- `HTTP_PROXY` / `HTTPS_PROXY`: Used for network connections if set
- All standard AWS CDK environment variables
- `AWS_CDK_BIN_USE_SYSTEM_NODE=1`: Use system Node.js if available
- `AWS_CDK_BIN_USE_BUN=1`: Use Bun as the JavaScript runtime
- `AWS_CDK_BIN_FORCE_DOWNLOAD_NODE=1`: Force download of bundled Node.js

## License Information

This package contains:
- AWS CDK (Apache License 2.0)
- Node.js (MIT License)

All copyright notices and license texts are included in the distribution. You can view the licenses using:

```bash
cdk --license
```

## Version Synchronization

The version of this Python package matches the version of the AWS CDK npm package it wraps. Updates are automatically published when new versions of AWS CDK are released.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

### Development Setup

1. Clone the repository
   ```bash
   git clone https://github.com/your-org/aws-cdk.git
   cd aws-cdk
   ```

2. Create a virtual environment
   ```bash
   python -m venv .venv
   source .venv/bin/activate  # On Windows: .venv\Scripts\activate
   ```

3. Install in development mode
   ```bash
   pip install -e ".[dev]"
   ```

4. Run tests
   ```bash
   make test
   ```

### Building from Source

```bash
python -m build
```

## Acknowledgements

- [AWS CDK](https://github.com/aws/aws-cdk) - The original AWS CDK project
- [Node.js](https://nodejs.org/) - JavaScript runtime bundled with this package 
