Infrastructure Integration Testing Framework
A testing harness that uses the Automation API to spin up ephemeral infrastructure for integration tests and tear it down afterwards.
Overview
This is not a standalone tool, but a pattern for using the Pulumi Automation API to write integration tests for cloud infrastructure. Within a standard testing framework, the Automation API is used to programmatically deploy a Pulumi stack, creating real cloud resources. The test code then runs assertions against this live infrastructure (e.g., making an HTTP request to a deployed API, querying a database). Finally, in the test teardown phase, the Automation API is called again to destroy all the created resources, ensuring a clean state and avoiding orphaned resources.
✨ Key Features
- Programmatic stack creation and destruction.
- Spins up ephemeral infrastructure for tests.
- Integrates with popular testing frameworks (Pytest, Mocha, unittest, etc.).
- Access to stack outputs for runtime validation.
- Enables testing of real cloud resource interactions.
🎯 Key Differentiators
- Uses the same programming language for both infrastructure definition and testing.
- Leverages Pulumi's engine for reliable resource creation and cleanup.
- Avoids shelling out to a CLI, providing a more integrated and debuggable testing experience.
Unique Value: Enables fast, reliable, and repeatable integration testing for cloud infrastructure by managing the complete lifecycle of test resources programmatically.
🎯 Use Cases (4)
✅ Best For
- Using Python's `unittest` framework and the Automation API to deploy a stack, verify an AppSync API, test a GraphQL mutation, confirm data is stored in DynamoDB, and then destroy all resources.
- An example using TypeScript, Mocha, and the Automation API to set up a stack, perform runtime validation, and tear it down as part of a test run.
💡 Check With Vendor
Verify these considerations match your specific requirements:
- Unit testing, where mocking resources is faster and more appropriate.
- Simple projects where manual testing is sufficient.
🏆 Alternatives
Unlike Terratest which requires learning Go and wrapping Terraform CLI calls, this approach allows you to use the language your infrastructure is written in. It is more robust than custom scripts as it relies on Pulumi's state management for cleanup, reducing the risk of orphaned resources.
💻 Platforms
🔌 Integrations
💰 Pricing
Free tier: Open source pattern; cost is based on the ephemeral cloud resources used during test runs.
🔄 Similar Tools in Pulumi Automation API
Pulumi
An open-source infrastructure-as-code platform for creating, deploying, and managing cloud infrastru...
Pulumi Kubernetes Operator
A Kubernetes controller that manages Pulumi stacks as custom resources, enabling GitOps workflows fo...
Self-Service Infrastructure Platform
An internal tool, often a web portal or CLI, that uses the Automation API to expose standardized inf...
Custom Infrastructure CLI
A custom CLI tool that wraps Pulumi operations to provide a user-friendly, domain-specific interface...
Multi-Stack Orchestration Engine
A custom application that uses the Automation API to coordinate complex workflows involving several ...
Single-Tenant SaaS Provisioning System
A backend service that programmatically spins up a new Pulumi stack for each customer, providing sin...