✅ Test your cloud infrastructure in plain English, no code required.
Write infrastructure tests for Terraform, Docker, and Kubernetes in plain English, without writing a single line of code. InfraSpec combines a vast library of common infrastructure testing patterns with a domain-specific language for testing infrastructure.
Tests are written using an easy to learn Gherkin syntax.
Feature: S3 Bucket Creation
As a DevOps Engineer
I want to create an S3 bucket with guardrails
So that I can store my data securely
Scenario: Create an S3 bucket with a name
Given I have a Terraform configuration in "./s3-bucket"
And I set variable "bucket_name" to "my-bucket"
When I run Terraform apply
Then the S3 bucket "my-bucket" should exist
And the S3 bucket "my-bucket" should have a versioning configuration
And the S3 bucket "my-bucket" should have a public access block
And the S3 bucket "my-bucket" should have a server access logging configuration
And the S3 bucket "my-bucket" should have a encryption configuration
InfraSpec translates your natural language specifications into executable infrastructure tests.
Warning
This project is still in heavy development and is likely to change!
- Write tests in plain English using Gherkin syntax
- Supports AWS infrastructure testing
- Integrates with Terraform configurations
- Zero code required for writing tests
At the moment, only a subset of AWS infrastructure is supported, but over time we hope to support other clouds and tooling.
Product | Description | Status |
---|---|---|
API Gateway | Not Implemented | ⏳ |
DynamoDB | Partially Supported | ✅ |
ElastiCache | Not Implemented | ⏳ |
RDS Aurora | Not Implemented | ⏳ |
S3 | Not Implemented | ⏳ |
- Natural Language Testing. Write tests in plain English that both technical and non-technical team members can understand.
- LLM Integration. Leverage AI to generate test scenarios.
- Supply Chain Security. Ensure your infrastructure meets security and compliance requirements.
- No Code Required: Focus on what to test rather than how to test.
go install github.com/robmorgan/infraspec@latest
- Install InfraSpec using Homebrew:
brew tap robmorgan/infraspec
brew install infraspec
- Initialize a repo containing your infrastructure code:
infraspec init # creates a ./features directory if it doesn't already exist
- Create your first infrastructure test:
infraspec new dynamodb.feature
- Run the tests
infraspec features/dynamodb.feature
Tip
If your using VS Code, we recommend installing the Cucumber (Gherkin) Full Support extension for syntax highlighting.
Contributions are welcome! Please open an issue or submit a pull request. Please note, that this project is still in it's infancy and many internal APIs are likely to change.
Note: Our tests use LocalStack, which emulates the AWS APIs, in order to save both time and money.