Back to Devoured - September 14, 2026
DEVOURED
AWS CloudFormation now supports contract tests v2 for resource types

AWS CloudFormation now supports contract tests v2 for resource types

DevOps AWS
AWS CloudFormation now offers contract tests v2, enabling developers to perform deeper validation of custom resource types before registry submission.
What: The v2 test suite adds live-state verification and schema backward-compatibility checks to the CloudFormation CLI. It is available via the `--v2` flag and generates local HTML and JUnit reports.
Why it matters: Moving validation logic earlier in the development lifecycle reduces the friction of registry submissions and prevents deployment failures caused by resource implementation errors.
Takeaway: Run `cfn test --v2` locally on your Java-based resource handlers to catch configuration linting and state-mismatch errors before submitting to the registry.
Decoder
  • Resource handler: Code that defines how CloudFormation creates, updates, and deletes a specific AWS or third-party resource type.
  • Contract tests: Automated tests that verify a resource implementation conforms to the expected behavior defined by the CloudFormation registry spec.
Original article

AWS CloudFormation now supports contract tests v2 for resource types

AWS CloudFormation now supports contract tests v2, available through the --v2 flag of the cfn test command in the CloudFormation CLI. Previously, the contract test suite covered only basic scenarios around the CRUD handlers. Contract tests v2 adds deeper test scenarios that exercise your resource type implementation across each handler operation. All new resource types can run contract tests v2 through the test-type API during registry submission, and Java-based resource types can also run them locally with cfn test --v2, requiring only Docker and a built handler package.

Contract tests v2 introduces live-state verification that confirms actual resource state matches the requested state after create, update, and delete operations. Developers also benefit from schema backward-compatibility checks, test input linting that flags hardcoded Regions, account IDs, and partitions, and detailed HTML and JUnit XML reports for local contract test execution. These improvements significantly reduce iteration cycles by surfacing issues before registry submission.

Contract tests v2 is available in all AWS Regions where AWS CloudFormation is available. To learn more, visit the AWS CloudFormation contract tests documentation and the AWS CloudFormation product page.

Explore all 74 articles in today's digest

Fresh dev news, AI-digested daily. Never miss a trend at devoured.fyi