Skip to content

Commit c0816b6

Browse files
author
王超
committed
improves the module examples/complete
1 parent db52c20 commit c0816b6

File tree

9 files changed

+70
-15
lines changed

9 files changed

+70
-15
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# used for testing
2-
*.tfvars
32

43
# Compiled files
54
*.tfstate

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ You can use this in your terraform template with the following steps.
5151
5252
Authors
5353
-------
54-
Created and maintained by He Guimin(@xiaozhu36, heguimin36@163.com)
54+
Created and maintained by Alibaba Cloud Terraform Team(terraform@alibabacloud.com)
5555
5656
Reference
5757
---------

examples/complete/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Complete terraform-alicloud-oss-object
2+
=====================================================================
3+
4+
Terraform module which creates OSS bucket and upload object to the bucket on Alibaba Cloud.
5+
6+
These types of resources are supported:
7+
8+
* [OSS](https://www.terraform.io/docs/providers/alicloud/d/oss_bucket_objects.html)
9+
10+
## Usage
11+
12+
To run this example you need to execute:
13+
14+
```bash
15+
$ terraform init
16+
$ terraform plan
17+
$ terraform apply
18+
```
19+
20+
Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources.
21+
22+
This example provides the tf variables file in the folder `tfvars`. If you want to create or update this example,
23+
you can run this example as the following commands:
24+
```bash
25+
$ terraform plan -var-file=tfvars/01-update.tfvars
26+
$ terraform apply -var-file=tfvars/01-update.tfvars
27+
```
28+
29+
Also, you can add more variables files in the folder `tfvars`.
30+
31+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
32+
## Requirements
33+
34+
| Name | Version |
35+
|------|---------|
36+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.0 |
37+
| <a name="requirement_alicloud"></a> [alicloud](#requirement\_alicloud) | >= 1.56.0 |

examples/complete/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Upload file without encryption
2+
module "oss-object" {
3+
source = "../.."
4+
bucketName = var.bucketName
5+
sourceFile = var.sourceFile
6+
object-key = var.object-key
7+
}
File renamed without changes.

examples/complete/test2.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
oss-object
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
##############################################################
2+
#variables for alicloud_oss_bucket_object
3+
##############################################################
4+
bucketName = "bucket-terraform-20220111"
5+
sourceFile = "test2.txt"
6+
object-key = "test-2.txt"
7+

examples/complete/variables.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
variable "bucketName" {
2+
description = "The name of the bucket to put the file in."
3+
type = "string"
4+
default = "bucket-terraform-20220110"
5+
}
6+
7+
variable "object-key" {
8+
description = "The name of the object once it is in the bucket."
9+
type = "string"
10+
default = "test-1.txt"
11+
}
12+
13+
variable "sourceFile" {
14+
description = "The path to the source file being uploaded to the bucket."
15+
type = "string"
16+
default = "test.txt"
17+
}

examples/upload-to-oss/main.tf

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

0 commit comments

Comments
 (0)