Adds constant for default workspace prefix

pull/34511/head
Graham Davison 2 years ago
parent 3c14eeb945
commit 40e593ddc1

@ -942,7 +942,7 @@ func (b *Backend) Configure(obj cty.Value) tfdiags.Diagnostics {
)
b.acl = stringAttr(obj, "acl")
b.workspaceKeyPrefix = stringAttrDefault(obj, "workspace_key_prefix", "env:")
b.workspaceKeyPrefix = stringAttrDefault(obj, "workspace_key_prefix", defaultWorkspaceKeyPrefix)
b.serverSideEncryption = boolAttr(obj, "encrypt")
b.kmsKeyID = stringAttr(obj, "kms_key_id")
b.ddbTable = stringAttr(obj, "dynamodb_table")

@ -22,6 +22,12 @@ import (
"github.com/hashicorp/terraform/internal/states/statemgr"
)
const (
// defaultWorkspaceKeyPrefix is the default prefix for workspace storage.
// The colon is used to reduce the chance of name conflicts with existing objects.
defaultWorkspaceKeyPrefix = "env:"
)
func (b *Backend) Workspaces() ([]string, error) {
const maxKeys = 1000

Loading…
Cancel
Save