Skip to content

Bucket

This class encapsulates and extends the ROS resource type ALIYUN::OSS::Bucket, which is used to create a bucket in Object Storage Service (OSS).

Initializers

import com.aliyun.ros.cdk.oss.Bucket;
Bucket.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
    .bucketName(java.lang.String)
    .bucketName(IResolvable)
//  .accessControl(java.lang.String)
//  .accessControl(IResolvable)
//  .corsConfiguration(IResolvable)
//  .corsConfiguration(CORSConfigurationProperty)
//  .deletionForce(java.lang.Boolean)
//  .deletionForce(IResolvable)
//  .enableOssHdfsService(java.lang.Boolean)
//  .enableOssHdfsService(IResolvable)
//  .lifecycleConfiguration(IResolvable)
//  .lifecycleConfiguration(LifecycleConfigurationProperty)
//  .loggingConfiguration(IResolvable)
//  .loggingConfiguration(LoggingConfigurationProperty)
//  .policy(IResolvable)
//  .policy(java.util.Map<java.lang.String, java.lang.Object>)
//  .redundancyType(java.lang.String)
//  .redundancyType(IResolvable)
//  .refererConfiguration(IResolvable)
//  .refererConfiguration(RefererConfigurationProperty)
//  .resourceGroupId(java.lang.String)
//  .resourceGroupId(IResolvable)
//  .serverSideEncryptionConfiguration(IResolvable)
//  .serverSideEncryptionConfiguration(ServerSideEncryptionConfigurationProperty)
//  .storageClass(java.lang.String)
//  .storageClass(IResolvable)
//  .tags(java.util.Map<java.lang.String, java.lang.Object>)
//  .versioningConfiguration(IResolvable)
//  .versioningConfiguration(VersioningConfigurationProperty)
//  .websiteConfigurationV2(IResolvable)
//  .websiteConfigurationV2(WebsiteConfigurationV2Property)
    .build();
Name Type Description
scope com.aliyun.ros.cdk.core.Construct No description.
id java.lang.String No description.
enableResourcePropertyConstraint java.lang.Boolean No description.
bucketName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property bucketName: bucket name.
accessControl java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property accessControl: The access control list.
corsConfiguration com.aliyun.ros.cdk.core.IResolvable OR CORSConfigurationProperty Property corsConfiguration: Rules that define cross-origin resource sharing of objects in this bucket.
deletionForce java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property deletionForce: Whether force delete the relative objects in the bucket.
enableOssHdfsService java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property enableOssHdfsService: Whether enable OSS-HDFS service.
lifecycleConfiguration com.aliyun.ros.cdk.core.IResolvable OR LifecycleConfigurationProperty Property lifecycleConfiguration: Rules that define how oss bucket manages objects during their lifetime.
loggingConfiguration com.aliyun.ros.cdk.core.IResolvable OR LoggingConfigurationProperty Property loggingConfiguration: Settings that defines where logs are stored.
policy com.aliyun.ros.cdk.core.IResolvable OR java.util.Map Property policy: Bucket policy.
redundancyType java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property redundancyType: Specifies the data disaster recovery type of the storage space.
refererConfiguration com.aliyun.ros.cdk.core.IResolvable OR RefererConfigurationProperty Property refererConfiguration: undefined.
resourceGroupId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property resourceGroupId: The resource group id.
serverSideEncryptionConfiguration com.aliyun.ros.cdk.core.IResolvable OR ServerSideEncryptionConfigurationProperty Property serverSideEncryptionConfiguration: Specifies the bucket used to store the server-side encryption rule.
storageClass java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property storageClass: Specifies the storage class of the bucket.
tags java.util.Map Property tags: Bucket tags in k-v pairs format.
versioningConfiguration com.aliyun.ros.cdk.core.IResolvable OR VersioningConfigurationProperty Property versioningConfiguration: A state of versioning.
websiteConfigurationV2 com.aliyun.ros.cdk.core.IResolvable OR WebsiteConfigurationV2Property Property websiteConfigurationV2: Website configuration.

scopeRequired

  • Type: com.aliyun.ros.cdk.core.Construct

idRequired

  • Type: java.lang.String

enableResourcePropertyConstraintOptional

  • Type: java.lang.Boolean

bucketNameRequired

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property bucketName: bucket name.


accessControlOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property accessControl: The access control list.


corsConfigurationOptional

Property corsConfiguration: Rules that define cross-origin resource sharing of objects in this bucket.


deletionForceOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property deletionForce: Whether force delete the relative objects in the bucket.

Default value is false.


enableOssHdfsServiceOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property enableOssHdfsService: Whether enable OSS-HDFS service.

Note: Once it's enabled, it can't be disabled again.


lifecycleConfigurationOptional

Property lifecycleConfiguration: Rules that define how oss bucket manages objects during their lifetime.


