Bucket
- Implements: IBucket
This class encapsulates and extends the ROS resource type ALIYUN::OSS::Bucket.
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)
// .blockPublicAccess(java.lang.Boolean)
// .blockPublicAccess(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. |
blockPublicAccess | java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable | Property blockPublicAccess: Whether to block public access. |
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.
blockPublicAccessOptional
- Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable
Property blockPublicAccess: Whether to block public access.
corsConfigurationOptional
- Type: com.aliyun.ros.cdk.core.IResolvable OR CORSConfigurationProperty
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
- Type: com.aliyun.ros.cdk.core.IResolvable OR LifecycleConfigurationProperty
Property lifecycleConfiguration: Rules that define how oss bucket manages objects during their lifetime.
loggingConfigurationOptional
- Type: com.aliyun.ros.cdk.core.IResolvable OR LoggingConfigurationProperty
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
- Type: com.aliyun.ros.cdk.core.IResolvable OR RefererConfigurationProperty
Property refererConfiguration: undefined.
resourceGroupIdOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property resourceGroupId: The resource group id.
serverSideEncryptionConfigurationOptional
- Type: com.aliyun.ros.cdk.core.IResolvable OR ServerSideEncryptionConfigurationProperty
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
- Type: com.aliyun.ros.cdk.core.IResolvable OR VersioningConfigurationProperty
Property versioningConfiguration: A state of versioning.
websiteConfigurationV2Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR WebsiteConfigurationV2Property
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. |
fetchCondition | No description. |
fetchDependency | No description. |
fetchResourceDesc | No description. |
getAtt | No description. |
setMetadata | No description. |
arnForObjects | Returns an ARN that represents all objects within the bucket that match the key pattern specified. |
grantFullAccess | Grant an RAM principal (Role/Group/User) full control over this bucket. |
grantList | Grant an RAM principal (Role/Group/User) permission to list resources for this bucket. |
grantRead | Grant an RAM principal (Role/Group/User) permission to list and read all resources for this bucket. |
grantReadWrite | Grant an RAM principal (Role/Group/User) permission to read and write resources for this bucket. |
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.
- Type: com.aliyun.ros.cdk.core.ISynthesisSession
The synthesis session.
addCondition
public void addCondition(RosCondition condition)
- Type: com.aliyun.ros.cdk.core.RosCondition
addCount
public void addCount(java.lang.Number OR IResolvable count)
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
addDependency
public void addDependency(Resource resource)
- Type: com.aliyun.ros.cdk.core.Resource
addResourceDesc
public void addResourceDesc(java.lang.String desc)
- Type: java.lang.String
applyRemovalPolicy
public void applyRemovalPolicy(RemovalPolicy policy)
- Type: com.aliyun.ros.cdk.core.RemovalPolicy
fetchCondition
public RosCondition fetchCondition()
fetchDependency
public java.util.List<java.lang.String> fetchDependency()
fetchResourceDesc
public java.lang.String fetchResourceDesc()
getAtt
public IResolvable getAtt(java.lang.String name)
- Type: java.lang.String
setMetadata
public void setMetadata(java.lang.String key, java.lang.Object value)
- Type: java.lang.String
- Type: java.lang.Object
arnForObjects
public java.lang.String arnForObjects(java.lang.String keyPattern)
Returns an ARN that represents all objects within the bucket that match the key pattern specified.
To represent all keys, specify "*".
If you need to specify a keyPattern with multiple components, concatenate them into a single string, e.g.:
arnForObjects(home/${team}/${user}/*)
- Type: java.lang.String
grantFullAccess
public ManagedPolicy grantFullAccess(IPrincipal identity)
public ManagedPolicy grantFullAccess(IPrincipal identity, java.lang.String objectsKeyPattern)
Grant an RAM principal (Role/Group/User) full control over this bucket.
- Type: com.aliyun.ros.cdk.ram.IPrincipal
The principal.
- Type: java.lang.String
Restrict the permission to a certain key pattern (default '*').
grantList
public ManagedPolicy grantList(IPrincipal identity)
public ManagedPolicy grantList(IPrincipal identity, java.lang.String objectsKeyPattern)
Grant an RAM principal (Role/Group/User) permission to list resources for this bucket.
- Type: com.aliyun.ros.cdk.ram.IPrincipal
The principal.
- Type: java.lang.String
Restrict the permission to a certain key pattern (default '*').
grantRead
public ManagedPolicy grantRead(IPrincipal identity)
public ManagedPolicy grantRead(IPrincipal identity, java.lang.String objectsKeyPattern)
Grant an RAM principal (Role/Group/User) permission to list and read all resources for this bucket.
- Type: com.aliyun.ros.cdk.ram.IPrincipal
The principal.
- Type: java.lang.String
Restrict the permission to a certain key pattern (default '*').
grantReadWrite
public ManagedPolicy grantReadWrite(IPrincipal identity)
public ManagedPolicy grantReadWrite(IPrincipal identity, java.lang.String objectsKeyPattern)
Grant an RAM principal (Role/Group/User) permission to read and write resources for this bucket.
- Type: com.aliyun.ros.cdk.ram.IPrincipal
The principal.
- Type: java.lang.String
Restrict the permission to a certain key pattern (default '*').
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.
- 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.
- 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. |
env | com.aliyun.ros.cdk.core.IResourceEnvironment | The environment this resource belongs to. |
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. |
attrArn | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute Arn: The Alibaba Cloud Resource Name (ARN). |
attrDomainName | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute DomainName: The public DNS name of the specified bucket. |
attrInternalDomainName | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute InternalDomainName: The internal DNS name of the specified bucket. |
attrName | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute Name: The name of Bucket. |
props | BucketProps | No description. |
nodeRequired
public ConstructNode getNode();
- Type: com.aliyun.ros.cdk.core.ConstructNode
The construct tree node associated with this construct.
envRequired
public IResourceEnvironment getEnv();
- Type: com.aliyun.ros.cdk.core.IResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
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
attrArnRequired
public java.lang.Object getAttrArn();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute Arn: The Alibaba Cloud Resource Name (ARN).
attrDomainNameRequired
public java.lang.Object getAttrDomainName();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute DomainName: The public DNS name of the specified bucket.
attrInternalDomainNameRequired
public java.lang.Object getAttrInternalDomainName();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute InternalDomainName: The internal DNS name of the specified bucket.
attrNameRequired
public java.lang.Object getAttrName();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute Name: The name of Bucket.
propsRequired
public BucketProps getProps();
- Type: BucketProps