You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: backend/remote-state/gcs/backend.go
+32
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ import (
8
8
"fmt"
9
9
"os"
10
10
"strings"
11
+
"time"
11
12
12
13
"cloud.google.com/go/storage"
13
14
"github.com/hashicorp/terraform/backend"
@@ -35,6 +36,13 @@ type Backend struct {
35
36
36
37
projectIDstring
37
38
regionstring
39
+
40
+
// Time between consecutive heartbeats on the lock file.
41
+
lockHeartbeatInterval time.Duration
42
+
43
+
// The mininum duration that must have passed since the youngest
44
+
// recorded heartbeat before the lock file is considered stale/orphaned.
45
+
lockStaleAfter time.Duration
38
46
}
39
47
40
48
funcNew() backend.Backend {
@@ -88,6 +96,20 @@ func New() backend.Backend {
88
96
Description: "Region / location in which to create the bucket",
89
97
Default: "",
90
98
},
99
+
100
+
"lock_heartbeat_interval": {
101
+
Type: schema.TypeString,
102
+
Optional: true,
103
+
Description: "Time between consecutive heartbeats on the lock file as a duration string (cf. https://golang.org/pkg/time/#ParseDuration).",
104
+
Default: "1m",
105
+
},
106
+
107
+
"lock_stale_after": {
108
+
Type: schema.TypeString,
109
+
Optional: true,
110
+
Description: "Mininum duration (cf. https://golang.org/pkg/time/#ParseDuration) that must have passed since the youngest recorded heartbeat before the lock file is considered stale/orphaned.",
Copy file name to clipboardExpand all lines: website/docs/backends/types/gcs.html.md
+2
Original file line number
Diff line number
Diff line change
@@ -60,3 +60,5 @@ The following configuration options are supported:
60
60
*`region` / `GOOGLE_REGION` - (Optional) The region in which a new bucket is created.
61
61
For more information, see [Bucket Locations](https://cloud.google.com/storage/docs/bucket-locations).
62
62
*`encryption_key` / `GOOGLE_ENCRYPTION_KEY` - (Optional) A 32 byte base64 encoded 'customer supplied encryption key' used to encrypt all state. For more information see [Customer Supplied Encryption Keys](https://cloud.google.com/storage/docs/encryption#customer-supplied).
63
+
*`lock_heartbeat_interval` - (Optional) The time between consecutive heartbeats on the lock file as a [duration string](https://golang.org/pkg/time/#ParseDuration). Defaults to "1m".
64
+
*`lock_stale_after` - (Optional) The mininum duration (as a [duration string](https://golang.org/pkg/time/#ParseDuration)) that must have passed since the youngest recorded heartbeat before the lock file is considered stale/orphaned. Defaults to "15m".
0 commit comments