loggingConfigurationOptional

Property loggingConfiguration: Settings that defines where logs are stored.


policyOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.Map

Property policy: Bucket policy.


redundancyTypeOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property redundancyType: Specifies the data disaster recovery type of the storage space.

The value range is as follows: LRS (default): Local redundant LRS stores your data redundantly on different storage devices in the same availability zone, and can support data loss and normal access even when two storage devices are damaged concurrently. ZRS: Intra-city redundant ZRS adopts a data redundancy storage mechanism in multiple availability zones (AZ), and stores user data redundantly in multiple availability zones in the same region. When an availability zone is unavailable, normal access to data can still be guaranteed.


refererConfigurationOptional

Property refererConfiguration: undefined.


resourceGroupIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property resourceGroupId: The resource group id.


serverSideEncryptionConfigurationOptional

Property serverSideEncryptionConfiguration: Specifies the bucket used to store the server-side encryption rule.


storageClassOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property storageClass: Specifies the storage class of the bucket.

Default is "Standard".


tagsOptional

  • Type: java.util.Map

Property tags: Bucket tags in k-v pairs format.


versioningConfigurationOptional

Property versioningConfiguration: A state of versioning.


websiteConfigurationV2Optional

Property websiteConfigurationV2: Website configuration.


Methods

Name Description
toString Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
addCondition No description.
addCount No description.
addDependency No description.
addResourceDesc No description.
applyRemovalPolicy No description.
getAtt No description.
setMetadata No description.

toString

public java.lang.String toString()

Returns a string representation of this construct.

synthesize

public void synthesize(ISynthesisSession session)

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

sessionRequired

  • Type: com.aliyun.ros.cdk.core.ISynthesisSession

The synthesis session.


addCondition

public void addCondition(RosCondition condition)

conditionRequired

  • Type: com.aliyun.ros.cdk.core.RosCondition

addCount

public void addCount(java.lang.Number OR IResolvable count)

countRequired

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

addDependency

public void addDependency(Resource resource)

resourceRequired

  • Type: com.aliyun.ros.cdk.core.Resource

addResourceDesc

public void addResourceDesc(java.lang.String desc)

descRequired

  • Type: java.lang.String

applyRemovalPolicy

public void applyRemovalPolicy(RemovalPolicy policy)

policyRequired

  • Type: com.aliyun.ros.cdk.core.RemovalPolicy

getAtt

public IResolvable getAtt(java.lang.String name)

nameRequired

  • Type: java.lang.String

setMetadata

public void setMetadata(java.lang.String key, java.lang.Object value)

keyRequired

  • Type: java.lang.String

valueRequired

  • Type: java.lang.Object

Static Functions

Name Description
isConstruct Return whether the given object is a Construct.
validateBucketName Thrown an exception if the given bucket name is not valid.

isConstruct

import com.aliyun.ros.cdk.oss.Bucket;
Bucket.isConstruct(java.lang.Object x)

Return whether the given object is a Construct.

xRequired

  • Type: java.lang.Object

validateBucketName

import com.aliyun.ros.cdk.oss.Bucket;
Bucket.validateBucketName(java.lang.String physicalName)

Thrown an exception if the given bucket name is not valid.

physicalNameRequired

  • Type: java.lang.String

name of the bucket.


Properties

Name Type Description
node com.aliyun.ros.cdk.core.ConstructNode The construct tree node associated with this construct.
ref java.lang.String No description.
stack com.aliyun.ros.cdk.core.Stack The stack in which this resource is defined.
resource com.aliyun.ros.cdk.core.RosResource No description.
attrDomainName com.aliyun.ros.cdk.core.IResolvable Attribute DomainName: The public DNS name of the specified bucket.
attrInternalDomainName com.aliyun.ros.cdk.core.IResolvable Attribute InternalDomainName: The internal DNS name of the specified bucket.
attrName com.aliyun.ros.cdk.core.IResolvable Attribute Name: The name of Bucket.

nodeRequired

public ConstructNode getNode();
  • Type: com.aliyun.ros.cdk.core.ConstructNode

The construct tree node associated with this construct.


refRequired

public java.lang.String getRef();
  • Type: java.lang.String

stackRequired

public Stack getStack();
  • Type: com.aliyun.ros.cdk.core.Stack

The stack in which this resource is defined.


resourceOptional

public RosResource getResource();
  • Type: com.aliyun.ros.cdk.core.RosResource

attrDomainNameRequired

public IResolvable getAttrDomainName();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute DomainName: The public DNS name of the specified bucket.


attrInternalDomainNameRequired

public IResolvable getAttrInternalDomainName();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute InternalDomainName: The internal DNS name of the specified bucket.


attrNameRequired

public IResolvable getAttrName();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute Name: The name of Bucket.