Introduction
This guide provides a method for downloading the configuration version for a specific workspace run in Terraform Enterprise. As of version 202110-01, this feature is not available through the API, but you can accomplish this task using the Rails console.
Use Case
Administrators may need to download a specific configuration version from a workspace for auditing, debugging, or backup purposes.
Prerequisites
- Administrative access to the Terraform Enterprise instance.
- Familiarity with accessing the Terraform Enterprise Rails console.
Procedure
- Access the Rails console on your Terraform Enterprise instance.
-
Execute the following Ruby code in the console. Replace
<external_id>with the external ID of the target run (e.g.,run-xxxxxxxxxxxxxxxx).r = Run.find_by_external_id("run-<external_id>") slug = r.configuration_version.downloadable_slug slug_url = Archivist.internal(slug.download_url) puts slug_url.public - The console will output a temporary URL. Use a tool like
curlorwgetfrom the Terraform Enterprise instance to download thetar.gzarchive containing the configuration version.