Esta página aún no está disponible en español. Estamos trabajando en su traducción.
Si tienes alguna pregunta o comentario sobre nuestro actual proyecto de traducción, no dudes en ponerte en contacto con nosotros.
Disponible para:

API Tests | Multistep API Tests | Browser Tests

Overview

You can export existing Synthetic tests to Terraform directly from the Datadog UI. The export generates a ready-to-use datadog_synthetics_test resource block in HCL format and copies it to your clipboard. Paste it into your Terraform files to start managing your tests as code.

Export to Terraform is supported for the following test types:

  • API tests: HTTP, SSL, DNS, TCP, UDP, ICMP, WebSocket, and gRPC
  • Multistep API tests, including per-step configuration
  • Browser tests, with per-step export available in the recorder

Export from the test details page

To export an API or Browser Test from the test details page:

  1. Open any API test in Synthetic Monitoring.
  2. Click More in the upper right corner of the page.
  3. Select Copy Terraform Snippet.
The More dropdown menu on the test details page with Copy Terraform Snippet highlighted

The generated HCL configuration is copied to your clipboard. Paste it into your .tf file as a datadog_synthetics_test resource.

Export from the multistep API test recorder

To export a multistep API test while building or editing it:

  1. Open or create a Multistep API test.
  2. In the recorder view, click Export to Terraform.
The Export to Terraform button in the multistep API test recorder

The generated Terraform configuration is copied to your clipboard. Paste it into your .tf file as a datadog_synthetics_test resource.

Export a step from the browser test recorder

You can export individual steps to Terraform while recording or editing a browser test. Each step exports a configuration snippet you can use as part of a datadog_synthetics_test resource.

To export a step:

  1. Open or create a browser test and start recording.
  2. Hover over a step in the recorder.
  3. Click the Copy Terraform step to clipboard icon.
The Copy Terraform step to clipboard icon in the browser test recorder

Paste the copied configuration into your .tf file as part of a datadog_synthetics_test resource.

Further Reading