This project demonstrates how to deploy an AWS DynamoDB Table using Pulumi Automation API — entirely inline, with a single Python script.
There is no need for Pulumi.yaml
, __main__.py
, or traditional Pulumi project structure. This is perfect for lightweight infrastructure scripting, automation pipelines, or demos!
- Provisions a DynamoDB Table with a single partition key (
id
) - Uses on-demand billing mode
- Deploys with just a Python command:
python main.py
- Destroys resources with
python main.py destroy
Before running this project, make sure you have the following installed:
- Pulumi CLI
- AWS CLI
- Python 3.7+
- AWS credentials set via
aws configure
or environment variables
git clone https://github.com/MakendranG/pulumi-inline-dynamodb-python.git
cd pulumi-inline-dynamodb-python
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python main.py
You should see Pulumi provisioning the table and outputting the table name.
To tear down the stack:
python main.py destroy
To remove the Pulumi stack metadata entirely:
pulumi stack rm dev
.
├── main.py # The inline Pulumi program
├── requirements.txt # Python + Pulumi dependencies
└── README.md # Project documentation
This project uses Pulumi’s inline Automation API. Instead of relying on a Pulumi.yaml
or CLI commands, it uses Python to:
- Initialize or select a stack
- Set configuration (e.g. AWS region)
- Install Pulumi plugins
- Run
pulumi up
orpulumi destroy
programmatically
This is useful for:
- Lightweight tooling
- Infrastructure automation inside apps
- Scripting CI/CD deployment environments
✅ Stack initialized
📦 Installing AWS plugin...
🔧 Setting AWS region...
🔄 Refreshing stack...
🚀 Updating stack...
📊 Update Summary:
{
"+": 1
}
🔗 DynamoDB Table Name: my-table