Skip to content

Commit

Permalink
Use MINIO_ROOT_USER/MINIO_ROOT_PASSWORD instead of deprecated env vars
Browse files Browse the repository at this point in the history
* MINIO_ACCESS_KEY and MINIO_SECRET_KEY are deprecated since
  version RELEASE.2021-04-22T15-44-28Z.
* Note that the Terraform Provider will still accept the old variables.
  • Loading branch information
BuJo committed Aug 7, 2022
1 parent 4959996 commit d77cf85
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ tasks:
env:
TF_ACC: 0
MINIO_ENDPOINT: localhost:9000
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
MINIO_ENABLE_HTTPS: false
cmds:
- go test -v -cover ./minio
Expand Down
8 changes: 4 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ You can provide your configuration via the environment variables representing yo

```
$ export MINIO_ENDPOINT="http://myendpoint"
$ export MINIO_ACCESS_KEY="244tefewg"
$ export MINIO_SECRET_KEY="xgwgwqqwv"
$ export MINIO_ROOT_USER="244tefewg"
$ export MINIO_ROOT_PASSWORD="xgwgwqqwv"
```

When using this method, you may omit the
Expand All @@ -73,10 +73,10 @@ The following arguments are supported in the `provider` block:
it can also be sourced from the `MINIO_ENDPOINT` environment variable

* `minio_access_key` - (Required) Minio Access Key. It must be provided, but
it can also be sourced from the `MINIO_ACCESS_KEY` environment variable
it can also be sourced from the `MINIO_ROOT_USER` environment variable

* `minio_secret_key` - (Required) Minio Secret Key. It must be provided, but
it can also be sourced from the `MINIO_SECRET_KEY` environment variable
it can also be sourced from the `MINIO_ROOT_PASSWORD` environment variable

* `minio_region` - (Optional) Minio Region (`default: us-east-1`).

Expand Down
4 changes: 2 additions & 2 deletions minio/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ func Provider() *schema.Provider {
Required: true,
Description: "Minio Access Key",
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"MINIO_ACCESS_KEY",
"MINIO_ROOT_USER", "MINIO_ACCESS_KEY",
}, nil),
},
"minio_secret_key": {
Type: schema.TypeString,
Required: true,
Description: "Minio Secret Key",
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"MINIO_SECRET_KEY",
"MINIO_ROOT_PASSWORD", "MINIO_SECRET_KEY",
}, nil),
},
"minio_api_version": {
Expand Down
4 changes: 2 additions & 2 deletions minio/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ func testAccPreCheck(t *testing.T) {
if _, ok := os.LookupEnv("MINIO_ENDPOINT"); !ok {
valid = false
}
if _, ok := os.LookupEnv("MINIO_ACCESS_KEY"); !ok {
if _, ok := os.LookupEnv("MINIO_ROOT_USER"); !ok {
valid = false
}
if _, ok := os.LookupEnv("MINIO_SECRET_KEY"); !ok {
if _, ok := os.LookupEnv("MINIO_ROOT_PASSWORD"); !ok {
valid = false
}
if _, ok := os.LookupEnv("MINIO_ENABLE_HTTPS"); !ok {
Expand Down
8 changes: 4 additions & 4 deletions templates/index.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ You can provide your configuration via the environment variables representing yo

```
$ export MINIO_ENDPOINT="http://myendpoint"
$ export MINIO_ACCESS_KEY="244tefewg"
$ export MINIO_SECRET_KEY="xgwgwqqwv"
$ export MINIO_ROOT_USER="244tefewg"
$ export MINIO_ROOT_PASSWORD="xgwgwqqwv"
```

When using this method, you may omit the
Expand All @@ -61,10 +61,10 @@ The following arguments are supported in the `provider` block:
it can also be sourced from the `MINIO_ENDPOINT` environment variable

* `minio_access_key` - (Required) Minio Access Key. It must be provided, but
it can also be sourced from the `MINIO_ACCESS_KEY` environment variable
it can also be sourced from the `MINIO_ROOT_USER` environment variable

* `minio_secret_key` - (Required) Minio Secret Key. It must be provided, but
it can also be sourced from the `MINIO_SECRET_KEY` environment variable
it can also be sourced from the `MINIO_ROOT_PASSWORD` environment variable

* `minio_region` - (Optional) Minio Region (`default: us-east-1`).

Expand Down

0 comments on commit d77cf85

Please sign in to comment.