Pulumi Easy
A streamlined Python library for AWS infrastructure provisioning using Pulumi.
Overview
pulumi-easy is a Python package that simplifies AWS infrastructure-as-code using Pulumi. It provides higher-level abstractions that make it easier to create common AWS resources without having to write boilerplate code.
Installation
# Using pip
pip install pulumi-easy
# Using poetry
poetry add pulumi-easy
# Using uv
uv add pulumi-easy
Requirements
- Python 3.12+
- Pulumi CLI
- AWS credentials configured
Getting Started
- Install Pulumi CLI by following the official guide
# MacOS
brew install pulumi/tap/pulumi
# Linux
curl -fsSL https://get.pulumi.com | sh
# Windows
# Please refer to the official guide
- Configure AWS credentials using the
aws configurecommand
aws configure
- Initialize a new Pulumi project
pulumi new aws-python
- Install the
pulumi-easypackage
pip install pulumi-easy
- Start using the library in your Pulumi program
from pulumi_easy.aws.iam.s3 import IamRoleS3Manager
# Initialize the manager
iam_manager = IamRoleS3Manager()
# Create an IAM role for EC2 to access specific S3 buckets
role = iam_manager.create_iam_ec2_s3(
name="my-ec2-s3-role",
bucket_resources=[
"arn:aws:s3:::my-bucket/*",
"arn:aws:s3:::my-bucket"
]
)
Optional Dependencies
By default, the library does not include any dependencies. However, you can install additional packages to enable more features:
| Package | Description |
|---|---|
requests |
Required for get_my_ip() function in pulumi_easy.utils.ip |
Benefits
- Simplified Syntax: Create AWS resources with less code and cleaner APIs
- Best Practices Built-in: IAM policies, security groups, and other resources follow AWS best practices
- Type Safety: Python type hints for better IDE integration and error detection
- Modular Design: Use only what you need from the library
- Production-Ready: Designed to be used in real-world projects
Usage Examples
Create an IAM Role for EC2 to Access S3
from pulumi_easy.aws.iam.s3 import IamRoleS3Manager
# Initialize the manager
iam_manager = IamRoleS3Manager()
# Create an IAM role for EC2 to access specific S3 buckets
role = iam_manager.create_iam_ec2_s3(
name="my-ec2-s3-role",
bucket_resources=[
"arn:aws:s3:::my-bucket/*",
"arn:aws:s3:::my-bucket"
]
)
Create an Ubuntu EC2 Instance
from pulumi_easy.aws.ec2.ec2 import EC2Manager
# Initialize the manager
ec2_manager = EC2Manager()
# Create a key pair
key_pair = ec2_manager.create_key_pair(
name="my-key",
public_key="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI... user@hostname"
)
# Create an Ubuntu instance
instance = ec2_manager.create_ubuntu_instance(
name="web-server",
storage=20, # 20 GB root volume
version="22.04", # Ubuntu version
arch="arm64", # Architecture
instance_type="t4g.nano", # Instance type
ssh_key_name=key_pair.key_name
)
See more examples in the documentation.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for pulumi-easy 0.21.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pulumi_easy-0.21.0.tar.gz | 15.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pulumi_easy-0.21.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.5 kB
Release files / pulumi_easy-0.21.0.tar.gz
| Download URL | pulumi_easy-0.21.0.tar.gz |
|---|---|
| Size | 15.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
560730402420c1a5230b4ce158fa35392b32563da0113ec8de2feebb3b924eb8
|
|
BLAKE2b-256 checksum How to use checksums |
ce2367d91cd36a16a12771392244097e1301091cb5f1251b96da70e22790e7fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2025.
Transparency logRelease files / pulumi_easy-0.21.0-py3-none-any.whl
| Download URL | pulumi_easy-0.21.0-py3-none-any.whl |
|---|---|
| Size | 19.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
31416fa01e3fc5f4bb9b326cfdfffe4a491d14904dadc7bb0aee453a04a7bf3e
|
|
BLAKE2b-256 checksum How to use checksums |
3a625ad5fbb80a502c09ab5cfb7e410fb403063e0b06f0605b06c4ab64c52ba1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 16, 2025.
Transparency log