| « PreviousNext » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
Do a static evaluation of a template.
Note
This command checks the syntatic correctness of the template. It does not do a deep check of resources you have declared. For example, if you have specified an invalid region name, cfn-validate-template will not detect that. Declaration errors of that type can be discovered only creating a stack with the template.
cfn-validate-template {-f
VALUE | -u VALUE} common-options
| Name | Description | Required |
|---|---|---|
|
|
The local path and filename to the template to validate Type: String Default: None One of |
Conditional |
|
|
The URL of the template to validate Type: String Default: None One of |
Conditional |
If the template is valid, the command returns information about capabilties and parameters defined in the template.
If the template contains capabilities (currently, only IAM capabilities are detected), it returns the following capability information:
CAPABILITIES_REASON REASON
CAPABILITIES_REASON Template contains IAM resources
CAPABILITIES CAPABILITY_NAME
CAPABILITIES CAPABILITY_IAM
If the template contains IAM resource and you use that template with the cfn-create-stack or cfn-update-stack commands, you must specify the CAPABILITY_IAM value for the --capabilities parameter; otherwise, this command returns an InsufficientCapabilities error.
If the template contains parameters, the command returns a table that contains the following parameter information. (If a valid template has no parameters, no output is returned.)
PARAMETER_NAME
Parameter name
DEFAULT_VALUE
If the parameter has a default value, that value is reported.
NOECHO
True if the parameter is declared with the NOECHO property.
DESCRIPTION
Value of the Description property for the parameter.
AWS CloudFormation displays errors on stderr.
This reports the validity for the local file example-template-file.template.
PROMPT>cfn-validate-template --template-file example-template-file.templatePARAMETERS PARAMETER_NAME DEFAULT_VALUE NOECHO PARAMETERS WordPressUser admin false PARAMETERS WordPressDBName wordpressdb false PARAMETERS WordPressPwd password true PARAMETERS AvailabilityZones us-east-1a,us-east-1b false PARAMETERS GroupSize 2 false PARAMETERS InstanceType m1.small false