java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:59.693Z") @Stability(Stable) public class CfnBucket extends CfnResource implements IInspectable
A CloudFormation AWS::Lightsail::Bucket.

The AWS::Lightsail::Bucket resource specifies a bucket.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.lightsail.*;
 CfnBucket cfnBucket = CfnBucket.Builder.create(this, "MyCfnBucket")
         .bucketName("bucketName")
         .bundleId("bundleId")
         // the properties below are optional
         .accessRules(AccessRulesProperty.builder()
                 .allowPublicOverrides(false)
                 .objectAccess("objectAccess")
                 .build())
         .objectVersioning(false)
         .readOnlyAccessAccounts(List.of("readOnlyAccessAccounts"))
         .resourcesReceivingAccess(List.of("resourcesReceivingAccess"))
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnBucket

      protected CfnBucket(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnBucket

      protected CfnBucket(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnBucket

      @Stability(Stable) public CfnBucket(@NotNull Construct scope, @NotNull String id, @NotNull CfnBucketProps props)
      Create a new AWS::Lightsail::Bucket.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrAbleToUpdateBundle

      @Stability(Stable) @NotNull public IResolvable getAttrAbleToUpdateBundle()
      A Boolean value indicating whether the bundle that is currently applied to your distribution can be changed to another bundle.
    • getAttrBucketArn

      @Stability(Stable) @NotNull public String getAttrBucketArn()
      The Amazon Resource Name (ARN) of the bucket.
    • getAttrUrl

      @Stability(Stable) @NotNull public String getAttrUrl()
      The URL of the bucket.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      An array of key-value pairs to apply to this resource.

      For more information, see Tag in the AWS CloudFormation User Guide .

      The Value of Tags is optional for Lightsail resources.

    • getBucketName

      @Stability(Stable) @NotNull public String getBucketName()
      The name of the bucket.
    • setBucketName

      @Stability(Stable) public void setBucketName(@NotNull String value)
      The name of the bucket.
    • getBundleId

      @Stability(Stable) @NotNull public String getBundleId()
      The bundle ID for the bucket (for example, small_1_0 ).

      A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket.

    • setBundleId

      @Stability(Stable) public void setBundleId(@NotNull String value)
      The bundle ID for the bucket (for example, small_1_0 ).

      A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket.

    • getAccessRules

      @Stability(Stable) @Nullable public Object getAccessRules()
      An object that describes the access rules for the bucket.
    • setAccessRules

      @Stability(Stable) public void setAccessRules(@Nullable IResolvable value)
      An object that describes the access rules for the bucket.
    • setAccessRules

      @Stability(Stable) public void setAccessRules(@Nullable CfnBucket.AccessRulesProperty value)
      An object that describes the access rules for the bucket.
    • getObjectVersioning

      @Stability(Stable) @Nullable public Object getObjectVersioning()
      Indicates whether object versioning is enabled for the bucket.

      The following options can be configured:

      • Enabled - Object versioning is enabled.
      • Suspended - Object versioning was previously enabled but is currently suspended. Existing object versions are retained.
      • NeverEnabled - Object versioning has never been enabled.
    • setObjectVersioning

      @Stability(Stable) public void setObjectVersioning(@Nullable Boolean value)
      Indicates whether object versioning is enabled for the bucket.

      The following options can be configured:

      • Enabled - Object versioning is enabled.
      • Suspended - Object versioning was previously enabled but is currently suspended. Existing object versions are retained.
      • NeverEnabled - Object versioning has never been enabled.
    • setObjectVersioning

      @Stability(Stable) public void setObjectVersioning(@Nullable IResolvable value)
      Indicates whether object versioning is enabled for the bucket.

      The following options can be configured:

      • Enabled - Object versioning is enabled.
      • Suspended - Object versioning was previously enabled but is currently suspended. Existing object versions are retained.
      • NeverEnabled - Object versioning has never been enabled.
    • getReadOnlyAccessAccounts

      @Stability(Stable) @Nullable public List<String> getReadOnlyAccessAccounts()
      An array of AWS account IDs that have read-only access to the bucket.
    • setReadOnlyAccessAccounts

      @Stability(Stable) public void setReadOnlyAccessAccounts(@Nullable List<String> value)
      An array of AWS account IDs that have read-only access to the bucket.
    • getResourcesReceivingAccess

      @Stability(Stable) @Nullable public List<String> getResourcesReceivingAccess()
      An array of Lightsail instances that have access to the bucket.
    • setResourcesReceivingAccess

      @Stability(Stable) public void setResourcesReceivingAccess(@Nullable List<String> value)
      An array of Lightsail instances that have access to the bucket.