Skip to content

Delete key from Terraform Cloud state

Sometimes it can be necessary to change a key in the Terraform Cloud state without changing the Terraform files.

  1. Change the definition to:
terraform {
backend "remote" {
organization = "org"
hostname = ""
workspaces {
name = "workspace"
  1. Ensure your ~/.terraformrc is available
credentials "" {
token = "token from"
  1. Test if the connection works
terraform state list
  1. Remove the actual key
terraform state rm 'module.something.something_config_map.auth[0]'
  1. When done, remove the ~/.terraformrc file and undo the changes to avoid accidents


Links to this note

These notes are unpolished collections of thoughts, unfinished ideas, and things I want to remember later. In the spirit of learning in public, I'm sharing them here. Have fun exploring, if you want!
© 2022 by Adrian Philipp