An experimental CLI that generates Terraform files for managing existing Fastly services.
Important
Known Issue: Incompatibility with Terraform 1.4.6 and Later
terraformify
is not compatible with Terraform versions 1.4.6 and later because of changes in the Terraform binary. Please use terraformify
with Terraform version 1.4.5 or earlier. For more information, see the issue at #49.
go install github.com/hrmsk66/terraformify@latest
Alternatively, download the prebuild binary from the latest release.
terraformify
requires read access to your Fastly resources. Choose one of the following options to give terraformify
access to your API token:
- Include the token explicitly on each command you run using the
--api-key
or-k
flags. - Set a
FASTLY_API_KEY
environment variable.
Run terraformify
command in an empty directory or in an existing TF directory.
Important
Executing the command within a directory containing existing TF files will alter the current state file and may modify other files (notably variables.tf
and terraform.tfvars
). It's advisable to back up your TF files before importing a new service.
terraformify service vcl <service-id>
For Compute services, provide the service ID and the path to the WASM package as arguments:
terraformify service compute <service-id> -p <path-to-package>
For more detailed usage instructions, including available flags and commands, see the Usage Documentation.
terraformify
supports the import of both Compute and VCL services, along with their associated resources. The following resources are supported:
- fastly_service_vcl
- fastly_service_acl_entries
- fastly_service_dictionary_items
- fastly_service_dynamic_snippet_content
- fastly_service_waf_configuration
- fastly_service_compute
- fastly_configstore
- fastly_configstore_entries
- fastly_secretstore
- fastly_kvstore
- fastly_service_dictionary_items
MIT License