Back to articles
Pulumi Has a Free API: Here's How to Use It for Infrastructure as Code
How-ToDevOps

Pulumi Has a Free API: Here's How to Use It for Infrastructure as Code

via Dev.to DevOpsAlex Spinov

Pulumi lets you define cloud infrastructure using real programming languages — Python, TypeScript, Go, C#. But beyond the CLI, Pulumi offers a powerful REST API for managing stacks, deployments, and resources programmatically. Why Use the Pulumi API? Automate stack management across environments Build internal developer portals with self-service infrastructure Monitor deployment history and resource drift Integrate IaC into custom CI/CD pipelines Getting Started Get your access token from app.pulumi.com > Settings > Access Tokens: export PULUMI_ACCESS_TOKEN = "pul-xxxxxxxxxxxxxxxxxxxx" # List all stacks curl -s -H "Authorization: token $PULUMI_ACCESS_TOKEN " \ "https://api.pulumi.com/api/user/stacks" | jq '.stacks[] | {name: .stackName, project: .projectName, lastUpdate: .lastUpdate}' Get Stack Resources # Get all resources in a stack curl -s -H "Authorization: token $PULUMI_ACCESS_TOKEN " \ "https://api.pulumi.com/api/stacks/your-org/your-project/dev/export" \ | jq '.deployment.resour

Continue reading on Dev.to DevOps

Opens in a new tab

Read Full Article
6 views

Related Articles