Class BucketObject
Provides a resource to put a object(content or file) to a oss bucket.
Example Usage
Uploading a file to a bucket
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var object_source = new AliCloud.Oss.BucketObject("object-source", new AliCloud.Oss.BucketObjectArgs
{
Bucket = "your_bucket_name",
Key = "new_object_key",
Source = "path/to/file",
});
}
}
Uploading a content to a bucket
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var example = new AliCloud.Oss.Bucket("example", new AliCloud.Oss.BucketArgs
{
Acl = "public-read",
Bucket = "your_bucket_name",
});
var object_content = new AliCloud.Oss.BucketObject("object-content", new AliCloud.Oss.BucketObjectArgs
{
Bucket = example.BucketName,
Content = "the content that you want to upload.",
Key = "new_object_key",
});
}
}
Inherited Members
Namespace: Pulumi.AliCloud.Oss
Assembly: Pulumi.AliCloud.dll
Syntax
public class BucketObject : CustomResource
Constructors
View SourceBucketObject(String, BucketObjectArgs, CustomResourceOptions)
Create a BucketObject resource with the given unique name, arguments, and options.
Declaration
public BucketObject(string name, BucketObjectArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| BucketObjectArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAcl
The canned ACL to apply. Defaults to "private".
Declaration
public Output<string> Acl { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Bucket
The name of the bucket to put the file in.
Declaration
public Output<string> Bucket { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
CacheControl
Specifies caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.
Declaration
public Output<string> CacheControl { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Content
The literal content being uploaded to the bucket.
Declaration
public Output<string> Content { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ContentDisposition
Specifies presentational information for the object. Read RFC2616 Content-Disposition for further details.
Declaration
public Output<string> ContentDisposition { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ContentEncoding
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.
Declaration
public Output<string> ContentEncoding { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ContentLength
the content length of request.
Declaration
public Output<string> ContentLength { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ContentMd5
The MD5 value of the content. Read MD5 for computing method.
Declaration
public Output<string> ContentMd5 { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ContentType
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.
Declaration
public Output<string> ContentType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Etag
the ETag generated for the object (an MD5 sum of the object content).
Declaration
public Output<string> Etag { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Expires
Specifies expire date for the the request/response. Read RFC2616 Expires for further details.
Declaration
public Output<string> Expires { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Key
The name of the object once it is in the bucket.
Declaration
public Output<string> Key { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
KmsKeyId
Specifies the primary key managed by KMS. This parameter is valid when the value of server_side_encryption is set to KMS.
Declaration
public Output<string> KmsKeyId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ServerSideEncryption
Specifies server-side encryption of the object in OSS. Valid values are AES256, KMS. Default value is AES256.
Declaration
public Output<string> ServerSideEncryption { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Source
The path to the source file being uploaded to the bucket.
Declaration
public Output<string> Source { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VersionId
A unique version ID value for the object, if bucket versioning is enabled.
Declaration
public Output<string> VersionId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, BucketObjectState, CustomResourceOptions)
Get an existing BucketObject resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static BucketObject Get(string name, Input<string> id, BucketObjectState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| BucketObjectState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| BucketObject |