Skip to content

Commit

Permalink
Make auth_url optional (#328)
Browse files Browse the repository at this point in the history
This makes the auth_url default to https://iam.myhuaweicloud.com
  • Loading branch information
niuzhenguo committed May 28, 2020
1 parent 2563d78 commit 81dcdbd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
7 changes: 4 additions & 3 deletions huaweicloud/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ func Provider() terraform.ResourceProvider {
},

"auth_url": {
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("OS_AUTH_URL", ""),
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc(
"OS_AUTH_URL", "https://iam.myhuaweicloud.com:443/v3"),
Description: descriptions["auth_url"],
},

Expand Down
12 changes: 2 additions & 10 deletions website/docs/index.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ provider "huaweicloud" {
domain_name = "${var.domain_name}"
tenant_name = "${var.tenant_name}"
region = "${var.region}"
auth_url = "https://iam.myhwclouds.com:443/v3"
}
# Create a web server
Expand All @@ -51,7 +50,6 @@ provider "huaweicloud" {
domain_name = "${var.domain_name}"
tenant_name = "${var.tenant_name}"
region = "${var.region}"
auth_url = "https://iam.myhwclouds.com:443/v3"
}
```

Expand All @@ -64,7 +62,6 @@ provider "huaweicloud" {
domain_name = "${var.domain_name}"
tenant_name = "${var.tenant_name}"
region = "${var.region}"
auth_url = "https://iam.myhwclouds.com:443/v3"
}
```

Expand All @@ -76,7 +73,6 @@ provider "huaweicloud" {
domain_name = "${var.domain_name}"
tenant_name = "${var.tenant_name}"
region = "${var.region}"
auth_url = "https://iam.myhwclouds.com:443/v3"
}
```

Expand All @@ -93,7 +89,6 @@ provider "huaweicloud" {
password = "${var.password}"
domain_name = "${var.domain_name}"
region = "${var.region}"
auth_url = "https://iam.myhwclouds.com:443/v3"
}
```

Expand All @@ -108,7 +103,6 @@ provider "huaweicloud" {
secret_key = "${var.secret_key}"
domain_name = "${var.domain_name}"
region = "${var.region}"
auth_url = "https://iam.myhwclouds.com:443/v3"
}
```

Expand All @@ -121,7 +115,6 @@ provider "huaweicloud" {
delegated_project = "${var.delegated_project}"
token = "${var.token}"
region = "${var.region}"
auth_url = "https://iam.myhwclouds.com:443/v3"
}
```
```token``` specified is not the normal token, but must have the authority of 'Agent Operator'
Expand All @@ -136,9 +129,8 @@ The following arguments are supported:
* `secret_key` - (Optional) The secret key of the HuaweiCloud to use.
If omitted, the `OS_SECRET_KEY` environment variable is used.

* `auth_url` - (Required) The Identity authentication URL. If omitted, the
`OS_AUTH_URL` environment variable is used. To find the auth_url, you can
refer to [Regions and Endpoints](https://developer.huaweicloud.com/en-us/endpoint)
* `auth_url` - (Optional, Required before 1.14.0) The Identity authentication URL. If omitted, the
`OS_AUTH_URL` environment variable is used. This is not required if you use Huawei Cloud.

* `region` - (Optional) The region of the HuaweiCloud to use. If omitted,
the `OS_REGION_NAME` environment variable is used. If `OS_REGION_NAME` is
Expand Down

0 comments on commit 81dcdbd

Please sign in to comment.