diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..df982a2 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,10 @@ +## 1.2.0 (Unreleased) +## 1.1.0 (August 10, 2023) + +IMPROVEMENTS: + +- Modify output; Improves the module example [GH-5](https://github.com/terraform-alicloud-modules/terraform-alicloud-oss-object/pull/5) +- Improves the module examples [GH-4](https://github.com/terraform-alicloud-modules/terraform-alicloud-oss-object/pull/4) +## 1.0.0 (Feb 28, 2019) + +- **NEW:** `oss-object` [GH-1](https://github.com/terraform-alicloud-modules/terraform-alicloud-oss-object/pull/1) \ No newline at end of file diff --git a/README.md b/README.md index 3b83e17..736f1f1 100644 --- a/README.md +++ b/README.md @@ -46,8 +46,6 @@ You can use this in your terraform template with the following steps. ## Inputs -| Name | Description | Type | Default | Required | -|------|-------------|:----:|:-----:|:-----:| | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| | 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. | Name | Description | |------|-------------| -| this_dest_file | the target object key | -| this_source_file | the source file | +| this_bucket_object_bucket | the target object bucket | +| this_bucket_object_key | the target object key | +| this_bucket_object_source | the target object source | Authors ------- diff --git a/examples/complete/main.tf b/examples/complete/main.tf index 5fe61ca..a34d2c3 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -1,12 +1,17 @@ +resource "random_integer" "default" { + max = 999999 + min = 100000 +} + module "oss_bucket" { source = "terraform-alicloud-modules/oss-bucket/alicloud" - bucket_name = "bucket-terraform-20220222" + bucket_name = "terraform-example-${random_integer.default.result}" acl = var.acl } module "oss_object" { source = "../.." bucketName = module.oss_bucket.this_oss_bucket_id - object-key = "tf-testacc-object-key" - sourceFile = var.sourceFile + object-key = "tf-example-object-key" + sourceFile = "${path.module}/${var.sourceFile}" } \ No newline at end of file diff --git a/examples/complete/outputs.tf b/examples/complete/outputs.tf index c07d680..2e1ad6a 100644 --- a/examples/complete/outputs.tf +++ b/examples/complete/outputs.tf @@ -1,7 +1,11 @@ -output "this_dest_file" { - value = module.oss_object.this_dest_file +output "this_bucket_object_bucket" { + value = module.oss_object.this_bucket_object_bucket } -output "this_source_file" { - value = module.oss_object.this_source_file +output "this_bucket_object_key" { + value = module.oss_object.this_bucket_object_key +} + +output "this_bucket_object_source" { + value = module.oss_object.this_bucket_object_source } \ No newline at end of file diff --git a/outputs.tf b/outputs.tf index 174b362..6eda711 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,7 +1,11 @@ -output "this_dest_file" { - value = element(concat(alicloud_oss_bucket_object.this.*.key, list("")), 0) +output "this_bucket_object_bucket" { + value = alicloud_oss_bucket_object.this.bucket } -output "this_source_file" { - value = element(concat(alicloud_oss_bucket_object.this.*.source, list("")), 0) +output "this_bucket_object_key" { + value = alicloud_oss_bucket_object.this.key +} + +output "this_bucket_object_source" { + value = alicloud_oss_bucket_object.this.source } \ No newline at end of file