alicloud_oss_bucket_object

Provides a resource to put a object(content or file) to a oss bucket.

Example Usage

Uploading a file to a bucket

resource "random_integer" "default" {
  max = 99999
  min = 10000
}

resource "alicloud_oss_bucket" "default" {
  bucket = "terraform-example-${random_integer.default.result}"
  acl    = "private"
}

resource "alicloud_oss_bucket_object" "default" {
  bucket = alicloud_oss_bucket.default.bucket
  key    = "example_key"
  source = "./main.tf"
}

Uploading a content to a bucket

resource "random_integer" "default" {
  max = 99999
  min = 10000
}

resource "alicloud_oss_bucket" "default" {
  bucket = "terraform-example-${random_integer.default.result}"
  acl    = "private"
}

resource "alicloud_oss_bucket_object" "default" {
  bucket  = alicloud_oss_bucket.default.bucket
  key     = "example_key"
  content = "the content that you want to upload."
}

Argument Reference

The following arguments are supported:

Either source or content must be provided to specify the bucket content. These two arguments are mutually-exclusive.

Attributes Reference

The following attributes are exported