docs/heroku.md
This utilizes terraform-provider-heroku.
Heroku organizes itself by apps. This importer tool is designed to capture complete apps with all their dependent resources like addons, domains, etc.
Apps must be identified by ID (UUID). Even though some resources may import successfully when filtering by app name, apps themselves must be identified by ID. To get an app ID, use Heroku CLI to get the top-level id property:
heroku apps:info --json --app=<NAME>
When importing apps, their settable config vars (those not from add-ons) are added to the Terraform configuration as config_vars. These may contain secrets, and can manually be split into sensitive_config_vars before the plan/apply.
The imported configuration cannot build & launch apps in a new place. To launch apps that have been imported with Terraformer, one of the following is required:
git push heroku master from each app's repoheroku_build resource added to the Terraform configuration.✏️ Please replace angle-bracketed <VALUES> with your specific values.
export HEROKU_API_KEY=<token>
# All team's apps
./terraformer import heroku --resources=app --team=<NAME>
# Specific app(s), by UUID
./terraformer import heroku --resources=app --filter=app=<ID>
./terraformer import heroku --resources=app --filter=app=<ID>:<ID2>:<ID3>
# Output directory
./terraformer import heroku --resources=app --filter=app=<ID> --path-pattern='{output}/{provider}/<DIRECTORY NAME>'
# All enabled features of HEROKU_API_KEY's Heroku account
./terraformer import heroku --resources=account_feature
Heroku Terraformer resources with the terraform-provider-heroku resources they import:
account_feature
heroku_account_featureapp
heroku_addonheroku_addon_attachment (includes attachments to other apps)heroku_appheroku_app_featureheroku_app_webhookheroku_domainheroku_drainheroku_formationheroku_sslpipeline
heroku_pipelinepipeline_coupling
heroku_pipeline_couplingteam_collaborator
heroku_team_collaboratorteam_member
heroku_team_member