Skip to content

MakendranG/pulumi-inline-dynamodb-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

🧱 Pulumi Inline DynamoDB Deployment (Python)

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!


✨ What It Does

  • 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

📦 Requirements

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

🚀 Getting Started

1. Clone this repo

git clone https://github.com/MakendranG/pulumi-inline-dynamodb-python.git
cd pulumi-inline-dynamodb-python

2. Set up a virtual environment

python3 -m venv venv
source venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

4. Deploy the DynamoDB table

python main.py

You should see Pulumi provisioning the table and outputting the table name.


🧨 Destroy Resources

To tear down the stack:

python main.py destroy

To remove the Pulumi stack metadata entirely:

pulumi stack rm dev

🛠 Project Structure

.
├── main.py              # The inline Pulumi program
├── requirements.txt     # Python + Pulumi dependencies
└── README.md            # Project documentation

🧠 How It Works

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 or pulumi destroy programmatically

This is useful for:

  • Lightweight tooling
  • Infrastructure automation inside apps
  • Scripting CI/CD deployment environments

🧪 Example Output

✅ Stack initialized
📦 Installing AWS plugin...
🔧 Setting AWS region...
🔄 Refreshing stack...
🚀 Updating stack...
📊 Update Summary:
{
    "+": 1
}
🔗 DynamoDB Table Name: my-table

📎 Related Links


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages