Bucket Object Args
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());
}
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
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
Properties
Link copied to clipboard
Link copied to clipboard
Specifies caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.
Link copied to clipboard
Specifies presentational information for the object. Read RFC2616 Content-Disposition for further details.
Link copied to clipboard
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
Link copied to clipboard
Specifies expire date for the the request/response. Read RFC2616 Expires for further details.
Link copied to clipboard