diff --git a/internal/backend/remote-state/etcdv3/backend.go b/internal/backend/remote-state/etcdv3/backend.go index 598f31583e..7285bda968 100644 --- a/internal/backend/remote-state/etcdv3/backend.go +++ b/internal/backend/remote-state/etcdv3/backend.go @@ -15,6 +15,7 @@ const ( usernameEnvVarName = "ETCDV3_USERNAME" passwordKey = "password" passwordEnvVarName = "ETCDV3_PASSWORD" + maxRequestBytesKey = "max_request_bytes" prefixKey = "prefix" lockKey = "lock" cacertPathKey = "cacert_path" @@ -49,6 +50,13 @@ func New() backend.Backend { DefaultFunc: schema.EnvDefaultFunc(passwordEnvVarName, ""), }, + maxRequestBytesKey: &schema.Schema{ + Type: schema.TypeInt, + Optional: true, + Description: "The max request size to send to etcd.", + Default: 0, + }, + prefixKey: &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -128,6 +136,9 @@ func (b *Backend) rawClient() (*etcdv3.Client, error) { if v, ok := b.data.GetOk(passwordKey); ok && v.(string) != "" { config.Password = v.(string) } + if v, ok := b.data.GetOk(maxRequestBytesKey); ok && v.(int) != 0 { + config.MaxCallSendMsgSize = v.(int) + } if v, ok := b.data.GetOk(cacertPathKey); ok && v.(string) != "" { tlsInfo.TrustedCAFile = v.(string) }