Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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
-------
Expand Down
11 changes: 8 additions & 3 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
@@ -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}"
}
12 changes: 8 additions & 4 deletions examples/complete/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}
12 changes: 8 additions & 4 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这两个参数为啥要删掉?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1,出参的名称和格式不对,一般是 this_{资源}_{属性} 的格式
2,value值错误

output "this_bucket_object_key" {
value = alicloud_oss_bucket_object.this.key
}

output "this_bucket_object_source" {
value = alicloud_oss_bucket_object.this.source
}