:doc:`CloudFormation <../../cloudformation>` / Client / validate_template

*****************
validate_template
*****************



.. py:method:: CloudFormation.Client.validate_template(**kwargs)

  

  Validates a specified template. CloudFormation first checks if the template is valid JSON. If it isn't, CloudFormation checks if the template is valid YAML. If both these checks fail, CloudFormation returns a template validation error.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ValidateTemplate>`_  


  **Request Syntax**
  ::

    response = client.validate_template(
        TemplateBody='string',
        TemplateURL='string'
    )
    
  :type TemplateBody: string
  :param TemplateBody: 

    Structure that contains the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes.

     

    Conditional: You must pass ``TemplateURL`` or ``TemplateBody``. If both are passed, only ``TemplateBody`` is used.

    

  
  :type TemplateURL: string
  :param TemplateURL: 

    The URL of a file that contains the template body. The URL must point to a template (max size: 1 MB) that is located in an Amazon S3 bucket or a Systems Manager document. The location for an Amazon S3 bucket must start with ``https://``.

     

    Conditional: You must pass ``TemplateURL`` or ``TemplateBody``. If both are passed, only ``TemplateBody`` is used.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'Parameters': [
              {
                  'ParameterKey': 'string',
                  'DefaultValue': 'string',
                  'NoEcho': True|False,
                  'Description': 'string'
              },
          ],
          'Description': 'string',
          'Capabilities': [
              'CAPABILITY_IAM'|'CAPABILITY_NAMED_IAM'|'CAPABILITY_AUTO_EXPAND',
          ],
          'CapabilitiesReason': 'string',
          'DeclaredTransforms': [
              'string',
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 

      The output for  ValidateTemplate action.

      
      

      - **Parameters** *(list) --* 

        A list of ``TemplateParameter`` structures.

        
        

        - *(dict) --* 

          The ``TemplateParameter`` data type.

          
          

          - **ParameterKey** *(string) --* 

            The name associated with the parameter.

            
          

          - **DefaultValue** *(string) --* 

            The default value associated with the parameter.

            
          

          - **NoEcho** *(boolean) --* 

            Flag indicating whether the parameter should be displayed as plain text in logs and UIs.

            
          

          - **Description** *(string) --* 

            User defined description associated with the parameter.

            
      
    
      

      - **Description** *(string) --* 

        The description found within the template.

        
      

      - **Capabilities** *(list) --* 

        The capabilities found within the template. If your template contains IAM resources, you must specify the CAPABILITY_IAM or CAPABILITY_NAMED_IAM value for this parameter when you use the  CreateStack or  UpdateStack actions with your template; otherwise, those actions return an InsufficientCapabilities error.

         

        For more information, see `Acknowledging IAM resources in CloudFormation templates <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/control-access-with-iam.html#using-iam-capabilities>`__.

        
        

        - *(string) --* 
    
      

      - **CapabilitiesReason** *(string) --* 

        The list of resources that generated the values in the ``Capabilities`` response element.

        
      

      - **DeclaredTransforms** *(list) --* 

        A list of the transforms that are declared in the template.

        
        

        - *(string) --* 
    
  