An engineer accidentally marked an HCP Terraform workspace variable as sensitive. It holds a non-secret value, the default region, which the team wants to see in the UI again. What must the engineer do?
Choose one.
Sensitive HCP Terraform variables are write-only: no user or API call can read them back, and their attributes cannot be edited.
Marking a variable sensitive makes it write-only for everyone, including organization owners and API clients. Its value can be replaced, but its other attributes, such as the sensitive flag, cannot be changed. The documented route is to delete the variable and create a new one with the same key and the desired settings.
- Recall that sensitive means write-only for all users and the API.
- Note that the sensitive flag is one of the attributes that cannot be edited.
- Choose deleting and recreating the variable.
Exam tip: A sensitive workspace variable can be replaced or deleted, never unmasked or edited back.
Terraform Professional (002): Secrets, Rotation and Pipeline Identities — the lesson that teaches this.