Validating a Template

As you develop an Oracle Cloud Stack template, you can use the validation feature to help identify template errors before you publish or import the template.

Oracle Cloud Stack validates your template’s syntax. It does not verify that:

  • Your resource definitions adhere to the REST APIs of the underlying cloud services.

  • Your use of the GetAtt function adheres to the REST APIs of the underlying cloud services.

Validating a Template with the Console

Use the web console to validate an unpublished template in Oracle Cloud Stack.

To validate a published template with the console, you must first create a copy of it. See Copying a Template.

  1. Access the Oracle Cloud Stack console, and then click Templates.
  2. Click Unpublished.
  3. Click the template that you want to validate.
    The Template Builder is displayed.
  4. Click Validate current template Check icon.

Validating a Template with the CLI

When you import a template into Oracle Cloud Stack the template’s syntax is automatically validated. You can also optionally validate your template file and its template parameters prior to importing it into the cloud by using the CLI.

Execute the stack validate-template command.

Provide the fully-qualified path of the template YAML file on your local file system. You can also test the template against specific input parameters, if desired. Template parameters are separated by spaces:

psm stack validate-template -f filePath -p param1:value1 param2:value2 ... paramN:valueN

For example:

psm stack validate-template -f /home/oracle/cloud/dev_stack_template.yaml -p shape:OC3 clusterSize:2

For more information about the CLI commands for Oracle Cloud Stack, see psm stack Commands.