File tree Expand file tree Collapse file tree 9 files changed +83
-15
lines changed Expand file tree Collapse file tree 9 files changed +83
-15
lines changed Original file line number Diff line number Diff line change 11# used for testing
2- * .tfvars
32
43# Compiled files
54* .tfstate
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ You can use this in your terraform template with the following steps.
5151
5252Authors
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
5656Reference
5757---------
Original file line number Diff line number Diff line change 1+ Alicloud OSS Terraform Module On Alibaba Cloud
2+ terraform-alicloud-oss-object
3+ =====================================================================
4+
5+ Terraform module which creates OSS bucket and upload object to the bucket on Alibaba Cloud.
6+
7+ These types of resources are supported:
8+
9+ * [ OSS] ( https://www.terraform.io/docs/providers/alicloud/d/oss_bucket_objects.html )
10+
11+ ----------------------
12+
13+ Usage
14+ -----
15+ You can use this in your terraform template with the following steps.
16+
17+ 1 . Adding a module resource to your template, e.g. main.tf
18+
19+ ```
20+ module "oss-object" {
21+ source = "terraform-alicloud-modules/oss-object/alicloud"
22+ bucketName = "your-bucket-name"
23+ sourceFile = "test.txt"
24+ object-key = "test-1.txt"
25+ }
26+ ```
27+
28+ 2. Setting `access_key` and `secret_key` values through environment variables:
29+
30+ - ALICLOUD_ACCESS_KEY
31+ - ALICLOUD_SECRET_KEY
32+ - ALICLOUD_REGION
33+
34+ ## Inputs
35+
36+ | Name | Description | Type | Default | Required |
37+ |------|-------------|:----:|:-----:|:-----:|
38+ | Name | Description | Type | Default | Required |
39+ |------|-------------|:----:|:-----:|:-----:|
40+ | bucketName | the bucket you want to create and operate | string | - | yes |
41+ | object-key | object key like general file name | string | - | yes |
42+ | sourceFile | local file name | string | - | yes |
43+
44+
45+ ## Outputs
46+
47+ | Name | Description |
48+ |------|-------------|
49+ | this_dest_file | the target object key |
50+ | this_source_file | the source file |
Original file line number Diff line number Diff line change 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.
Original file line number Diff line number Diff line change 1+ oss-object
Original file line number Diff line number Diff line change 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+
Original file line number Diff line number Diff line change 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+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments