BucketObjectArgs

data class BucketObjectArgs(val acl: Output<String>? = null, val bucket: Output<String>? = null, val cacheControl: Output<String>? = null, val content: Output<String>? = null, val contentDisposition: Output<String>? = null, val contentEncoding: Output<String>? = null, val contentMd5: Output<String>? = null, val contentType: Output<String>? = null, val expires: Output<String>? = null, val key: Output<String>? = null, val kmsKeyId: Output<String>? = null, val serverSideEncryption: Output<String>? = null, val source: Output<String>? = null) : ConvertibleToJava<BucketObjectArgs>

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

Example Usage

Uploading a file to a bucket

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.RandomInteger;
import com.pulumi.random.RandomIntegerArgs;
import com.pulumi.alicloud.oss.Bucket;
import com.pulumi.alicloud.oss.BucketArgs;
import com.pulumi.alicloud.oss.BucketObject;
import com.pulumi.alicloud.oss.BucketObjectArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var defaultRandomInteger = new RandomInteger("defaultRandomInteger", RandomIntegerArgs.builder()
.max(99999)
.min(10000)
.build());
var defaultBucket = new Bucket("defaultBucket", BucketArgs.builder()
.bucket(defaultRandomInteger.result().applyValue(result -> String.format("terraform-example-%s", result)))
.acl("private")
.build());
var defaultBucketObject = new BucketObject("defaultBucketObject", BucketObjectArgs.builder()
.bucket(defaultBucket.bucket())
.key("example_key")
.source("./main.tf")
.build());
}
}

Uploading a content to a bucket

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.RandomInteger;
import com.pulumi.random.RandomIntegerArgs;
import com.pulumi.alicloud.oss.Bucket;
import com.pulumi.alicloud.oss.BucketArgs;
import com.pulumi.alicloud.oss.BucketObject;
import com.pulumi.alicloud.oss.BucketObjectArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var defaultRandomInteger = new RandomInteger("defaultRandomInteger", RandomIntegerArgs.builder()
.max(99999)
.min(10000)
.build());
var defaultBucket = new Bucket("defaultBucket", BucketArgs.builder()
.bucket(defaultRandomInteger.result().applyValue(result -> String.format("terraform-example-%s", result)))
.acl("private")
.build());
var defaultBucketObject = new BucketObject("defaultBucketObject", BucketObjectArgs.builder()
.bucket(defaultBucket.bucket())
.key("example_key")
.content("the content that you want to upload.")
.build());
}
}

Constructors

Link copied to clipboard
fun BucketObjectArgs(acl: Output<String>? = null, bucket: Output<String>? = null, cacheControl: Output<String>? = null, content: Output<String>? = null, contentDisposition: Output<String>? = null, contentEncoding: Output<String>? = null, contentMd5: Output<String>? = null, contentType: Output<String>? = null, expires: Output<String>? = null, key: Output<String>? = null, kmsKeyId: Output<String>? = null, serverSideEncryption: Output<String>? = null, source: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): BucketObjectArgs

Properties

Link copied to clipboard
val acl: Output<String>? = null

The canned ACL to apply. Defaults to "private".

Link copied to clipboard
val bucket: Output<String>? = null

The name of the bucket to put the file in.

Link copied to clipboard
val cacheControl: Output<String>? = null

Specifies caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.

Link copied to clipboard
val content: Output<String>? = null

The literal content being uploaded to the bucket.

Link copied to clipboard
val contentDisposition: Output<String>? = null

Specifies presentational information for the object. Read RFC2616 Content-Disposition for further details.

Link copied to clipboard
val contentEncoding: Output<String>? = null

Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read RFC2616 Content-Encoding for further details.

Link copied to clipboard
val contentMd5: Output<String>? = null

The MD5 value of the content. Read MD5 for computing method.

Link copied to clipboard
val contentType: Output<String>? = null

A standard MIME type describing the format of the object data, e.g. application/octet-stream. All Valid MIME Types are valid for this input.

Link copied to clipboard
val expires: Output<String>? = null

Specifies expire date for the the request/response. Read RFC2616 Expires for further details.

Link copied to clipboard
val key: Output<String>? = null

The name of the object once it is in the bucket.

Link copied to clipboard
val kmsKeyId: Output<String>? = null

Specifies the primary key managed by KMS. This parameter is valid when the value of server_side_encryption is set to KMS. Either source or content must be provided to specify the bucket content. These two arguments are mutually-exclusive.

Link copied to clipboard
val serverSideEncryption: Output<String>? = null

Specifies server-side encryption of the object in OSS. Valid values are AES256, KMS. Default value is AES256.

Link copied to clipboard
val source: Output<String>? = null

The path to the source file being uploaded to the bucket.