Module oss
This page documents the language specification for the alicloud package. If you're looking for help working with the inputs, outputs, or functions of alicloud resources in a Pulumi program, please see the resource documentation for examples and API reference.
This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the
pulumi/pulumi-alicloudrepo; however, if that doesn’t turn up anything, please consult the sourceterraform-providers/terraform-provider-alicloudrepo.
Resources
Functions
Others
- BucketArgs
- BucketObjectArgs
- BucketObjectState
- BucketState
- GetBucketObjectsArgs
- GetBucketObjectsResult
- GetBucketsArgs
- GetBucketsResult
- GetInstanceAttachmentsArgs
- GetInstanceAttachmentsResult
- GetInstancesArgs
- GetInstancesResult
- GetTablesArgs
- GetTablesResult
Resources
Resource Bucket
class Bucket extends CustomResourceProvides a resource to create a oss bucket and set its attribution.
NOTE: The bucket namespace is shared by all users of the OSS system. Please set bucket name as unique as possible.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const bucketAcl = new alicloud.oss.Bucket("bucket-acl", {
acl: "private",
bucket: "bucket-170309-acl",
});constructor
new Bucket(name: string, args?: BucketArgs, opts?: pulumi.CustomResourceOptions)Create a Bucket resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: BucketState, opts?: pulumi.CustomResourceOptions): BucketGet an existing Bucket resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is BucketReturns true if the given object is an instance of Bucket. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property acl
public acl: pulumi.Output<string | undefined>;The canned ACL to apply. Can be “private”, “public-read” and “public-read-write”. Defaults to “private”.
property bucket
public bucket: pulumi.Output<string | undefined>;property corsRules
public corsRules: pulumi.Output<BucketCorsRule[] | undefined>;A rule of Cross-Origin Resource Sharing (documented below). The items of core rule are no more than 10 for every OSS bucket.
property creationDate
public creationDate: pulumi.Output<string>;The creation date of the bucket.
property extranetEndpoint
public extranetEndpoint: pulumi.Output<string>;The extranet access endpoint of the bucket.
property forceDestroy
public forceDestroy: pulumi.Output<boolean | undefined>;A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable. Defaults to “false”.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property intranetEndpoint
public intranetEndpoint: pulumi.Output<string>;The intranet access endpoint of the bucket.
property lifecycleRules
public lifecycleRules: pulumi.Output<BucketLifecycleRule[] | undefined>;A configuration of object lifecycle management (documented below).
property location
public location: pulumi.Output<string>;The location of the bucket.
property logging
public logging: pulumi.Output<BucketLogging | undefined>;A Settings of bucket logging (documented below).
property loggingIsenable
public loggingIsenable: pulumi.Output<boolean | undefined>;The flag of using logging enable container. Defaults true.
property owner
public owner: pulumi.Output<string>;The bucket owner.
property policy
public policy: pulumi.Output<string | undefined>;Json format text of bucket policy bucket policy management.
property refererConfig
public refererConfig: pulumi.Output<BucketRefererConfig | undefined>;The configuration of referer (documented below).
property serverSideEncryptionRule
public serverSideEncryptionRule: pulumi.Output<BucketServerSideEncryptionRule | undefined>;A configuration of server-side encryption (documented below).
property storageClass
public storageClass: pulumi.Output<string | undefined>;Specifies the storage class that objects that conform to the rule are converted into. The storage class of the objects in a bucket of the IA storage class can be converted into Archive but cannot be converted into Standard. Values: IA, Archive.
property tags
public tags: pulumi.Output<{[key: string]: any} | undefined>;A mapping of tags to assign to the bucket. The items are no more than 10 for a bucket.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
property versioning
public versioning: pulumi.Output<BucketVersioning | undefined>;A state of versioning (documented below).
property website
public website: pulumi.Output<BucketWebsite | undefined>;A website object(documented below).
Resource BucketObject
class BucketObject extends CustomResourceProvides a resource to put a object(content or file) to a oss bucket.
Example Usage
Uploading a file to a bucket
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const objectSource = new alicloud.oss.BucketObject("object-source", {
bucket: "yourBucketName",
key: "newObjectKey",
source: "path/to/file",
});Uploading a content to a bucket
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = new alicloud.oss.Bucket("example", {
acl: "public-read",
bucket: "yourBucketName",
});
const objectContent = new alicloud.oss.BucketObject("object-content", {
bucket: example.bucket,
content: "the content that you want to upload.",
key: "newObjectKey",
});constructor
new BucketObject(name: string, args: BucketObjectArgs, opts?: pulumi.CustomResourceOptions)Create a BucketObject resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: BucketObjectState, opts?: pulumi.CustomResourceOptions): BucketObjectGet an existing BucketObject resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is BucketObjectReturns true if the given object is an instance of BucketObject. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property acl
public acl: pulumi.Output<string | undefined>;The canned ACL to apply. Defaults to “private”.
property bucket
public bucket: pulumi.Output<string>;The name of the bucket to put the file in.
property cacheControl
public cacheControl: pulumi.Output<string | undefined>;Specifies caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.
property content
public content: pulumi.Output<string | undefined>;The literal content being uploaded to the bucket.
property contentDisposition
public contentDisposition: pulumi.Output<string | undefined>;Specifies presentational information for the object. Read RFC2616 Content-Disposition for further details.
property contentEncoding
public contentEncoding: pulumi.Output<string | undefined>;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.
property contentLength
public contentLength: pulumi.Output<string>;the content length of request.
property contentMd5
public contentMd5: pulumi.Output<string | undefined>;The MD5 value of the content. Read MD5 for computing method.
property contentType
public contentType: pulumi.Output<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.
property etag
public etag: pulumi.Output<string>;the ETag generated for the object (an MD5 sum of the object content).
property expires
public expires: pulumi.Output<string | undefined>;Specifies expire date for the the request/response. Read RFC2616 Expires for further details.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property key
public key: pulumi.Output<string>;The name of the object once it is in the bucket.
property kmsKeyId
public kmsKeyId: pulumi.Output<string | undefined>;Specifies the primary key managed by KMS. This parameter is valid when the value of serverSideEncryption is set to KMS.
property serverSideEncryption
public serverSideEncryption: pulumi.Output<string | undefined>;Specifies server-side encryption of the object in OSS. Valid values are AES256, KMS. Default value is AES256.
property source
public source: pulumi.Output<string | undefined>;The path to the source file being uploaded to the bucket.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
property versionId
public versionId: pulumi.Output<string>;A unique version ID value for the object, if bucket versioning is enabled.
Functions
Function getBucketObjects
getBucketObjects(args: GetBucketObjectsArgs, opts?: pulumi.InvokeOptions): Promise<GetBucketObjectsResult>This data source provides the objects of an OSS bucket.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const bucketObjectsDs = pulumi.output(alicloud.oss.getBucketObjects({
bucketName: "sampleBucket",
keyRegex: "sample/sample_object.txt",
}, { async: true }));
export const firstObjectKey = bucketObjectsDs.objects[0].key;Function getBuckets
getBuckets(args?: GetBucketsArgs, opts?: pulumi.InvokeOptions): Promise<GetBucketsResult>This data source provides the OSS buckets of the current Alibaba Cloud user.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ossBucketsDs = pulumi.output(alicloud.oss.getBuckets({
nameRegex: "sampleOssBucket",
}, { async: true }));
export const firstOssBucketName = ossBucketsDs.buckets[0].name;Function getInstanceAttachments
getInstanceAttachments(args: GetInstanceAttachmentsArgs, opts?: pulumi.InvokeOptions): Promise<GetInstanceAttachmentsResult>This data source provides the ots instance attachments of the current Alibaba Cloud user.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const attachmentsDs = pulumi.output(alicloud.oss.getInstanceAttachments({
instanceName: "sample-instance",
nameRegex: "testvpc",
outputFile: "attachments.txt",
}, { async: true }));
export const firstOtsAttachmentId = attachmentsDs.attachments[0].id;Function getInstances
getInstances(args?: GetInstancesArgs, opts?: pulumi.InvokeOptions): Promise<GetInstancesResult>This data source provides the ots instances of the current Alibaba Cloud user.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const instancesDs = pulumi.output(alicloud.oss.getInstances({
nameRegex: "sample-instance",
outputFile: "instances.txt",
}, { async: true }));
export const firstInstanceId = instancesDs.instances[0].id;Function getTables
getTables(args: GetTablesArgs, opts?: pulumi.InvokeOptions): Promise<GetTablesResult>This data source provides the ots tables of the current Alibaba Cloud user.
NOTE: Available in v1.40.0+.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const tablesDs = pulumi.output(alicloud.oss.getTables({
instanceName: "sample-instance",
nameRegex: "sample-table",
outputFile: "tables.txt",
}, { async: true }));
export const firstTableId = tablesDs.tables[0].id;Others
interface BucketArgs
interface BucketArgsThe set of arguments for constructing a Bucket resource.
property acl
acl?: pulumi.Input<string>;The canned ACL to apply. Can be “private”, “public-read” and “public-read-write”. Defaults to “private”.
property bucket
bucket?: pulumi.Input<string>;property corsRules
corsRules?: pulumi.Input<pulumi.Input<BucketCorsRule>[]>;A rule of Cross-Origin Resource Sharing (documented below). The items of core rule are no more than 10 for every OSS bucket.
property forceDestroy
forceDestroy?: pulumi.Input<boolean>;A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable. Defaults to “false”.
property lifecycleRules
lifecycleRules?: pulumi.Input<pulumi.Input<BucketLifecycleRule>[]>;A configuration of object lifecycle management (documented below).
property logging
logging?: pulumi.Input<BucketLogging>;A Settings of bucket logging (documented below).
property loggingIsenable
logging is set, the bucket logging will be able.loggingIsenable?: pulumi.Input<boolean>;The flag of using logging enable container. Defaults true.
property policy
policy?: pulumi.Input<string>;Json format text of bucket policy bucket policy management.
property refererConfig
refererConfig?: pulumi.Input<BucketRefererConfig>;The configuration of referer (documented below).
property serverSideEncryptionRule
serverSideEncryptionRule?: pulumi.Input<BucketServerSideEncryptionRule>;A configuration of server-side encryption (documented below).
property storageClass
storageClass?: pulumi.Input<string>;Specifies the storage class that objects that conform to the rule are converted into. The storage class of the objects in a bucket of the IA storage class can be converted into Archive but cannot be converted into Standard. Values: IA, Archive.
property tags
tags?: pulumi.Input<{[key: string]: any}>;A mapping of tags to assign to the bucket. The items are no more than 10 for a bucket.
property versioning
versioning?: pulumi.Input<BucketVersioning>;A state of versioning (documented below).
property website
website?: pulumi.Input<BucketWebsite>;A website object(documented below).
interface BucketObjectArgs
interface BucketObjectArgsThe set of arguments for constructing a BucketObject resource.
property acl
acl?: pulumi.Input<string>;The canned ACL to apply. Defaults to “private”.
property bucket
bucket: pulumi.Input<string>;The name of the bucket to put the file in.
property cacheControl
cacheControl?: pulumi.Input<string>;Specifies caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.
property content
content?: pulumi.Input<string>;The literal content being uploaded to the bucket.
property contentDisposition
contentDisposition?: pulumi.Input<string>;Specifies presentational information for the object. Read RFC2616 Content-Disposition for further details.
property contentEncoding
contentEncoding?: pulumi.Input<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.
property contentMd5
contentMd5?: pulumi.Input<string>;The MD5 value of the content. Read MD5 for computing method.
property contentType
contentType?: pulumi.Input<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.
property expires
expires?: pulumi.Input<string>;Specifies expire date for the the request/response. Read RFC2616 Expires for further details.
property key
key: pulumi.Input<string>;The name of the object once it is in the bucket.
property kmsKeyId
kmsKeyId?: pulumi.Input<string>;Specifies the primary key managed by KMS. This parameter is valid when the value of serverSideEncryption is set to KMS.
property serverSideEncryption
serverSideEncryption?: pulumi.Input<string>;Specifies server-side encryption of the object in OSS. Valid values are AES256, KMS. Default value is AES256.
property source
source?: pulumi.Input<string>;The path to the source file being uploaded to the bucket.
interface BucketObjectState
interface BucketObjectStateInput properties used for looking up and filtering BucketObject resources.
property acl
acl?: pulumi.Input<string>;The canned ACL to apply. Defaults to “private”.
property bucket
bucket?: pulumi.Input<string>;The name of the bucket to put the file in.
property cacheControl
cacheControl?: pulumi.Input<string>;Specifies caching behavior along the request/reply chain. Read RFC2616 Cache-Control for further details.
property content
content?: pulumi.Input<string>;The literal content being uploaded to the bucket.
property contentDisposition
contentDisposition?: pulumi.Input<string>;Specifies presentational information for the object. Read RFC2616 Content-Disposition for further details.
property contentEncoding
contentEncoding?: pulumi.Input<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.
property contentLength
contentLength?: pulumi.Input<string>;the content length of request.
property contentMd5
contentMd5?: pulumi.Input<string>;The MD5 value of the content. Read MD5 for computing method.
property contentType
contentType?: pulumi.Input<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.
property etag
etag?: pulumi.Input<string>;the ETag generated for the object (an MD5 sum of the object content).
property expires
expires?: pulumi.Input<string>;Specifies expire date for the the request/response. Read RFC2616 Expires for further details.
property key
key?: pulumi.Input<string>;The name of the object once it is in the bucket.
property kmsKeyId
kmsKeyId?: pulumi.Input<string>;Specifies the primary key managed by KMS. This parameter is valid when the value of serverSideEncryption is set to KMS.
property serverSideEncryption
serverSideEncryption?: pulumi.Input<string>;Specifies server-side encryption of the object in OSS. Valid values are AES256, KMS. Default value is AES256.
property source
source?: pulumi.Input<string>;The path to the source file being uploaded to the bucket.
property versionId
versionId?: pulumi.Input<string>;A unique version ID value for the object, if bucket versioning is enabled.
interface BucketState
interface BucketStateInput properties used for looking up and filtering Bucket resources.
property acl
acl?: pulumi.Input<string>;The canned ACL to apply. Can be “private”, “public-read” and “public-read-write”. Defaults to “private”.
property bucket
bucket?: pulumi.Input<string>;property corsRules
corsRules?: pulumi.Input<pulumi.Input<BucketCorsRule>[]>;A rule of Cross-Origin Resource Sharing (documented below). The items of core rule are no more than 10 for every OSS bucket.
property creationDate
creationDate?: pulumi.Input<string>;The creation date of the bucket.
property extranetEndpoint
extranetEndpoint?: pulumi.Input<string>;The extranet access endpoint of the bucket.
property forceDestroy
forceDestroy?: pulumi.Input<boolean>;A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable. Defaults to “false”.
property intranetEndpoint
intranetEndpoint?: pulumi.Input<string>;The intranet access endpoint of the bucket.
property lifecycleRules
lifecycleRules?: pulumi.Input<pulumi.Input<BucketLifecycleRule>[]>;A configuration of object lifecycle management (documented below).
property location
location?: pulumi.Input<string>;The location of the bucket.
property logging
logging?: pulumi.Input<BucketLogging>;A Settings of bucket logging (documented below).
property loggingIsenable
logging is set, the bucket logging will be able.loggingIsenable?: pulumi.Input<boolean>;The flag of using logging enable container. Defaults true.
property owner
owner?: pulumi.Input<string>;The bucket owner.
property policy
policy?: pulumi.Input<string>;Json format text of bucket policy bucket policy management.
property refererConfig
refererConfig?: pulumi.Input<BucketRefererConfig>;The configuration of referer (documented below).
property serverSideEncryptionRule
serverSideEncryptionRule?: pulumi.Input<BucketServerSideEncryptionRule>;A configuration of server-side encryption (documented below).
property storageClass
storageClass?: pulumi.Input<string>;Specifies the storage class that objects that conform to the rule are converted into. The storage class of the objects in a bucket of the IA storage class can be converted into Archive but cannot be converted into Standard. Values: IA, Archive.
property tags
tags?: pulumi.Input<{[key: string]: any}>;A mapping of tags to assign to the bucket. The items are no more than 10 for a bucket.
property versioning
versioning?: pulumi.Input<BucketVersioning>;A state of versioning (documented below).
property website
website?: pulumi.Input<BucketWebsite>;A website object(documented below).
interface GetBucketObjectsArgs
interface GetBucketObjectsArgsA collection of arguments for invoking getBucketObjects.
property bucketName
bucketName: string;Name of the bucket that contains the objects to find.
property keyPrefix
keyPrefix?: undefined | string;Filter results by the given key prefix (such as “path/to/folder/logs-”).
property keyRegex
keyRegex?: undefined | string;A regex string to filter results by key.
property outputFile
outputFile?: undefined | string;interface GetBucketObjectsResult
interface GetBucketObjectsResultA collection of values returned by getBucketObjects.
property bucketName
bucketName: string;property id
id: string;The provider-assigned unique ID for this managed resource.
property keyPrefix
keyPrefix?: undefined | string;property keyRegex
keyRegex?: undefined | string;property objects
objects: GetBucketObjectsObject[];A list of bucket objects. Each element contains the following attributes:
property outputFile
outputFile?: undefined | string;interface GetBucketsArgs
interface GetBucketsArgsA collection of arguments for invoking getBuckets.
property nameRegex
nameRegex?: undefined | string;A regex string to filter results by bucket name.
property outputFile
outputFile?: undefined | string;interface GetBucketsResult
interface GetBucketsResultA collection of values returned by getBuckets.
property buckets
buckets: GetBucketsBucket[];A list of buckets. Each element contains the following attributes:
property id
id: string;The provider-assigned unique ID for this managed resource.
property nameRegex
nameRegex?: undefined | string;property names
names: string[];A list of bucket names.
property outputFile
outputFile?: undefined | string;interface GetInstanceAttachmentsArgs
interface GetInstanceAttachmentsArgsA collection of arguments for invoking getInstanceAttachments.
property instanceName
instanceName: string;The name of OTS instance.
property nameRegex
nameRegex?: undefined | string;A regex string to filter results by vpc name.
property outputFile
outputFile?: undefined | string;interface GetInstanceAttachmentsResult
interface GetInstanceAttachmentsResultA collection of values returned by getInstanceAttachments.
property attachments
attachments: GetInstanceAttachmentsAttachment[];A list of instance attachments. Each element contains the following attributes:
property id
id: string;The provider-assigned unique ID for this managed resource.
property instanceName
instanceName: string;The instance name.
property nameRegex
nameRegex?: undefined | string;property names
names: string[];A list of vpc names.
property outputFile
outputFile?: undefined | string;property vpcIds
vpcIds: string[];A list of vpc ids.
interface GetInstancesArgs
interface GetInstancesArgsA collection of arguments for invoking getInstances.
property ids
ids?: string[];A list of instance IDs.
property nameRegex
nameRegex?: undefined | string;A regex string to filter results by instance name.
property outputFile
outputFile?: undefined | string;property tags
tags?: undefined | {[key: string]: any};A map of tags assigned to the instance. It must be in the format:
data "alicloud.oss.getInstances" "instancesDs" {
tags = {
tagKey1 = "tagValue1",
tagKey2 = "tagValue2"
}
}
interface GetInstancesResult
interface GetInstancesResultA collection of values returned by getInstances.
property id
id: string;The provider-assigned unique ID for this managed resource.
property ids
ids: string[];A list of instance IDs.
property instances
instances: GetInstancesInstance[];A list of instances. Each element contains the following attributes:
property nameRegex
nameRegex?: undefined | string;property names
names: string[];A list of instance names.
property outputFile
outputFile?: undefined | string;property tags
tags?: undefined | {[key: string]: any};The tags of the instance.
interface GetTablesArgs
interface GetTablesArgsA collection of arguments for invoking getTables.
property ids
ids?: string[];A list of table IDs.
property instanceName
instanceName: string;The name of OTS instance.
property nameRegex
nameRegex?: undefined | string;A regex string to filter results by table name.
property outputFile
outputFile?: undefined | string;interface GetTablesResult
interface GetTablesResultA collection of values returned by getTables.
property id
id: string;The provider-assigned unique ID for this managed resource.
property ids
ids: string[];A list of table IDs.
property instanceName
instanceName: string;The OTS instance name.
property nameRegex
nameRegex?: undefined | string;property names
names: string[];A list of table names.
property outputFile
outputFile?: undefined | string;property tables
tables: GetTablesTable[];A list of tables. Each element contains the following attributes: