Add your description here
Project description
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
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
Features
The library currently supports the following AWS components:
IAM Management
IamManager Class
| Method | Description |
|---|---|
get_assume_role_policy(service_identifiers) |
Creates an assume role policy document for specified AWS services |
create_iam_role_with_policy(name, assume_role_services, policy_document, description) |
Creates an IAM role with the specified policy and assume role configuration |
IamRoleS3Manager Class
| Method | Description |
|---|---|
create_iam_ec2_s3(name, bucket_resources, bucket_permissions, description, services) |
Creates an IAM role and policy for EC2 instances to access S3 buckets |
EC2 Management
EC2Manager Class
| Method | Description |
|---|---|
get_ubuntu_ami(version, arch) |
Gets the latest Ubuntu AMI ID for a specified version and architecture |
create_key_pair(name, public_key) |
Creates an EC2 key pair using a provided public key |
create_security_group(name, description) |
Creates a security group with SSH access |
create_ubuntu_instance(name, storage, version, arch, instance_type, ssh_key_name) |
Creates an Ubuntu EC2 instance with specified parameters |
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="amd64", # Architecture
instance_type="t2.micro", # 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pulumi_easy-0.4.0.tar.gz.
File metadata
- Download URL: pulumi_easy-0.4.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a9569308605353e0d7259aa2b05cc4bc9c19fc9acd5ad7e0426158fbfbfdd22
|
|
| MD5 |
eb8f7d67b3cd7f522a31ba874d62596a
|
|
| BLAKE2b-256 |
03cc10c34ffdac42ffe30fe20962c0b73dbb8f0ce87548b8b4f8b7ded8680315
|
Provenance
The following attestation bundles were made for pulumi_easy-0.4.0.tar.gz:
Publisher:
release.yml on JuniYadi/python-pulumi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pulumi_easy-0.4.0.tar.gz -
Subject digest:
8a9569308605353e0d7259aa2b05cc4bc9c19fc9acd5ad7e0426158fbfbfdd22 - Sigstore transparency entry: 186772152
- Sigstore integration time:
-
Permalink:
JuniYadi/python-pulumi@c825cd44b66d28cabd41366a7e880f084a1e3cb3 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/JuniYadi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c825cd44b66d28cabd41366a7e880f084a1e3cb3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pulumi_easy-0.4.0-py3-none-any.whl.
File metadata
- Download URL: pulumi_easy-0.4.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8681dbb5a67c32c20cd0bb6c764f4125ec56a39b42c7533245529d544a67744b
|
|
| MD5 |
0f5c565f44618264f5170ec0f0a38794
|
|
| BLAKE2b-256 |
a9eec38f22c431a6023209920aa4e92794e861b92b1fe4c84ede61580784a037
|
Provenance
The following attestation bundles were made for pulumi_easy-0.4.0-py3-none-any.whl:
Publisher:
release.yml on JuniYadi/python-pulumi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pulumi_easy-0.4.0-py3-none-any.whl -
Subject digest:
8681dbb5a67c32c20cd0bb6c764f4125ec56a39b42c7533245529d544a67744b - Sigstore transparency entry: 186772157
- Sigstore integration time:
-
Permalink:
JuniYadi/python-pulumi@c825cd44b66d28cabd41366a7e880f084a1e3cb3 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/JuniYadi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c825cd44b66d28cabd41366a7e880f084a1e3cb3 -
Trigger Event:
push
-
Statement type: