Skip to content

Commit 3c62a15

Browse files
author
alibaba
committed
Improved design and markdown files
1 parent 468422b commit 3c62a15

File tree

11 files changed

+73
-307
lines changed

11 files changed

+73
-307
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
## 1.0.0 (2021-08-28)
1+
## 1.0.0 (2021-08-31)
2+
23
- Project initialization.

README-CN.md

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,44 @@ terraform-alicloud-adb
1313

1414
----------------------
1515

16-
## 版本要求
17-
| Name | Version |
18-
|------|---------|
19-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
20-
| <a name="requirement_alicloud"></a> [alicloud](#requirement\_alicloud) | >= 1.131.0 |
16+
## 用法
2117

22-
## Providers
23-
| Name | Version |
24-
|------|---------|
25-
| <a name="provider_alicloud"></a> [alicloud](#provider\_alicloud) | >= 1.131.0 |
18+
```hcl
19+
module "adb" {
20+
source = "terraform-alicloud-modules/adb/alicloud"
21+
description = "Test new adb."
22+
}
23+
```
2624

25+
## 注意事项
2726

28-
## 用法
29-
```
30-
module "adb" {
31-
source = "../"
32-
name = "tf-adb-cluster"
33-
description = "Test new adb again."
34-
}
35-
```
27+
* 本 Module 使用的 AccessKey 和 SecretKey 可以直接从 `profile``shared_credentials_file`
28+
中获取。如果未设置,可通过下载安装 [aliyun-cli](https://github.com/aliyun/aliyun-cli#installation) 后进行配置。
3629

30+
## 要求
3731

38-
## 注意事项
39-
本 Module 使用的 AccessKey 和 SecretKey 可以直接从 `profile``shared_credentials_file` 中获取。如果未设置,可通过下载安装 [aliyun-cli](https://github.com/aliyun/aliyun-cli#installation) 后进行配置。
32+
| Name | Version |
33+
|------|---------|
34+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | > = 0.13.0 |
35+
| <a name="requirement_alicloud"></a> [alicloud](#requirement\_alicloud) | > = 1.56.0 |
4036

41-
- ALICLOUD_ACCESS_KEY
42-
- ALICLOUD_SECRET_KEY
43-
- ALICLOUD_REGION
37+
## Providers
38+
39+
| Name | Version |
40+
|------|---------|
41+
| <a name="provider_alicloud"></a> [alicloud](#provider\_alicloud) | > = 1.56.0 |
4442

4543
## 提交问题
46-
如果在使用该 Terraform Module 的过程中有任何问题,可以直接创建一个 [Provider Issue](https://github.com/aliyun/terraform-provider-alicloud/issues/new),我们将根据问题描述提供解决方案。
44+
45+
如果在使用该 Terraform Module
46+
的过程中有任何问题,可以直接创建一个 [Provider Issue](https://github.com/aliyun/terraform-provider-alicloud/issues/new),我们将根据问题描述提供解决方案。
4747

4848
## 作者
49+
4950
Created and maintained by Will(ppnjy@qq.com)
5051

5152
## 相关
53+
5254
* [Terraform-Provider-Alicloud Github](https://github.com/terraform-providers/terraform-provider-alicloud)
5355
* [Terraform-Provider-Alicloud Release](https://releases.hashicorp.com/terraform-provider-alicloud/)
5456
* [Terraform-Provider-Alicloud Docs](https://www.terraform.io/docs/providers/alicloud/index.html)

README.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,44 @@ These types of resources are supported:
1313

1414
----------------------
1515

16+
## Usage
17+
18+
```hcl
19+
module "adb" {
20+
source = "terraform-alicloud-modules/adb/alicloud"
21+
description = "Test new adb."
22+
}
23+
```
24+
25+
## Notes
26+
27+
* This module using AccessKey and SecretKey are from `profile` and `shared_credentials_file`. If you have not set them
28+
yet, please install [aliyun-cli](https://github.com/aliyun/aliyun-cli#installation) and configure it.
1629

1730
## Requirements
31+
1832
| Name | Version |
1933
|------|---------|
20-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
21-
| <a name="requirement_alicloud"></a> [alicloud](#requirement\_alicloud) | >= 1.131.0 |
34+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | > = 0.13.0 |
35+
| <a name="requirement_alicloud"></a> [alicloud](#requirement\_alicloud) | > = 1.56.0 |
2236

2337
## Providers
38+
2439
| Name | Version |
2540
|------|---------|
26-
| <a name="provider_alicloud"></a> [alicloud](#provider\_alicloud) | >= 1.131.0 |
27-
28-
29-
## Usage
30-
```
31-
module "adb" {
32-
source = "../"
33-
name = "tf-adb-cluster"
34-
description = "Test new adb again."
35-
}
36-
```
37-
38-
39-
## Notes
40-
* This module using AccessKey and SecretKey are from `profile` and `shared_credentials_file`.
41-
If you have not set them yet, please install [aliyun-cli](https://github.com/aliyun/aliyun-cli#installation) and configure it.
41+
| <a name="provider_alicloud"></a> [alicloud](#provider\_alicloud) | > = 1.56.0 |
4242

4343
## Submit Issues
44-
If you have any problems when using this module, please opening a [provider issue](https://github.com/aliyun/terraform-provider-alicloud/issues/new) and let us know.
44+
45+
If you have any problems when using this module, please opening
46+
a [provider issue](https://github.com/aliyun/terraform-provider-alicloud/issues/new) and let us know.
4547

4648
## Authors
49+
4750
Created and maintained by Will(ppnjy@qq.com)
4851

4952
## Reference
53+
5054
* [Terraform-Provider-Alicloud Github](https://github.com/terraform-providers/terraform-provider-alicloud)
5155
* [Terraform-Provider-Alicloud Release](https://releases.hashicorp.com/terraform-provider-alicloud/)
5256
* [Terraform-Provider-Alicloud Docs](https://www.terraform.io/docs/providers/alicloud/index.html)

main.tf

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,3 @@
1-
terraform {
2-
required_providers {
3-
alicloud = {
4-
source = "aliyun/alicloud"
5-
version = "1.126.0"
6-
}
7-
}
8-
}
9-
10-
data "alicloud_zones" "default" {
11-
available_resource_creation = var.creation
12-
}
13-
14-
resource "alicloud_vpc" "default" {
15-
vpc_name = var.name
16-
cidr_block = var.vpc_cidr_block
17-
}
18-
19-
resource "alicloud_vswitch" "default" {
20-
vpc_id = alicloud_vpc.default.id
21-
cidr_block = var.vswitch_cidr_block
22-
zone_id = data.alicloud_zones.default.zones[0].id
23-
vswitch_name = var.name
24-
}
25-
261
resource "alicloud_adb_db_cluster" "this" {
272
db_cluster_category = var.category
283
db_cluster_class = var.class
@@ -32,7 +7,7 @@ resource "alicloud_adb_db_cluster" "this" {
327
mode = var.mode
338
db_cluster_version = var.cluster_version
349
payment_type = var.payment_type
35-
vswitch_id = alicloud_vswitch.default.id
10+
vswitch_id = var.vswitch_id
3611
maintain_time = var.maintain_time
3712
tags = {
3813
Created = var.tags_created

outputs.tf

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
1-
locals {
2-
this_adb_id = alicloud_adb_db_cluster.this.id
3-
this_vswitch_id = alicloud_vswitch.default.id
4-
this_vpc_id = alicloud_vpc.default.id
5-
}
6-
71
output "this_adb_id" {
8-
value = local.this_adb_id
9-
}
10-
11-
output "this_vswitch_id" {
12-
value = local.this_vswitch_id
2+
value = alicloud_adb_db_cluster.this.id
133
}
144

15-
output "this_vpc_id" {
16-
value = local.this_vpc_id
5+
output "this_adb_description" {
6+
value = alicloud_adb_db_cluster.this.description
177
}

terratest/basic/main.tf

Lines changed: 0 additions & 43 deletions
This file was deleted.

terratest/basic/outputs.tf

Lines changed: 0 additions & 22 deletions
This file was deleted.

terratest/basic/variables.tf

Lines changed: 0 additions & 95 deletions
This file was deleted.

0 commit comments

Comments
 (0)