Skip to content

Commit e6a9e42

Browse files
committed
Improves the module example
1 parent 1e7877a commit e6a9e42

File tree

5 files changed

+37
-15
lines changed

5 files changed

+37
-15
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## 1.2.0 (Unreleased)
2+
## 1.1.0 (August 10, 2023)
3+
4+
IMPROVEMENTS:
5+
6+
- Modify output; Improves the module example [GH-5](https://github.com/terraform-alicloud-modules/terraform-alicloud-oss-object/pull/5)
7+
- Improves the module examples [GH-4](https://github.com/terraform-alicloud-modules/terraform-alicloud-oss-object/pull/4)
8+
## 1.0.0 (Feb 28, 2019)
9+
10+
- **NEW:** `oss-object` [GH-1](https://github.com/terraform-alicloud-modules/terraform-alicloud-oss-object/pull/1)

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ You can use this in your terraform template with the following steps.
4646
4747
## Inputs
4848
49-
| Name | Description | Type | Default | Required |
50-
|------|-------------|:----:|:-----:|:-----:|
5149
| Name | Description | Type | Default | Required |
5250
|------|-------------|:----:|:-----:|:-----:|
5351
| bucketName | the bucket you want to create and operate | string | - | yes |
@@ -59,8 +57,9 @@ You can use this in your terraform template with the following steps.
5957
6058
| Name | Description |
6159
|------|-------------|
62-
| this_dest_file | the target object key |
63-
| this_source_file | the source file |
60+
| this_bucket_object_bucket | the target object bucket |
61+
| this_bucket_object_key | the target object key |
62+
| this_bucket_object_source | the target object source |
6463
6564
Authors
6665
-------

examples/complete/main.tf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
resource "random_integer" "default" {
2+
max = 999999
3+
min = 100000
4+
}
5+
16
module "oss_bucket" {
27
source = "terraform-alicloud-modules/oss-bucket/alicloud"
3-
bucket_name = "bucket-terraform-20220222"
8+
bucket_name = "terraform-example-${random_integer.default.result}"
49
acl = var.acl
510
}
611

712
module "oss_object" {
813
source = "../.."
914
bucketName = module.oss_bucket.this_oss_bucket_id
10-
object-key = "tf-testacc-object-key"
11-
sourceFile = var.sourceFile
15+
object-key = "tf-example-object-key"
16+
sourceFile = "${path.module}/${var.sourceFile}"
1217
}

examples/complete/outputs.tf

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
output "this_dest_file" {
2-
value = module.oss_object.this_dest_file
1+
output "this_bucket_object_bucket" {
2+
value = module.oss_object.this_bucket_object_bucket
33
}
44

5-
output "this_source_file" {
6-
value = module.oss_object.this_source_file
5+
output "this_bucket_object_key" {
6+
value = module.oss_object.this_bucket_object_key
7+
}
8+
9+
output "this_bucket_object_source" {
10+
value = module.oss_object.this_bucket_object_source
711
}

outputs.tf

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
output "this_dest_file" {
2-
value = element(concat(alicloud_oss_bucket_object.this.*.key, list("")), 0)
1+
output "this_bucket_object_bucket" {
2+
value = alicloud_oss_bucket_object.this.bucket
33
}
44

5-
output "this_source_file" {
6-
value = element(concat(alicloud_oss_bucket_object.this.*.source, list("")), 0)
5+
output "this_bucket_object_key" {
6+
value = alicloud_oss_bucket_object.this.key
7+
}
8+
9+
output "this_bucket_object_source" {
10+
value = alicloud_oss_bucket_object.this.source
711
}

0 commit comments

Comments
 (0)