CloudFormation Template Validator
Fast, accurate, and free online CloudFormation Template Validator tool that runs directly in your browser.
-
1Enter data
Enter content, paste text or load a file from disk. -
2Click the button
The tool will immediately process your data in the browser. -
3Get the result
Copy the finished text or save the file to your device.
return "Result ready in 0.1s";
}
Rate this tool:
Related tools
Other tools you may find usefulCloudFormation template validator – errors before deployment
An incorrect CloudFormation template detected only during deployment means rollback and waste of time. The tool validates the syntax, structure and references of an AWS CloudFormation template (JSON or YAML) before uploading to AWS - without access to your AWS account.
CloudFormation template structure
AWSTemplateFormatVersion: "2010-09-09". Description: description of the template. Parameters: input parameters. Mappings: static mappings. Conditions: logical conditions. Resources: REQUIRED, AWS resources (EC2, S3, Lambda, RDS...). Outputs: exported values (ARN, URL). Transform: macros (SAM, LanguageExtensions).
Structure and Reference Validation
Required sections: Resources. Invalid resource types: AWS::EC2::Instancee (typo). References: Ref and !GetAtt for non-existent resources. Circular dependencies: the cycle of dependencies between resources. Resource limit: 500 per stack. Parameters: type String/Number/List/SSM. DependsOn: reference to undefined.
Common template errors
A required field is missing (Properties.ImageId for EC2). Value not of the allowed type (String instead of Number). Invalid enum values (e.g. InstanceType: t2.micro-wrong). Reference Ref: to an undefined parameter or resource. !GetAtt with a non-existent attribute. YAML indentation.
SAM and Macros Transform
AWS SAM (Serverless Application Model): Transform: AWS::Serverless-2016-10-31. Adds lightweight resources: AWS::Serverless::Function (instead of AWS::Lambda::Function + Role + Permission). The tool understands SAM syntax. CDK output: synth generates CloudFormation JSON - the tool can also validate CDK output.
FAQ
What are the alternatives to CloudFormation?
AWS CDK (Cloud Development Kit): define infrastructure in TypeScript/Python/Java - generates CloudFormation. Terraform: multi-cloud IaC, HCL syntax. Pulumi: application code (TypeScript, Python) as IaC. CDK is recommended by AWS for new projects - better DX than raw CloudFormation.
How to test CloudFormation templates locally?
aws cloudformation validate-template --template-body file://template.yaml (requires AWS CLI). cfn-lint: open-source linter for CloudFormation (beyond syntax validation: checks resource types, requires AWS SAR). TaskCat: tests deployment across multiple AWS regions.
How many resources can a CloudFormation stack have?
Maximum 500 resources per stack. For larger systems: nested stacks (AWS::CloudFormation::Stack), StackSets (multi-account/region), or division into layers (networking, database, application as separate stacks). Template size limit: 51,200 bytes (direct) or 460,800 bytes (S3).
What is CloudFormation Drift Detection?
Drift: the difference between the state of the template and the actual state of the AWS resource (e.g. someone manually changed the security group). Drift detection: CloudFormation compares the current state with the expected state. Result: IN_SYNC or DRIFTED with changelog. Use regularly to detect unauthorized changes.
How to manage secrets in CloudFormation?
DO NOT enter secrets (passwords, API keys) directly. AWS SSM Parameter Store: Type: AWS::SSM::Parameter::Value