Allow for username and password to be read from envvars.

This commit is contained in:
Bruno Miguel Custodio 2017-09-08 23:41:27 +01:00
parent 8f7b315037
commit 6daf1d9d84
No known key found for this signature in database
GPG Key ID: 84CDD9E18A1A6B2C
2 changed files with 4 additions and 4 deletions

View File

@ -25,14 +25,14 @@ func New() backend.Backend {
Type: schema.TypeString, Type: schema.TypeString,
Optional: true, Optional: true,
Description: "Username used to connect to the etcd cluster.", Description: "Username used to connect to the etcd cluster.",
Default: "", // To prevent input. DefaultFunc: schema.EnvDefaultFunc("ETCDV3_USERNAME", ""),
}, },
"password": &schema.Schema{ "password": &schema.Schema{
Type: schema.TypeString, Type: schema.TypeString,
Optional: true, Optional: true,
Description: "Password used to connect to the etcd cluster.", Description: "Password used to connect to the etcd cluster.",
Default: "", // To prevent input. DefaultFunc: schema.EnvDefaultFunc("ETCDV3_PASSWORD", ""),
}, },
"prefix": &schema.Schema{ "prefix": &schema.Schema{

View File

@ -47,7 +47,7 @@ data "terraform_remote_state" "foo" {
The following configuration options / environment variables are supported: The following configuration options / environment variables are supported:
* `endpoints` - (Required) The list of 'etcd' endpoints which to connect to. * `endpoints` - (Required) The list of 'etcd' endpoints which to connect to.
* `username` - (Optional) Username used to connect to the etcd cluster. * `username` / `ETCDV3_USERNAME` - (Optional) Username used to connect to the etcd cluster.
* `password` - (Optional) Password used to connect to the etcd cluster. * `password` / `ETCDV3_PASSWORD` - (Optional) Password used to connect to the etcd cluster.
* `prefix` - (Optional) An optional prefix to be added to keys when to storing state in etcd. Defaults to `""`. * `prefix` - (Optional) An optional prefix to be added to keys when to storing state in etcd. Defaults to `""`.
* `lock` - (Optional) Whether to lock state access. Defaults to `true`. * `lock` - (Optional) Whether to lock state access. Defaults to `true`.