GetBuckets

This data source provides the OSS buckets of the current Alibaba Cloud user.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var ossBucketsDs = Output.Create(AliCloud.Oss.GetBuckets.InvokeAsync(new AliCloud.Oss.GetBucketsArgs
        {
            NameRegex = "sample_oss_bucket",
        }));
        this.FirstOssBucketName = ossBucketsDs.Apply(ossBucketsDs => ossBucketsDs.Buckets[0].Name);
    }

    [Output("firstOssBucketName")]
    public Output<string> FirstOssBucketName { get; set; }
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

oss_buckets_ds = alicloud.oss.get_buckets(name_regex="sample_oss_bucket")
pulumi.export("firstOssBucketName", oss_buckets_ds.buckets[0]["name"])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ossBucketsDs = pulumi.output(alicloud.oss.getBuckets({
    nameRegex: "sample_oss_bucket",
}, { async: true }));

export const firstOssBucketName = ossBucketsDs.buckets[0].name;

Using GetBuckets

function getBuckets(args: GetBucketsArgs, opts?: InvokeOptions): Promise<GetBucketsResult>
function  get_buckets(name_regex=None, output_file=None, opts=None)
func GetBuckets(ctx *Context, args *GetBucketsArgs, opts ...InvokeOption) (*GetBucketsResult, error)
public static class GetBuckets {
    public static Task<GetBucketsResult> InvokeAsync(GetBucketsArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

NameRegex string

A regex string to filter results by bucket name.

OutputFile string
NameRegex string

A regex string to filter results by bucket name.

OutputFile string
nameRegex string

A regex string to filter results by bucket name.

outputFile string
name_regex str

A regex string to filter results by bucket name.

output_file str

GetBuckets Result

The following output properties are available:

Buckets List<Pulumi.AliCloud.Oss.Outputs.GetBucketsBucket>

A list of buckets. Each element contains the following attributes:

Id string

The provider-assigned unique ID for this managed resource.

Names List<string>

A list of bucket names.

NameRegex string
OutputFile string
Buckets []GetBucketsBucket

A list of buckets. Each element contains the following attributes:

Id string

The provider-assigned unique ID for this managed resource.

Names []string

A list of bucket names.

NameRegex string
OutputFile string
buckets GetBucketsBucket[]

A list of buckets. Each element contains the following attributes:

id string

The provider-assigned unique ID for this managed resource.

names string[]

A list of bucket names.

nameRegex string
outputFile string
buckets List[GetBucketsBucket]

A list of buckets. Each element contains the following attributes:

id str

The provider-assigned unique ID for this managed resource.

names List[str]

A list of bucket names.

name_regex str
output_file str

Supporting Types

GetBucketsBucket

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Acl string

Bucket access control list. Possible values: private, public-read and public-read-write.

CorsRules List<Pulumi.AliCloud.Oss.Inputs.GetBucketsBucketCorsRuleArgs>

A list of CORS rule configurations. Each element contains the following attributes:

CreationDate string

Bucket creation date.

ExtranetEndpoint string

Internet domain name for accessing the bucket from outside.

IntranetEndpoint string

Intranet domain name for accessing the bucket from an ECS instance in the same region.

LifecycleRules List<Pulumi.AliCloud.Oss.Inputs.GetBucketsBucketLifecycleRuleArgs>

A list CORS of lifecycle configurations. When Lifecycle is enabled, OSS automatically deletes the objects or transitions the objects (to another storage class) corresponding the lifecycle rules on a regular basis. Each element contains the following attributes:

Location string

Region of the data center where the bucket is located.

Logging Pulumi.AliCloud.Oss.Inputs.GetBucketsBucketLoggingArgs

A list of one element containing configuration parameters used for storing access log information. It contains the following attributes:

Name string

Bucket name.

Owner string

Bucket owner.

RefererConfig Pulumi.AliCloud.Oss.Inputs.GetBucketsBucketRefererConfigArgs

A list of one element containing referer configuration. It contains the following attributes:

ServerSideEncryptionRule Pulumi.AliCloud.Oss.Inputs.GetBucketsBucketServerSideEncryptionRuleArgs

A configuration of default encryption for a bucket. It contains the following attributes:

StorageClass string

Object storage type. Possible values: Standard, IA and Archive.

Tags Dictionary<string, object>

A mapping of tags.

Versioning Pulumi.AliCloud.Oss.Inputs.GetBucketsBucketVersioningArgs

If present , the versioning state has been set on the bucket. It contains the following attribute.

Website Pulumi.AliCloud.Oss.Inputs.GetBucketsBucketWebsiteArgs

A list of one element containing configuration parameters used when the bucket is used as a website. It contains the following attributes:

Policy string
Acl string

Bucket access control list. Possible values: private, public-read and public-read-write.

CorsRules []GetBucketsBucketCorsRule

A list of CORS rule configurations. Each element contains the following attributes:

CreationDate string

Bucket creation date.

ExtranetEndpoint string

Internet domain name for accessing the bucket from outside.

IntranetEndpoint string

Intranet domain name for accessing the bucket from an ECS instance in the same region.

LifecycleRules []GetBucketsBucketLifecycleRule

A list CORS of lifecycle configurations. When Lifecycle is enabled, OSS automatically deletes the objects or transitions the objects (to another storage class) corresponding the lifecycle rules on a regular basis. Each element contains the following attributes:

Location string

Region of the data center where the bucket is located.

Logging GetBucketsBucketLogging

A list of one element containing configuration parameters used for storing access log information. It contains the following attributes:

Name string

Bucket name.

Owner string

Bucket owner.

RefererConfig GetBucketsBucketRefererConfig

A list of one element containing referer configuration. It contains the following attributes:

ServerSideEncryptionRule GetBucketsBucketServerSideEncryptionRule

A configuration of default encryption for a bucket. It contains the following attributes:

StorageClass string

Object storage type. Possible values: Standard, IA and Archive.

Tags map[string]interface{}

A mapping of tags.

Versioning GetBucketsBucketVersioning

If present , the versioning state has been set on the bucket. It contains the following attribute.

Website GetBucketsBucketWebsite

A list of one element containing configuration parameters used when the bucket is used as a website. It contains the following attributes:

Policy string
acl string

Bucket access control list. Possible values: private, public-read and public-read-write.

corsRules GetBucketsBucketCorsRule[]

A list of CORS rule configurations. Each element contains the following attributes:

creationDate string

Bucket creation date.

extranetEndpoint string

Internet domain name for accessing the bucket from outside.

intranetEndpoint string

Intranet domain name for accessing the bucket from an ECS instance in the same region.

lifecycleRules GetBucketsBucketLifecycleRule[]

A list CORS of lifecycle configurations. When Lifecycle is enabled, OSS automatically deletes the objects or transitions the objects (to another storage class) corresponding the lifecycle rules on a regular basis. Each element contains the following attributes:

location string

Region of the data center where the bucket is located.

logging GetBucketsBucketLogging

A list of one element containing configuration parameters used for storing access log information. It contains the following attributes:

name string

Bucket name.

owner string

Bucket owner.

refererConfig GetBucketsBucketRefererConfig

A list of one element containing referer configuration. It contains the following attributes:

serverSideEncryptionRule GetBucketsBucketServerSideEncryptionRule

A configuration of default encryption for a bucket. It contains the following attributes:

storageClass string

Object storage type. Possible values: Standard, IA and Archive.

tags {[key: string]: any}

A mapping of tags.

versioning GetBucketsBucketVersioning

If present , the versioning state has been set on the bucket. It contains the following attribute.

website GetBucketsBucketWebsite

A list of one element containing configuration parameters used when the bucket is used as a website. It contains the following attributes:

policy string
acl str

Bucket access control list. Possible values: private, public-read and public-read-write.

cors_rules List[GetBucketsBucketCorsRule]

A list of CORS rule configurations. Each element contains the following attributes:

creation_date str

Bucket creation date.

extranet_endpoint str

Internet domain name for accessing the bucket from outside.

intranet_endpoint str

Intranet domain name for accessing the bucket from an ECS instance in the same region.

lifecycle_rules List[GetBucketsBucketLifecycleRule]

A list CORS of lifecycle configurations. When Lifecycle is enabled, OSS automatically deletes the objects or transitions the objects (to another storage class) corresponding the lifecycle rules on a regular basis. Each element contains the following attributes:

location str

Region of the data center where the bucket is located.

logging Dict[GetBucketsBucketLogging]

A list of one element containing configuration parameters used for storing access log information. It contains the following attributes:

name str

Bucket name.

owner str

Bucket owner.

referer_config Dict[GetBucketsBucketRefererConfig]

A list of one element containing referer configuration. It contains the following attributes:

server_side_encryption_rule Dict[GetBucketsBucketServerSideEncryptionRule]

A configuration of default encryption for a bucket. It contains the following attributes:

storage_class str

Object storage type. Possible values: Standard, IA and Archive.

tags Dict[str, Any]

A mapping of tags.

versioning Dict[GetBucketsBucketVersioning]

If present , the versioning state has been set on the bucket. It contains the following attribute.

website Dict[GetBucketsBucketWebsite]

A list of one element containing configuration parameters used when the bucket is used as a website. It contains the following attributes:

policy str

GetBucketsBucketCorsRule

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

AllowedHeaders List<string>

Control whether the headers specified by Access-Control-Request-Headers in the OPTIONS prefetch command are allowed. Each header specified by Access-Control-Request-Headers must match a value in AllowedHeader. Each rule allows up to one wildcard “*” .

AllowedMethods List<string>

Specify the allowed methods for cross-domain requests. Possible values: GET, PUT, DELETE, POST and HEAD.

AllowedOrigins List<string>

The origins allowed for cross-domain requests. Multiple elements can be used to specify multiple allowed origins. Each rule allows up to one wildcard “*”. If “*” is specified, cross-domain requests of all origins are allowed.

ExposeHeaders List<string>

Specify the response headers allowing users to access from an application (for example, a Javascript XMLHttpRequest object). The wildcard “*” is not allowed.

MaxAgeSeconds int

Specify the cache time for the returned result of a browser prefetch (OPTIONS) request to a specific resource.

AllowedHeaders []string

Control whether the headers specified by Access-Control-Request-Headers in the OPTIONS prefetch command are allowed. Each header specified by Access-Control-Request-Headers must match a value in AllowedHeader. Each rule allows up to one wildcard “*” .

AllowedMethods []string

Specify the allowed methods for cross-domain requests. Possible values: GET, PUT, DELETE, POST and HEAD.

AllowedOrigins []string

The origins allowed for cross-domain requests. Multiple elements can be used to specify multiple allowed origins. Each rule allows up to one wildcard “*”. If “*” is specified, cross-domain requests of all origins are allowed.

ExposeHeaders []string

Specify the response headers allowing users to access from an application (for example, a Javascript XMLHttpRequest object). The wildcard “*” is not allowed.

MaxAgeSeconds int

Specify the cache time for the returned result of a browser prefetch (OPTIONS) request to a specific resource.

allowedHeaders string[]

Control whether the headers specified by Access-Control-Request-Headers in the OPTIONS prefetch command are allowed. Each header specified by Access-Control-Request-Headers must match a value in AllowedHeader. Each rule allows up to one wildcard “*” .

allowedMethods string[]

Specify the allowed methods for cross-domain requests. Possible values: GET, PUT, DELETE, POST and HEAD.

allowedOrigins string[]

The origins allowed for cross-domain requests. Multiple elements can be used to specify multiple allowed origins. Each rule allows up to one wildcard “*”. If “*” is specified, cross-domain requests of all origins are allowed.

exposeHeaders string[]

Specify the response headers allowing users to access from an application (for example, a Javascript XMLHttpRequest object). The wildcard “*” is not allowed.

maxAgeSeconds number

Specify the cache time for the returned result of a browser prefetch (OPTIONS) request to a specific resource.

allowedHeaders List[str]

Control whether the headers specified by Access-Control-Request-Headers in the OPTIONS prefetch command are allowed. Each header specified by Access-Control-Request-Headers must match a value in AllowedHeader. Each rule allows up to one wildcard “*” .

allowedMethods List[str]

Specify the allowed methods for cross-domain requests. Possible values: GET, PUT, DELETE, POST and HEAD.

allowedOrigins List[str]

The origins allowed for cross-domain requests. Multiple elements can be used to specify multiple allowed origins. Each rule allows up to one wildcard “*”. If “*” is specified, cross-domain requests of all origins are allowed.

exposeHeaders List[str]

Specify the response headers allowing users to access from an application (for example, a Javascript XMLHttpRequest object). The wildcard “*” is not allowed.

maxAgeSeconds float

Specify the cache time for the returned result of a browser prefetch (OPTIONS) request to a specific resource.

GetBucketsBucketLifecycleRule

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Enabled bool

Indicate whether the rule is enabled or not.

Expiration Pulumi.AliCloud.Oss.Inputs.GetBucketsBucketLifecycleRuleExpirationArgs

A list of one element containing expiration attributes of an object. It contains the following attributes:

Id string

Unique ID of the rule.

Prefix string

Prefix applicable to a rule. Only those objects with a matching prefix can be affected by the rule.

Enabled bool

Indicate whether the rule is enabled or not.

Expiration GetBucketsBucketLifecycleRuleExpiration

A list of one element containing expiration attributes of an object. It contains the following attributes:

Id string

Unique ID of the rule.

Prefix string

Prefix applicable to a rule. Only those objects with a matching prefix can be affected by the rule.

enabled boolean

Indicate whether the rule is enabled or not.

expiration GetBucketsBucketLifecycleRuleExpiration

A list of one element containing expiration attributes of an object. It contains the following attributes:

id string

Unique ID of the rule.

prefix string

Prefix applicable to a rule. Only those objects with a matching prefix can be affected by the rule.

enabled bool

Indicate whether the rule is enabled or not.

expiration Dict[GetBucketsBucketLifecycleRuleExpiration]

A list of one element containing expiration attributes of an object. It contains the following attributes:

id str

Unique ID of the rule.

prefix str

Prefix applicable to a rule. Only those objects with a matching prefix can be affected by the rule.

GetBucketsBucketLifecycleRuleExpiration

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Date string

Date after which the rule to take effect. The format is like 2017-03-09.

Days int

Indicate the number of days after the last object update until the rules take effect.

Date string

Date after which the rule to take effect. The format is like 2017-03-09.

Days int

Indicate the number of days after the last object update until the rules take effect.

date string

Date after which the rule to take effect. The format is like 2017-03-09.

days number

Indicate the number of days after the last object update until the rules take effect.

date str

Date after which the rule to take effect. The format is like 2017-03-09.

days float

Indicate the number of days after the last object update until the rules take effect.

GetBucketsBucketLogging

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

TargetBucket string

Bucket for storing access logs.

TargetPrefix string

Prefix of the saved access log file paths.

TargetBucket string

Bucket for storing access logs.

TargetPrefix string

Prefix of the saved access log file paths.

targetBucket string

Bucket for storing access logs.

targetPrefix string

Prefix of the saved access log file paths.

targetBucket str

Bucket for storing access logs.

targetPrefix str

Prefix of the saved access log file paths.

GetBucketsBucketRefererConfig

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

AllowEmpty bool

Indicate whether the access request referer field can be empty.

Referers List<string>

Referer access whitelist.

AllowEmpty bool

Indicate whether the access request referer field can be empty.

Referers []string

Referer access whitelist.

allowEmpty boolean

Indicate whether the access request referer field can be empty.

referers string[]

Referer access whitelist.

allowEmpty bool

Indicate whether the access request referer field can be empty.

referers List[str]

Referer access whitelist.

GetBucketsBucketServerSideEncryptionRule

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

SseAlgorithm string

The server-side encryption algorithm to use.

SseAlgorithm string

The server-side encryption algorithm to use.

sseAlgorithm string

The server-side encryption algorithm to use.

sseAlgorithm str

The server-side encryption algorithm to use.

GetBucketsBucketVersioning

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Status string

A bucket versioning state. Possible values:Enabled and Suspended.

Status string

A bucket versioning state. Possible values:Enabled and Suspended.

status string

A bucket versioning state. Possible values:Enabled and Suspended.

status str

A bucket versioning state. Possible values:Enabled and Suspended.

GetBucketsBucketWebsite

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

ErrorDocument string

Key of the HTML document containing the error page.

IndexDocument string

Key of the HTML document containing the home page.

ErrorDocument string

Key of the HTML document containing the error page.

IndexDocument string

Key of the HTML document containing the home page.

errorDocument string

Key of the HTML document containing the error page.

indexDocument string

Key of the HTML document containing the home page.

errorDocument str

Key of the HTML document containing the error page.

indexDocument str

Key of the HTML document containing the home page.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.