Import syntax
Import IDs by resource
Each resource type uses a different identifier for import:| Resource | Import ID | Example |
|---|---|---|
devhelm_monitor | Monitor name | terraform import devhelm_monitor.api "API Health" |
devhelm_alert_channel | Channel name | terraform import devhelm_alert_channel.slack "Slack Alerts" |
devhelm_tag | Tag name | terraform import devhelm_tag.prod "production" |
devhelm_environment | Environment slug | terraform import devhelm_environment.staging "staging" |
devhelm_secret | Secret key | terraform import devhelm_secret.token "API_TOKEN" |
devhelm_webhook | Webhook URL | terraform import devhelm_webhook.events "https://hooks.example.com/devhelm" |
devhelm_resource_group | Group name | terraform import devhelm_resource_group.payments "Payment Service" |
devhelm_dependency | Service slug | terraform import devhelm_dependency.github "github" |
Step-by-step
1. Write the resource block
Before importing, create the Terraform resource block that matches the existing resource:2. Run import
3. Run plan
Verify the imported state matches your configuration:Bulk import
For importing many resources, use a shell loop:Secrets import
Imported secrets set a placeholder value since secret values are write-only. After import, update thevalue attribute to the actual secret:
Next steps
Terraform in CI/CD
Automate plan and apply in CI pipelines.
Data sources
Reference resources without importing them.