Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

Terraform: Step‑By‑Step: Use Local CLI to Modify Remote State in TFE

Below is a step‑by‑step tutorial for using the Terraform CLI against a VCS‑connected HCP/TFE workspace, plus a command catalog for all the common remote actions.

Step‑By‑Step: Use Local CLI to Modify Remote State in TFE

  1. Verify your Terraform version matches the workspace requirement
   terraform version

If the workspace requires ~>1.14.0, make sure you’re on 1.14.x.

  1. Authenticate to HCP/TFE
   terraform login
  1. Set the remote workspace (pick one method) Option A: Use env vars (fast + explicit)
   export TF_CLOUD_ORGANIZATION="Drivemode"
   export TF_WORKSPACE="evp-aws-development-core"Code language: JavaScript (javascript)

Option B: Use workspace selection after init

   terraform init
   terraform workspace list
   terraform workspace select evp-aws-development-coreCode language: PHP (php)
  1. Initialize the backend
   terraform init
  1. Confirm the remote state is reachable
   terraform state listCode language: PHP (php)
  1. Modify remote state (example: untaint)
   terraform untaint 'module.k8s_az_anchor[0].kubernetes_manifest.priority_class[0]'Code language: JavaScript (javascript)
  1. Verify the plan is now clean
   terraform plan

That flow modifies the remote state in TFE because your backend is remote and the CLI is authenticated.

Remote Run Commands (All Common Commands That Run Remote Actions)

These commands create or change remote resources (or interact with remote state):

  1. Plan (remote run)
   terraform plan
  1. Apply (remote run)
   terraform apply
  1. Destroy (remote run)
   terraform destroy

Alternative:

   terraform apply -destroy
  1. Import (writes to remote state)
   terraform import <resource_address> <remote_id>Code language: HTML, XML (xml)
  1. Refresh only (safe read/update of state)
   terraform plan -refresh-only
  1. State list (remote state)
   terraform state listCode language: PHP (php)
  1. State show (remote state)
   terraform state show <resource_address>Code language: HTML, XML (xml)
  1. State move (remote state)
   terraform state mv <old_address> <new_address>Code language: HTML, XML (xml)
  1. State remove (remote state)
   terraform state rm <resource_address>Code language: HTML, XML (xml)
  1. State pull (remote → local file) terraform state pull > /tmp/tfstate.json
  2. State push (local file → remote) terraform state push /tmp/tfstate.json
  3. Replace provider in state (remote state) terraform state replace-provider <old_provider> <new_provider>
  4. Taint / Untaint (if supported by your version) terraform taint <resource_address> terraform untaint <resource_address>
  5. Force unlock remote state (rare) terraform force-unlock <LOCK_ID>
  6. Show outputs (remote state)
    bash terraform output

Important behavior in VCS‑connected workspaces

  • CLI runs use your local config snapshot, not the Git branch snapshot.
  • If CLI‑driven runs are disabled in the workspace, plan/apply/import will fail.
  • State commands still work if your org policy allows and your version matches.

If you want, I can tailor this to your exact workspace settings. Which one is your workspace using?

  1. VCS‑connected + CLI runs allowed
  2. VCS‑connected + CLI runs disabled
  3. CLI‑driven workspace (no VCS)

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

6 Best Klaviyo alternatives for feature availability 2026

Email marketing is a channel that you completely own and that holds an average of $36-$42 ROI for every dollar spent. Once brand owners recognize this number,…

Read More

Technologies in iGaming and the Role of Soft2Bet

Modern iGaming technology connects online casinos, sportsbooks, payments, user accounts, data tools, and product design, while Soft2Bet offers a practical example of how these layers can work…

Read More

Top 10 AI Technical Writing Assistants: Features, Pros, Cons & Comparison

Introduction AI Technical Writing Assistants help engineering teams, DevOps teams, product teams, API developers, and documentation specialists create clear, structured, and consistent technical content such as API…

Read More

Top 10 AI Product Spec Writing Assistants: Features, Pros, Cons & Comparison

Introduction AI Product Spec Writing Assistants help product managers, founders, designers, engineering leads, and business teams turn ideas into structured product requirement documents, user stories, acceptance criteria,…

Read More

Top 10 AI Observability Copilots: Features, Pros, Cons & Comparison

Introduction AI Observability Copilots help engineering, DevOps, SRE, platform, and AI infrastructure teams monitor, investigate, analyze, and optimize complex systems using conversational AI, automated telemetry correlation, anomaly…

Read More

Best Higher Education SEO & GEO Agencies for Enrollment Growth

Enrollment growth through digital channels has always depended on one foundational requirement — that prospective students can actually find the institution at the moments when they are…

Read More
Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Jason Mitchell
Jason Mitchell
2 months ago

Good article! It explains how to use the Terraform CLI to modify remote state in Terraform Enterprise step by step. Very helpful for anyone working with Terraform and remote state management.

1
0
Would love your thoughts, please comment.x
()
x