Skill 8.4.3
Migrating state and running remote operations
Key Concepts
To move an existing configuration to HCP Terraform, add the cloud block, remove any backend block, run terraform login if needed and run terraform init. Terraform offers to migrate the existing local or backend state into the workspace, creating the workspace if it does not exist. After migration, the local state file is no longer used and can be deleted.
With remote execution, terraform plan uploads the configuration (excluding paths listed in .terraformignore) and streams a speculative plan to the terminal, and terraform apply runs a full plan and apply remotely with the workspace's variables and credentials. A workspace connected to VCS rejects applies started from the CLI, because its configuration must come from the repository.