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",
});
}
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
object_source = alicloud.oss.BucketObject("object-source",
bucket="your_bucket_name",
key="new_object_key",
source="path/to/file")import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const object_source = new alicloud.oss.BucketObject("object-source", {
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",
});
}
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.oss.Bucket("example",
acl="public-read",
bucket="your_bucket_name")
object_content = alicloud.oss.BucketObject("object-content",
bucket=example.bucket,
content="the content that you want to upload.",
key="new_object_key")import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = new alicloud.oss.Bucket("example", {
acl: "public-read",
bucket: "your_bucket_name",
});
const object_content = new alicloud.oss.BucketObject("object-content", {
bucket: example.bucket,
content: "the content that you want to upload.",
key: "new_object_key",
});Create a BucketObject Resource
new BucketObject(name: string, args: BucketObjectArgs, opts?: CustomResourceOptions);def BucketObject(resource_name, opts=None, acl=None, bucket=None, cache_control=None, content=None, content_disposition=None, content_encoding=None, content_md5=None, content_type=None, expires=None, key=None, kms_key_id=None, server_side_encryption=None, source=None, __props__=None);func NewBucketObject(ctx *Context, name string, args BucketObjectArgs, opts ...ResourceOption) (*BucketObject, error)public BucketObject(string name, BucketObjectArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args BucketObjectArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args BucketObjectArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BucketObjectArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
BucketObject Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The BucketObject resource accepts the following input properties:
- Bucket string
The name of the bucket to put the file in.
- Key string
The name of the object once it is in the bucket.
- Acl string
The canned ACL to apply. Defaults to “private”.
- Cache
Control string Specifies caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.
- Content string
The literal content being uploaded to the bucket.
- Content
Disposition string Specifies presentational information for the object. Read RFC2616 Content-Disposition for further details.
- Content
Encoding string 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.
- Content
Md5 string The MD5 value of the content. Read MD5 for computing method.
- Content
Type string 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.
- Expires string
Specifies expire date for the the request/response. Read RFC2616 Expires for further details.
- Kms
Key stringId Specifies the primary key managed by KMS. This parameter is valid when the value of
server_side_encryptionis set to KMS.- Server
Side stringEncryption Specifies server-side encryption of the object in OSS. Valid values are
AES256,KMS. Default value isAES256.- Source string
The path to the source file being uploaded to the bucket.
- Bucket string
The name of the bucket to put the file in.
- Key string
The name of the object once it is in the bucket.
- Acl string
The canned ACL to apply. Defaults to “private”.
- Cache
Control string Specifies caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.
- Content string
The literal content being uploaded to the bucket.
- Content
Disposition string Specifies presentational information for the object. Read RFC2616 Content-Disposition for further details.
- Content
Encoding string 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.
- Content
Md5 string The MD5 value of the content. Read MD5 for computing method.
- Content
Type string 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.
- Expires string
Specifies expire date for the the request/response. Read RFC2616 Expires for further details.
- Kms
Key stringId Specifies the primary key managed by KMS. This parameter is valid when the value of
server_side_encryptionis set to KMS.- Server
Side stringEncryption Specifies server-side encryption of the object in OSS. Valid values are
AES256,KMS. Default value isAES256.- Source string
The path to the source file being uploaded to the bucket.
- bucket string
The name of the bucket to put the file in.
- key string
The name of the object once it is in the bucket.
- acl string
The canned ACL to apply. Defaults to “private”.
- cache
Control string Specifies caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.
- content string
The literal content being uploaded to the bucket.
- content
Disposition string Specifies presentational information for the object. Read RFC2616 Content-Disposition for further details.
- content
Encoding string 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.
- content
Md5 string The MD5 value of the content. Read MD5 for computing method.
- content
Type string 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.
- expires string
Specifies expire date for the the request/response. Read RFC2616 Expires for further details.
- kms
Key stringId Specifies the primary key managed by KMS. This parameter is valid when the value of
server_side_encryptionis set to KMS.- server
Side stringEncryption Specifies server-side encryption of the object in OSS. Valid values are
AES256,KMS. Default value isAES256.- source string
The path to the source file being uploaded to the bucket.
- bucket str
The name of the bucket to put the file in.
- key str
The name of the object once it is in the bucket.
- acl str
The canned ACL to apply. Defaults to “private”.
- cache_
control str Specifies caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.
- content str
The literal content being uploaded to the bucket.
- content_
disposition str Specifies presentational information for the object. Read RFC2616 Content-Disposition for further details.
- content_
encoding str 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.
- content_
md5 str The MD5 value of the content. Read MD5 for computing method.
- content_
type str 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.
- expires str
Specifies expire date for the the request/response. Read RFC2616 Expires for further details.
- kms_
key_ strid Specifies the primary key managed by KMS. This parameter is valid when the value of
server_side_encryptionis set to KMS.- server_
side_ strencryption Specifies server-side encryption of the object in OSS. Valid values are
AES256,KMS. Default value isAES256.- source str
The path to the source file being uploaded to the bucket.
Outputs
All input properties are implicitly available as output properties. Additionally, the BucketObject resource produces the following output properties:
- content_
length str the content length of request.
- etag str
the ETag generated for the object (an MD5 sum of the object content).
- id str
- The provider-assigned unique ID for this managed resource.
- version_
id str A unique version ID value for the object, if bucket versioning is enabled.
Look up an Existing BucketObject Resource
Get an existing BucketObject resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: BucketObjectState, opts?: CustomResourceOptions): BucketObjectstatic get(resource_name, id, opts=None, acl=None, bucket=None, cache_control=None, content=None, content_disposition=None, content_encoding=None, content_length=None, content_md5=None, content_type=None, etag=None, expires=None, key=None, kms_key_id=None, server_side_encryption=None, source=None, version_id=None, __props__=None);func GetBucketObject(ctx *Context, name string, id IDInput, state *BucketObjectState, opts ...ResourceOption) (*BucketObject, error)public static BucketObject Get(string name, Input<string> id, BucketObjectState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Acl string
The canned ACL to apply. Defaults to “private”.
- Bucket string
The name of the bucket to put the file in.
- Cache
Control string Specifies caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.
- Content string
The literal content being uploaded to the bucket.
- Content
Disposition string Specifies presentational information for the object. Read RFC2616 Content-Disposition for further details.
- Content
Encoding string 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.
- Content
Length string the content length of request.
- Content
Md5 string The MD5 value of the content. Read MD5 for computing method.
- Content
Type string 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.
- Etag string
the ETag generated for the object (an MD5 sum of the object content).
- Expires string
Specifies expire date for the the request/response. Read RFC2616 Expires for further details.
- Key string
The name of the object once it is in the bucket.
- Kms
Key stringId Specifies the primary key managed by KMS. This parameter is valid when the value of
server_side_encryptionis set to KMS.- Server
Side stringEncryption Specifies server-side encryption of the object in OSS. Valid values are
AES256,KMS. Default value isAES256.- Source string
The path to the source file being uploaded to the bucket.
- Version
Id string A unique version ID value for the object, if bucket versioning is enabled.
- Acl string
The canned ACL to apply. Defaults to “private”.
- Bucket string
The name of the bucket to put the file in.
- Cache
Control string Specifies caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.
- Content string
The literal content being uploaded to the bucket.
- Content
Disposition string Specifies presentational information for the object. Read RFC2616 Content-Disposition for further details.
- Content
Encoding string 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.
- Content
Length string the content length of request.
- Content
Md5 string The MD5 value of the content. Read MD5 for computing method.
- Content
Type string 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.
- Etag string
the ETag generated for the object (an MD5 sum of the object content).
- Expires string
Specifies expire date for the the request/response. Read RFC2616 Expires for further details.
- Key string
The name of the object once it is in the bucket.
- Kms
Key stringId Specifies the primary key managed by KMS. This parameter is valid when the value of
server_side_encryptionis set to KMS.- Server
Side stringEncryption Specifies server-side encryption of the object in OSS. Valid values are
AES256,KMS. Default value isAES256.- Source string
The path to the source file being uploaded to the bucket.
- Version
Id string A unique version ID value for the object, if bucket versioning is enabled.
- acl string
The canned ACL to apply. Defaults to “private”.
- bucket string
The name of the bucket to put the file in.
- cache
Control string Specifies caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.
- content string
The literal content being uploaded to the bucket.
- content
Disposition string Specifies presentational information for the object. Read RFC2616 Content-Disposition for further details.
- content
Encoding string 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.
- content
Length string the content length of request.
- content
Md5 string The MD5 value of the content. Read MD5 for computing method.
- content
Type string 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.
- etag string
the ETag generated for the object (an MD5 sum of the object content).
- expires string
Specifies expire date for the the request/response. Read RFC2616 Expires for further details.
- key string
The name of the object once it is in the bucket.
- kms
Key stringId Specifies the primary key managed by KMS. This parameter is valid when the value of
server_side_encryptionis set to KMS.- server
Side stringEncryption Specifies server-side encryption of the object in OSS. Valid values are
AES256,KMS. Default value isAES256.- source string
The path to the source file being uploaded to the bucket.
- version
Id string A unique version ID value for the object, if bucket versioning is enabled.
- acl str
The canned ACL to apply. Defaults to “private”.
- bucket str
The name of the bucket to put the file in.
- cache_
control str Specifies caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.
- content str
The literal content being uploaded to the bucket.
- content_
disposition str Specifies presentational information for the object. Read RFC2616 Content-Disposition for further details.
- content_
encoding str 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.
- content_
length str the content length of request.
- content_
md5 str The MD5 value of the content. Read MD5 for computing method.
- content_
type str 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.
- etag str
the ETag generated for the object (an MD5 sum of the object content).
- expires str
Specifies expire date for the the request/response. Read RFC2616 Expires for further details.
- key str
The name of the object once it is in the bucket.
- kms_
key_ strid Specifies the primary key managed by KMS. This parameter is valid when the value of
server_side_encryptionis set to KMS.- server_
side_ strencryption Specifies server-side encryption of the object in OSS. Valid values are
AES256,KMS. Default value isAES256.- source str
The path to the source file being uploaded to the bucket.
- version_
id str A unique version ID value for the object, if bucket versioning is enabled.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.