AWS CloudFormation now supports contract tests v2 for resource types
AWS CloudFormation introduces contract tests v2 for resource types, adding deeper test scenarios and live-state verification to improve development cycles and early issue detection.
AWS CloudFormation now supports contract test v2 for resource types. Enabled via the cfn test command's --v2 flag, it extends testing beyond basic CRUD handlers to detailed scenarios across all handler operations. All new resource types can run contract test v2 through the test-type API at registration, with Java-based types requiring only Docker and a built handler package to run cfn test --v2 locally. Contract test v2 introduces live state validation to ensure 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 detects hardcoded regions, account IDs, and partitions, and detailed HTML and JUnit XML reports for local contract test runs. These improvements significantly shorten iteration cycles by catching issues before registration, and contract test v2 is available in all AWS regions where AWS CloudFormation is offered.
Why it matters
This update affects developers and end-users who develop or manage resource types with AWS CloudFormation. Enhanced testing and verification capabilities improve the reliability and stability of resource types.