hashicorp / hashicorp/terraform

states/statemgr: Print backend name in lock Info

Open
#20,006 0 comments 0 reactions 0 assignees View on GitHub
backend enhancement
Dominant language
Go
Stars
49.7k
Forks
10.6k
Avg merge
21h 30m
Merged PRs (30d)
100

Description

### Current Terraform Version

```
v0.12.0-dev
```

### Use-cases

Debugging, mainly.

### Proposal

Terraform currently exposes the following info about a lock:

https://github.com/hashicorp/terraform/blob/0995559934feb88b0d41ce78d92a30ffadf59756/states/statemgr/locker.go#L185-L196

which can make it a bit difficult to even embark on any debugging route as one first has to understand where to look (filesystem or any particular remote storage).

I think it would be helpful to expose the name of the backend which holds the lock, e.g.

```
Lock Info:
ID: a7870da6-a5a2-3e83-54f5-28ace4d5bb7c
Backend: s3
Path: terraform.tfstate
Operation: OperationTypeApply
Who: radeksimko@local
Version: 0.12.0
Created: 2019-01-13 23:02:37.282887 +0000 UTC
Info:
```

Contributor guide

Open the contributing guide

Research direction

Start in states/statemgr/locker.go at the linked lines that expose lock information, and trace how the backend-specific lock data reaches that output. Confirm which backend name should be shown and verify that the displayed Lock Info includes a Backend entry alongside the existing fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.