# Snyk CLI for Infrastructure as Code

## Overview

To use the CLI you must first [install](https://docs.snyk.io/~/changes/m2hJeDrttXy2N83AnRjM/snyk-cli/install-the-snyk-cli) it and then [authenticate](https://docs.snyk.io/~/changes/m2hJeDrttXy2N83AnRjM/snyk-cli/commands/auth).

With Snyk Infrastructure as Code, you can test your configuration files directly from the CLI. See the following pages for details:

* [Test your configuration files](https://docs.snyk.io/~/changes/m2hJeDrttXy2N83AnRjM/scan-cloud-deployment/snyk-infrastructure-as-code/snyk-cli-for-infrastructure-as-code/test-your-configuration-files)
* [IaC ignores using the `.snyk` policy file](https://docs.snyk.io/~/changes/m2hJeDrttXy2N83AnRjM/scan-cloud-deployment/snyk-infrastructure-as-code/snyk-cli-for-infrastructure-as-code/iac-ignores-using-the-.snyk-policy-file)
* [Test your Terraform files with Snyk CLI](https://docs.snyk.io/~/changes/m2hJeDrttXy2N83AnRjM/scan-cloud-deployment/snyk-infrastructure-as-code/snyk-cli-for-infrastructure-as-code/test-your-terraform-files-with-the-cli-tool)
* [Test your CloudFormation files with Snyk CLI](https://docs.snyk.io/~/changes/m2hJeDrttXy2N83AnRjM/scan-cloud-deployment/snyk-infrastructure-as-code/snyk-cli-for-infrastructure-as-code/test-your-cloudformation-files-with-cli-tool)
* [Test your AWS CDK files with Snyk CLI](https://docs.snyk.io/~/changes/m2hJeDrttXy2N83AnRjM/scan-cloud-deployment/snyk-infrastructure-as-code/snyk-cli-for-infrastructure-as-code/test-your-aws-cdk-files-with-our-cli-tool)
* [Test your Kubernetes files with Snyk CLI](https://docs.snyk.io/~/changes/m2hJeDrttXy2N83AnRjM/scan-cloud-deployment/snyk-infrastructure-as-code/snyk-cli-for-infrastructure-as-code/test-your-kubernetes-files-with-our-cli-tool)
* [Test your ARM files with Snyk CLI](https://docs.snyk.io/~/changes/m2hJeDrttXy2N83AnRjM/scan-cloud-deployment/snyk-infrastructure-as-code/snyk-cli-for-infrastructure-as-code/test-your-arm-files-with-the-cli-tool)
* [Test your Serverless files with Snyk CLI](https://docs.snyk.io/~/changes/m2hJeDrttXy2N83AnRjM/scan-cloud-deployment/snyk-infrastructure-as-code/snyk-cli-for-infrastructure-as-code/test-your-serverless-files-with-snyk-cli)

You can also test the following types of files:

* [Kustomize files](https://docs.snyk.io/~/changes/m2hJeDrttXy2N83AnRjM/scan-cloud-deployment/snyk-infrastructure-as-code/snyk-cli-for-infrastructure-as-code/test-your-kustomize-files-with-our-cli-tool)
* [Helm charts](https://docs.snyk.io/~/changes/m2hJeDrttXy2N83AnRjM/scan-cloud-deployment/snyk-infrastructure-as-code/snyk-cli-for-infrastructure-as-code/test-your-helm-charts-with-our-cli-tool)

See [Understanding the CLI output](https://docs.snyk.io/~/changes/m2hJeDrttXy2N83AnRjM/scan-cloud-deployment/snyk-infrastructure-as-code/snyk-cli-for-infrastructure-as-code/understanding-the-cli-test-output) for information about using the reports.

## Regularly testing IaC files

Currently, there is no equivalent command to `snyk monitor` for Snyk IaC because the CLI does not send IaC source files back to the platform for periodic testing.

For IaC CLI results to appear in the Snyk Web UI, you can use the [`snyk iac test --report`](https://docs.snyk.io/products/snyk-infrastructure-as-code/share-cli-results-with-the-snyk-web-ui) command to capture a one-time snapshot. Optionally, run the command on a recurring schedule to regularly test your IaC.

Alternatively, you can add an [SCM integration](https://docs.snyk.io/integrations/git-repository-scm-integrations) and Snyk will monitor and test a given git repository on a recurring basis.

## Using Snyk behind a proxy

If you are using a proxy, see [Proxy configuration for Snyk CLI](https://docs.snyk.io/snyk-cli/configure-the-snyk-cli/proxy-configuration-for-snyk-cli).

For IaC scans specifically, you must also whitelist the \*.snyk.io address, as explained[ ](https://support.snyk.io/hc/en-us/articles/360002153077-How-can-we-whitelist-Snyk-IP-addresses-)on the page [How can we whitelist Snyk IP addresses?](https://support.snyk.io/hc/en-us/articles/360002153077-How-can-we-whitelist-Snyk-IP-addresses-)
