Translating Infrastructure as Code (IaC)
OpenText SAST translates Azure Resource Manager (ARM), Bicep, AWS CloudFormation, and HCL templates.
HCL analysis support is specific to Terraform and supported cloud provider Infrastructure as Code (IaC) configurations.
For best results, make sure that the template files are deployment valid. The templates must not contain:
Validation errors that are static and locally detectable (for example, type errors or references to undefined variables or functions).
Predeployment errors that occur during template interpretation, but before any resources are deployed or modified (for example, invalid array indexing operations).
Deployment errors that occur in the cloud (for example, dynamically referencing a non-existent resource).
OpenText recommends that AWS CloudFormation file name extensions are .json, .yaml, .template, or .txt. OpenText SAST supports other extensions only if they are not commonly used by other languages or file types (such as .java or .html).
By default, OpenText SAST translates files with the HCL extensions .hcl and .tf.
ARM translation command-line examples
Translate an ARM template:
sourceanalyzer -b MyProject ArmTemplate.json
Translate all ARM templates in a directory:
sourceanalyzer -b MyProject "src/**/*.json"
Bicep translation command-line examples
Translate a single Bicep template:
sourceanalyzer -b MyProject BicepTemplate.bicep
Translate all Bicep templates in a directory:
sourceanalyzer -b MyProject "src/**/*.bicep"
AWS CloudFormation translation command-line examples
Translate AWS CloudFormation templates that have different extensions:
sourceanalyzer -b MyProject CFTemplateA.template CFTemplateB.yaml CFTemplateC.json CFTemplateD.customext
Translate all AWS CloudFormation templates in a directory that have the .template extension:
sourceanalyzer -b MyProject "src/**/*.template"
Translate all AWS CloudFormation templates in a directory that have either the .json or .yaml extension:
sourceanalyzer -b MyProject "src/**/*.json" "src/**/*.yaml"
HCL translation command-line examples
Translate two HCL templates with different extensions:
sourceanalyzer -b MyProject HCLTemplateA.hcl HCLTemplateB.tf
Translate all HCL templates in a directory:
sourceanalyzer -b MyProject "src/**/*.tf" "src/**/*.hcl"