Skip to content

Commit 2496223

Browse files
MrWolongxiaozhu36
authored andcommitted
Removes the provider setting and improves the Readme
1 parent b00a9ab commit 2496223

File tree

2 files changed

+73
-17
lines changed

2 files changed

+73
-17
lines changed

README.md

Lines changed: 73 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ These types of the module resource are supported:
1212
- [Nat Gateway](https://www.terraform.io/docs/providers/alicloud/r/nat_gateway.html)
1313
- [Kubernetes](https://www.terraform.io/docs/providers/alicloud/r/cs_kubernetes.html)
1414

15-
Terraform version
16-
-----------------
17-
The Module requires Terraform 0.12 and Terraform Provider AliCloud 1.75.0+.
18-
1915
Usage
2016
-----
2117
This example can specify the following arguments to create user-defined kuberntes cluster
@@ -76,7 +72,6 @@ data "alicloud_vpcs" "default" {
7672
7773
module "k8s" {
7874
source = "../"
79-
region = var.region
8075
8176
new_nat_gateway = true
8277
vpc_name = "tf-k8s-vpc"
@@ -113,7 +108,6 @@ data "alicloud_vpcs" "default" {
113108
114109
module "k8s" {
115110
source = "../"
116-
region = var.region
117111
118112
vpc_id = data.alicloud_vpcs.default.vpcs.0.id
119113
vswitch_ids = ["vsw-bp1pog8voc3f42arr****", "vsw-bp1jxetj1386gqssg****", "vsw-bp1s1835sq5tjss9s****"]
@@ -149,7 +143,6 @@ data "alicloud_vpcs" "default" {
149143
150144
module "k8s" {
151145
source = "../"
152-
region = var.region
153146
154147
new_nat_gateway = false
155148
vpc_id = data.alicloud_vpcs.default.vpcs.0.id
@@ -166,6 +159,78 @@ module "k8s" {
166159

167160
* [complete example](https://github.com/terraform-alicloud-modules/terraform-alicloud-kubernetes/tree/master/examples/complete)
168161

162+
## Notes
163+
From the version v1.4.0, the module has removed the following `provider` setting:
164+
165+
```hcl
166+
provider "alicloud" {
167+
profile = var.profile != "" ? var.profile : null
168+
shared_credentials_file = var.shared_credentials_file != "" ? var.shared_credentials_file : null
169+
region = var.region
170+
skip_region_validation = var.skip_region_validation
171+
configuration_source = "terraform-alicloud-modules/kubernetes"
172+
}
173+
```
174+
175+
If you still want to use the `provider` setting to apply this module, you can specify a supported version, like 1.3.0:
176+
177+
```hcl
178+
module "k8s" {
179+
source = "terraform-alicloud-modules/kubernetes/alicloud"
180+
version = "1.3.0"
181+
region = "cn-hangzhou"
182+
profile = "Your-Profile-Name"
183+
create_vpc = true
184+
vpc_name = "my-env-vpc"
185+
// ...
186+
}
187+
```
188+
189+
If you want to upgrade the module to 1.4.0 or higher in-place, you can define a provider which same region with
190+
previous region:
191+
192+
```hcl
193+
provider "alicloud" {
194+
region = "cn-hangzhou"
195+
profile = "Your-Profile-Name"
196+
}
197+
module "infrastructure" {
198+
source = "terraform-alicloud-modules/multi-zone-infrastructure-with-ots/alicloud"
199+
create_vpc = true
200+
vpc_name = "my-env-vpc"
201+
// ...
202+
}
203+
```
204+
or specify an alias provider with a defined region to the module using `providers`:
205+
206+
```hcl
207+
provider "alicloud" {
208+
region = "cn-hangzhou"
209+
profile = "Your-Profile-Name"
210+
alias = "hz"
211+
}
212+
module "infrastructure" {
213+
source = "terraform-alicloud-modules/multi-zone-infrastructure-with-ots/alicloud"
214+
providers = {
215+
alicloud = alicloud.hz
216+
}
217+
create_vpc = true
218+
vpc_name = "my-env-vpc"
219+
// ...
220+
}
221+
```
222+
223+
and then run `terraform init` and `terraform apply` to make the defined provider effect to the existing module state.
224+
225+
More details see [How to use provider in the module](https://www.terraform.io/docs/language/modules/develop/providers.html#passing-providers-explicitly)
226+
227+
## Terraform versions
228+
229+
| Name | Version |
230+
|------|---------|
231+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.0 |
232+
| <a name="requirement_alicloud"></a> [alicloud](#requirement\_alicloud) | >= 1.75.0 |
233+
169234
Submit Issues
170235
-------------
171236
If you have any problems when using this module, please opening a [provider issue](https://github.com/terraform-providers/terraform-provider-alicloud/issues/new) and let us know.
@@ -174,7 +239,7 @@ If you have any problems when using this module, please opening a [provider issu
174239

175240
Authors
176241
-------
177-
Created and maintained by He Guimin(@xiaozhu36, heguimin36@163.com)
242+
Created and maintained by Alibaba Cloud Terraform Team(terraform@alibabacloud.com)
178243

179244
License
180245
-------

main.tf

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
// Provider specific configs
2-
provider "alicloud" {
3-
profile = var.profile != "" ? var.profile : null
4-
shared_credentials_file = var.shared_credentials_file != "" ? var.shared_credentials_file : null
5-
region = var.region
6-
skip_region_validation = var.skip_region_validation
7-
configuration_source = "terraform-alicloud-modules/kubernetes"
8-
}
9-
101
// Instance_types data source for instance_type
112
data "alicloud_instance_types" "default" {
123
cpu_core_count = var.cpu_core_count

0 commit comments

Comments
 (0)