Class: AWSCDK::S3::CfnBucket

Inherits:
CfnResource
  • Object
show all
Includes:
IInspectable, ITaggable, Interfaces::AWSS3::IBucketRef
Defined in:
s3/cfn_bucket.rb

Overview

The AWS::S3::Bucket resource creates an Amazon S3 bucket in the same AWS Region where you create the AWS CloudFormation stack.

To control how AWS CloudFormation handles the bucket when the stack is deleted, you can set a deletion policy for your bucket. You can choose to retain the bucket or to delete the bucket. For more information, see DeletionPolicy Attribute .

You can only delete empty buckets. Deletion fails for buckets that have contents.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props = nil) ⇒ CfnBucket

Create a new AWS::S3::Bucket.

Parameters:

  • scope (Constructs::Construct)

    Scope in which this resource is defined.

  • id (String)

    Construct identifier for this resource (unique in its scope).

  • props (AWSCDK::S3::CfnBucketProps, nil) (defaults to: nil)

    Resource properties.



22
23
24
25
26
27
28
# File 's3/cfn_bucket.rb', line 22

def initialize(scope, id, props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::S3::CfnBucketProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuQ2ZuQnVja2V0UHJvcHMifQ==")), "props") unless props.nil?
  Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props)
end

Class Method Details

.arn_for_bucket(resource) ⇒ String

Parameters:

Returns:

  • (String)


113
114
115
116
# File 's3/cfn_bucket.rb', line 113

def self.arn_for_bucket(resource)
  Jsii::Type.check_type(resource, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19zMy5JQnVja2V0UmVmIn0=")), "resource")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_s3.CfnBucket", "arnForBucket", [resource])
end

.CFN_RESOURCE_TYPE_NAMEString

The CloudFormation resource type name for this resource class.

Returns:

  • (String)


246
247
248
# File 's3/cfn_bucket.rb', line 246

def self.CFN_RESOURCE_TYPE_NAME()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_s3.CfnBucket", "CFN_RESOURCE_TYPE_NAME")
end

.from_bucket_arn(scope, id, arn) ⇒ AWSCDK::Interfaces::AWSS3::IBucketRef

Creates a new IBucketRef from an ARN.

Parameters:

  • scope (Constructs::Construct)
  • id (String)
  • arn (String)

Returns:



124
125
126
127
128
129
# File 's3/cfn_bucket.rb', line 124

def self.from_bucket_arn(scope, id, arn)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "arn")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_s3.CfnBucket", "fromBucketArn", [scope, id, arn])
end

.from_bucket_name(scope, id, bucket_name) ⇒ AWSCDK::Interfaces::AWSS3::IBucketRef

Creates a new IBucketRef from a bucketName.

Parameters:

  • scope (Constructs::Construct)
  • id (String)
  • bucket_name (String)

Returns:



137
138
139
140
141
142
# File 's3/cfn_bucket.rb', line 137

def self.from_bucket_name(scope, id, bucket_name)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(bucket_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketName")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_s3.CfnBucket", "fromBucketName", [scope, id, bucket_name])
end

.is_cfn_bucket(x) ⇒ Boolean

Checks whether the given object is a CfnBucket.

Parameters:

  • x (Object)

Returns:

  • (Boolean)


148
149
150
151
# File 's3/cfn_bucket.rb', line 148

def self.is_cfn_bucket(x)
  Jsii::Type.check_type(x, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "x")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_s3.CfnBucket", "isCfnBucket", [x])
end

.jsii_overridable_methodsObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 's3/cfn_bucket.rb', line 30

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :creation_stack => { kind: :property, name: "creationStack", is_optional: false },
    :logical_id => { kind: :property, name: "logicalId", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :ref => { kind: :property, name: "ref", is_optional: false },
    :cfn_options => { kind: :property, name: "cfnOptions", is_optional: false },
    :cfn_properties => { kind: :property, name: "cfnProperties", is_optional: false },
    :cfn_property_names => { kind: :property, name: "cfnPropertyNames", is_optional: false },
    :cfn_resource_type => { kind: :property, name: "cfnResourceType", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :updated_properites => { kind: :property, name: "updatedProperites", is_optional: false },
    :updated_properties => { kind: :property, name: "updatedProperties", is_optional: false },
    :attr_arn => { kind: :property, name: "attrArn", is_optional: false },
    :attr_domain_name => { kind: :property, name: "attrDomainName", is_optional: false },
    :attr_dual_stack_domain_name => { kind: :property, name: "attrDualStackDomainName", is_optional: false },
    :attr_metadata_configuration_annotation_table_configuration_table_arn => { kind: :property, name: "attrMetadataConfigurationAnnotationTableConfigurationTableArn", is_optional: false },
    :attr_metadata_configuration_annotation_table_configuration_table_name => { kind: :property, name: "attrMetadataConfigurationAnnotationTableConfigurationTableName", is_optional: false },
    :attr_metadata_configuration_destination => { kind: :property, name: "attrMetadataConfigurationDestination", is_optional: false },
    :attr_metadata_configuration_inventory_table_configuration_table_arn => { kind: :property, name: "attrMetadataConfigurationInventoryTableConfigurationTableArn", is_optional: false },
    :attr_metadata_configuration_inventory_table_configuration_table_name => { kind: :property, name: "attrMetadataConfigurationInventoryTableConfigurationTableName", is_optional: false },
    :attr_metadata_configuration_journal_table_configuration_table_arn => { kind: :property, name: "attrMetadataConfigurationJournalTableConfigurationTableArn", is_optional: false },
    :attr_metadata_configuration_journal_table_configuration_table_name => { kind: :property, name: "attrMetadataConfigurationJournalTableConfigurationTableName", is_optional: false },
    :attr_metadata_table_configuration_s3_tables_destination_table_arn => { kind: :property, name: "attrMetadataTableConfigurationS3TablesDestinationTableArn", is_optional: false },
    :attr_metadata_table_configuration_s3_tables_destination_table_namespace => { kind: :property, name: "attrMetadataTableConfigurationS3TablesDestinationTableNamespace", is_optional: false },
    :attr_regional_domain_name => { kind: :property, name: "attrRegionalDomainName", is_optional: false },
    :attr_website_url => { kind: :property, name: "attrWebsiteUrl", is_optional: false },
    :bucket_ref => { kind: :property, name: "bucketRef", is_optional: false },
    :tags => { kind: :property, name: "tags", is_optional: false },
    :abac_status => { kind: :property, name: "abacStatus", is_optional: true },
    :accelerate_configuration => { kind: :property, name: "accelerateConfiguration", is_optional: true },
    :access_control => { kind: :property, name: "accessControl", is_optional: true },
    :analytics_configurations => { kind: :property, name: "analyticsConfigurations", is_optional: true },
    :bucket_encryption => { kind: :property, name: "bucketEncryption", is_optional: true },
    :bucket_name => { kind: :property, name: "bucketName", is_optional: true },
    :bucket_name_prefix => { kind: :property, name: "bucketNamePrefix", is_optional: true },
    :bucket_namespace => { kind: :property, name: "bucketNamespace", is_optional: true },
    :cors_configuration => { kind: :property, name: "corsConfiguration", is_optional: true },
    :intelligent_tiering_configurations => { kind: :property, name: "intelligentTieringConfigurations", is_optional: true },
    :inventory_configurations => { kind: :property, name: "inventoryConfigurations", is_optional: true },
    :lifecycle_configuration => { kind: :property, name: "lifecycleConfiguration", is_optional: true },
    :logging_configuration => { kind: :property, name: "loggingConfiguration", is_optional: true },
    :metadata_configuration => { kind: :property, name: "metadataConfiguration", is_optional: true },
    :metadata_table_configuration => { kind: :property, name: "metadataTableConfiguration", is_optional: true },
    :metrics_configurations => { kind: :property, name: "metricsConfigurations", is_optional: true },
    :notification_configuration => { kind: :property, name: "notificationConfiguration", is_optional: true },
    :object_lock_configuration => { kind: :property, name: "objectLockConfiguration", is_optional: true },
    :object_lock_enabled => { kind: :property, name: "objectLockEnabled", is_optional: true },
    :ownership_controls => { kind: :property, name: "ownershipControls", is_optional: true },
    :public_access_block_configuration => { kind: :property, name: "publicAccessBlockConfiguration", is_optional: true },
    :replication_configuration => { kind: :property, name: "replicationConfiguration", is_optional: true },
    :tags_raw => { kind: :property, name: "tagsRaw", is_optional: true },
    :versioning_configuration => { kind: :property, name: "versioningConfiguration", is_optional: true },
    :website_configuration => { kind: :property, name: "websiteConfiguration", is_optional: true },
    :to_string => { kind: :method, name: "toString", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :override_logical_id => { kind: :method, name: "overrideLogicalId", is_optional: false },
    :add_deletion_override => { kind: :method, name: "addDeletionOverride", is_optional: false },
    :add_dependency => { kind: :method, name: "addDependency", is_optional: false },
    :add_depends_on => { kind: :method, name: "addDependsOn", is_optional: false },
    :add_metadata => { kind: :method, name: "addMetadata", is_optional: false },
    :add_override => { kind: :method, name: "addOverride", is_optional: false },
    :add_property_deletion_override => { kind: :method, name: "addPropertyDeletionOverride", is_optional: false },
    :add_property_override => { kind: :method, name: "addPropertyOverride", is_optional: false },
    :apply_cross_stack_reference_strength => { kind: :method, name: "applyCrossStackReferenceStrength", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :cfn_property_name => { kind: :method, name: "cfnPropertyName", is_optional: false },
    :get_att => { kind: :method, name: "getAtt", is_optional: false },
    :get_metadata => { kind: :method, name: "getMetadata", is_optional: false },
    :obtain_dependencies => { kind: :method, name: "obtainDependencies", is_optional: false },
    :obtain_resource_dependencies => { kind: :method, name: "obtainResourceDependencies", is_optional: false },
    :remove_dependency => { kind: :method, name: "removeDependency", is_optional: false },
    :render_properties => { kind: :method, name: "renderProperties", is_optional: false },
    :replace_dependency => { kind: :method, name: "replaceDependency", is_optional: false },
    :should_synthesize => { kind: :method, name: "shouldSynthesize", is_optional: false },
    :validate_properties => { kind: :method, name: "validateProperties", is_optional: false },
    :inspect => { kind: :method, name: "inspect", is_optional: false },
  }
end

Instance Method Details

#abac_statusString?

The ABAC status of the general purpose bucket.

Returns:

  • (String, nil)


383
384
385
# File 's3/cfn_bucket.rb', line 383

def abac_status()
  jsii_get_property("abacStatus")
end

#abac_status=(value) ⇒ Object



387
388
389
390
# File 's3/cfn_bucket.rb', line 387

def abac_status=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "abacStatus") unless value.nil?
  jsii_set_property("abacStatus", value)
end

#accelerate_configurationAWSCDK::IResolvable, ...

Configures the transfer acceleration state for an Amazon S3 bucket.



395
396
397
# File 's3/cfn_bucket.rb', line 395

def accelerate_configuration()
  jsii_get_property("accelerateConfiguration")
end

#accelerate_configuration=(value) ⇒ Object



399
400
401
402
403
# File 's3/cfn_bucket.rb', line 399

def accelerate_configuration=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::AccelerateConfigurationProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuQWNjZWxlcmF0ZUNvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "accelerateConfiguration") unless value.nil?
  jsii_set_property("accelerateConfiguration", value)
end

#access_controlString?

This is a legacy property, and it is not recommended for most use cases.

Returns:

  • (String, nil)


408
409
410
# File 's3/cfn_bucket.rb', line 408

def access_control()
  jsii_get_property("accessControl")
end

#access_control=(value) ⇒ Object



412
413
414
415
# File 's3/cfn_bucket.rb', line 412

def access_control=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "accessControl") unless value.nil?
  jsii_set_property("accessControl", value)
end

#add_deletion_override(path) ⇒ void

This method returns an undefined value.

Syntactic sugar for addOverride(path, undefined).

Parameters:

  • path (String)

    The path of the value to delete.



727
728
729
730
# File 's3/cfn_bucket.rb', line 727

def add_deletion_override(path)
  Jsii::Type.check_type(path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path")
  jsii_call_method("addDeletionOverride", [path])
end

#add_dependency(target) ⇒ void

This method returns an undefined value.

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters:



739
740
741
742
# File 's3/cfn_bucket.rb', line 739

def add_dependency(target)
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5SZXNvdXJjZSJ9")), "target")
  jsii_call_method("addDependency", [target])
end

#add_depends_on(target) ⇒ void

Deprecated.

use addDependency

This method returns an undefined value.

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

Parameters:



749
750
751
752
# File 's3/cfn_bucket.rb', line 749

def add_depends_on(target)
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5SZXNvdXJjZSJ9")), "target")
  jsii_call_method("addDependsOn", [target])
end

#add_metadata(key, value) ⇒ void

This method returns an undefined value.

Add a value to the CloudFormation Resource Metadata.



760
761
762
763
764
# File 's3/cfn_bucket.rb', line 760

def (key, value)
  Jsii::Type.check_type(key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key")
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "value")
  jsii_call_method("addMetadata", [key, value])
end

#add_override(path, value) ⇒ void

This method returns an undefined value.

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use add_property_override or prefix path with "Properties." (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example,

# Example automatically generated from non-compiling source. May contain errors.
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides

"Properties": {
  "GlobalSecondaryIndexes": [
    {
      "Projection": {
        "NonKeyAttributes": [ "myattribute" ]
        ...
      }
      ...
    },
    {
      "ProjectionType": "INCLUDE"
      ...
    },
  ]
  ...
}

The value argument to add_override will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters:

  • path (String)
    • The path of the property, you can use dot notation to override values in complex types.
  • value (Object)
    • The value.


817
818
819
820
821
# File 's3/cfn_bucket.rb', line 817

def add_override(path, value)
  Jsii::Type.check_type(path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path")
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "value")
  jsii_call_method("addOverride", [path, value])
end

#add_property_deletion_override(property_path) ⇒ void

This method returns an undefined value.

Adds an override that deletes the value of a property from the resource definition.

Parameters:

  • property_path (String)

    The path to the property.



827
828
829
830
# File 's3/cfn_bucket.rb', line 827

def add_property_deletion_override(property_path)
  Jsii::Type.check_type(property_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "propertyPath")
  jsii_call_method("addPropertyDeletionOverride", [property_path])
end

#add_property_override(property_path, value) ⇒ void

This method returns an undefined value.

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters:

  • property_path (String)

    The path of the property.

  • value (Object)

    The value.



839
840
841
842
843
# File 's3/cfn_bucket.rb', line 839

def add_property_override(property_path, value)
  Jsii::Type.check_type(property_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "propertyPath")
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "value")
  jsii_call_method("addPropertyOverride", [property_path, value])
end

#analytics_configurationsAWSCDK::IResolvable, ...

Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket.



420
421
422
# File 's3/cfn_bucket.rb', line 420

def analytics_configurations()
  jsii_get_property("analyticsConfigurations")
end

#analytics_configurations=(value) ⇒ Object



424
425
426
427
# File 's3/cfn_bucket.rb', line 424

def analytics_configurations=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuQ2ZuQnVja2V0LkFuYWx5dGljc0NvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "analyticsConfigurations") unless value.nil?
  jsii_set_property("analyticsConfigurations", value)
end

#apply_cross_stack_reference_strength(strength) ⇒ void

This method returns an undefined value.

Sets the cross-stack reference strength for this resource.

When set, any cross-stack reference to this resource will use the specified strength instead of the global default from the consuming stack's context.

Parameters:



852
853
854
855
# File 's3/cfn_bucket.rb', line 852

def apply_cross_stack_reference_strength(strength)
  Jsii::Type.check_type(strength, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZWZlcmVuY2VTdHJlbmd0aCJ9")), "strength")
  jsii_call_method("applyCrossStackReferenceStrength", [strength])
end

#apply_removal_policy(policy = nil, options = nil) ⇒ void

This method returns an undefined value.

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:



874
875
876
877
878
879
# File 's3/cfn_bucket.rb', line 874

def apply_removal_policy(policy = nil, options = nil)
  Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy") unless policy.nil?
  options = options.is_a?(Hash) ? ::AWSCDK::RemovalPolicyOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5T3B0aW9ucyJ9")), "options") unless options.nil?
  jsii_call_method("applyRemovalPolicy", [policy, options])
end

#attr_arnString

Returns the Amazon Resource Name (ARN) of the specified bucket.

Example: arn:aws:s3:::DOC-EXAMPLE-BUCKET

Returns:

  • (String)


255
256
257
# File 's3/cfn_bucket.rb', line 255

def attr_arn()
  jsii_get_property("attrArn")
end

#attr_domain_nameString

Returns the IPv4 DNS name of the specified bucket.

Example: DOC-EXAMPLE-BUCKET.s3.amazonaws.com

Returns:

  • (String)


264
265
266
# File 's3/cfn_bucket.rb', line 264

def attr_domain_name()
  jsii_get_property("attrDomainName")
end

#attr_dual_stack_domain_nameString

Returns the IPv6 DNS name of the specified bucket.

Example: DOC-EXAMPLE-BUCKET.s3.dualstack.us-east-2.amazonaws.com

For more information about dual-stack endpoints, see Using Amazon S3 Dual-Stack Endpoints .

Returns:

  • (String)


275
276
277
# File 's3/cfn_bucket.rb', line 275

def attr_dual_stack_domain_name()
  jsii_get_property("attrDualStackDomainName")
end

#attr_metadata_configuration_annotation_table_configuration_table_arnString

The ARN of the annotation table.

Returns:

  • (String)


282
283
284
# File 's3/cfn_bucket.rb', line 282

def ()
  jsii_get_property("attrMetadataConfigurationAnnotationTableConfigurationTableArn")
end

#attr_metadata_configuration_annotation_table_configuration_table_nameString

The name of the annotation table.

Returns:

  • (String)


289
290
291
# File 's3/cfn_bucket.rb', line 289

def ()
  jsii_get_property("attrMetadataConfigurationAnnotationTableConfigurationTableName")
end

#attr_metadata_configuration_destinationAWSCDK::IResolvable

The destination information for the S3 Metadata configuration.

Returns:



296
297
298
# File 's3/cfn_bucket.rb', line 296

def ()
  jsii_get_property("attrMetadataConfigurationDestination")
end

#attr_metadata_configuration_inventory_table_configuration_table_arnString

The Amazon Resource Name (ARN) for the inventory table.

Returns:

  • (String)


303
304
305
# File 's3/cfn_bucket.rb', line 303

def ()
  jsii_get_property("attrMetadataConfigurationInventoryTableConfigurationTableArn")
end

#attr_metadata_configuration_inventory_table_configuration_table_nameString

The name of the inventory table.

Returns:

  • (String)


310
311
312
# File 's3/cfn_bucket.rb', line 310

def ()
  jsii_get_property("attrMetadataConfigurationInventoryTableConfigurationTableName")
end

#attr_metadata_configuration_journal_table_configuration_table_arnString

The Amazon Resource Name (ARN) for the journal table.

Returns:

  • (String)


317
318
319
# File 's3/cfn_bucket.rb', line 317

def ()
  jsii_get_property("attrMetadataConfigurationJournalTableConfigurationTableArn")
end

#attr_metadata_configuration_journal_table_configuration_table_nameString

The name of the journal table.

Returns:

  • (String)


324
325
326
# File 's3/cfn_bucket.rb', line 324

def ()
  jsii_get_property("attrMetadataConfigurationJournalTableConfigurationTableName")
end

#attr_metadata_table_configuration_s3_tables_destination_table_arnString

The Amazon Resource Name (ARN) for the metadata table in the metadata table configuration.

The specified metadata table name must be unique within the aws_s3_metadata namespace in the destination table bucket.

Returns:

  • (String)


333
334
335
# File 's3/cfn_bucket.rb', line 333

def ()
  jsii_get_property("attrMetadataTableConfigurationS3TablesDestinationTableArn")
end

#attr_metadata_table_configuration_s3_tables_destination_table_namespaceString

The table bucket namespace for the metadata table in your metadata table configuration.

This value is always aws_s3_metadata .

Returns:

  • (String)


342
343
344
# File 's3/cfn_bucket.rb', line 342

def ()
  jsii_get_property("attrMetadataTableConfigurationS3TablesDestinationTableNamespace")
end

#attr_regional_domain_nameString

Returns the regional domain name of the specified bucket.

Example: DOC-EXAMPLE-BUCKET.s3.us-east-2.amazonaws.com

Returns:

  • (String)


351
352
353
# File 's3/cfn_bucket.rb', line 351

def attr_regional_domain_name()
  jsii_get_property("attrRegionalDomainName")
end

#attr_website_urlString

Returns the Amazon S3 website endpoint for the specified bucket.

Example (IPv4): http://DOC-EXAMPLE-BUCKET.s3-website.us-east-2.amazonaws.com

Example (IPv6): http://DOC-EXAMPLE-BUCKET.s3.dualstack.us-east-2.amazonaws.com

Returns:

  • (String)


362
363
364
# File 's3/cfn_bucket.rb', line 362

def attr_website_url()
  jsii_get_property("attrWebsiteUrl")
end

#bucket_encryptionAWSCDK::IResolvable, ...

Specifies default encryption for a bucket using server-side encryption with Amazon S3-managed keys (SSE-S3), AWS KMS-managed keys (SSE-KMS), or dual-layer server-side encryption with KMS-managed keys (DSSE-KMS).



432
433
434
# File 's3/cfn_bucket.rb', line 432

def bucket_encryption()
  jsii_get_property("bucketEncryption")
end

#bucket_encryption=(value) ⇒ Object



436
437
438
439
440
# File 's3/cfn_bucket.rb', line 436

def bucket_encryption=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::BucketEncryptionProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuQnVja2V0RW5jcnlwdGlvblByb3BlcnR5In1dfX0=")), "bucketEncryption") unless value.nil?
  jsii_set_property("bucketEncryption", value)
end

#bucket_nameString?

A name for the bucket.

Returns:

  • (String, nil)


445
446
447
# File 's3/cfn_bucket.rb', line 445

def bucket_name()
  jsii_get_property("bucketName")
end

#bucket_name=(value) ⇒ Object



449
450
451
452
# File 's3/cfn_bucket.rb', line 449

def bucket_name=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketName") unless value.nil?
  jsii_set_property("bucketName", value)
end

#bucket_name_prefixString?

Returns:

  • (String, nil)


455
456
457
# File 's3/cfn_bucket.rb', line 455

def bucket_name_prefix()
  jsii_get_property("bucketNamePrefix")
end

#bucket_name_prefix=(value) ⇒ Object



459
460
461
462
# File 's3/cfn_bucket.rb', line 459

def bucket_name_prefix=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketNamePrefix") unless value.nil?
  jsii_set_property("bucketNamePrefix", value)
end

#bucket_namespaceString?

Returns:

  • (String, nil)


465
466
467
# File 's3/cfn_bucket.rb', line 465

def bucket_namespace()
  jsii_get_property("bucketNamespace")
end

#bucket_namespace=(value) ⇒ Object



469
470
471
472
# File 's3/cfn_bucket.rb', line 469

def bucket_namespace=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bucketNamespace") unless value.nil?
  jsii_set_property("bucketNamespace", value)
end

#bucket_refAWSCDK::Interfaces::AWSS3::BucketReference

A reference to a Bucket resource.



369
370
371
# File 's3/cfn_bucket.rb', line 369

def bucket_ref()
  jsii_get_property("bucketRef")
end

#cfn_optionsAWSCDK::ICfnResourceOptions

Options for this resource, such as condition, update policy etc.



199
200
201
# File 's3/cfn_bucket.rb', line 199

def cfn_options()
  jsii_get_property("cfnOptions")
end

#cfn_propertiesHash{String => Object}

Returns:

  • (Hash{String => Object})


204
205
206
# File 's3/cfn_bucket.rb', line 204

def cfn_properties()
  jsii_get_property("cfnProperties")
end

#cfn_property_name(cdk_property_name) ⇒ String?

Parameters:

  • cdk_property_name (String)

Returns:

  • (String, nil)


883
884
885
886
# File 's3/cfn_bucket.rb', line 883

def cfn_property_name(cdk_property_name)
  Jsii::Type.check_type(cdk_property_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "cdkPropertyName")
  jsii_call_method("cfnPropertyName", [cdk_property_name])
end

#cfn_property_namesHash{String => String}

Returns:

  • (Hash{String => String})


209
210
211
# File 's3/cfn_bucket.rb', line 209

def cfn_property_names()
  jsii_get_property("cfnPropertyNames")
end

#cfn_resource_typeString

AWS resource type.

Returns:

  • (String)


216
217
218
# File 's3/cfn_bucket.rb', line 216

def cfn_resource_type()
  jsii_get_property("cfnResourceType")
end

#cors_configurationAWSCDK::IResolvable, ...

Describes the cross-origin access configuration for objects in an Amazon S3 bucket.



477
478
479
# File 's3/cfn_bucket.rb', line 477

def cors_configuration()
  jsii_get_property("corsConfiguration")
end

#cors_configuration=(value) ⇒ Object



481
482
483
484
485
# File 's3/cfn_bucket.rb', line 481

def cors_configuration=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::CorsConfigurationProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuQ29yc0NvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "corsConfiguration") unless value.nil?
  jsii_set_property("corsConfiguration", value)
end

#creation_stackArray<String>

Returns:

  • (Array<String>)


161
162
163
# File 's3/cfn_bucket.rb', line 161

def creation_stack()
  jsii_get_property("creationStack")
end

#envAWSCDK::Interfaces::ResourceEnvironment



221
222
223
# File 's3/cfn_bucket.rb', line 221

def env()
  jsii_get_property("env")
end

#get_att(attribute_name, type_hint = nil) ⇒ AWSCDK::Reference

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters:

Returns:



896
897
898
899
900
# File 's3/cfn_bucket.rb', line 896

def get_att(attribute_name, type_hint = nil)
  Jsii::Type.check_type(attribute_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "attributeName")
  Jsii::Type.check_type(type_hint, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZXNvbHV0aW9uVHlwZUhpbnQifQ==")), "typeHint") unless type_hint.nil?
  jsii_call_method("getAtt", [attribute_name, type_hint])
end

#get_metadata(key) ⇒ Object

Retrieve a value value from the CloudFormation Resource Metadata.



907
908
909
910
# File 's3/cfn_bucket.rb', line 907

def (key)
  Jsii::Type.check_type(key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key")
  jsii_call_method("getMetadata", [key])
end

#inspect(inspector) ⇒ void

This method returns an undefined value.

Examines the CloudFormation resource and discloses attributes.

Parameters:



977
978
979
980
# File 's3/cfn_bucket.rb', line 977

def inspect(inspector)
  Jsii::Type.check_type(inspector, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5UcmVlSW5zcGVjdG9yIn0=")), "inspector")
  jsii_call_method("inspect", [inspector])
end

#intelligent_tiering_configurationsAWSCDK::IResolvable, ...

Defines how Amazon S3 handles Intelligent-Tiering storage.



490
491
492
# File 's3/cfn_bucket.rb', line 490

def intelligent_tiering_configurations()
  jsii_get_property("intelligentTieringConfigurations")
end

#intelligent_tiering_configurations=(value) ⇒ Object



494
495
496
497
# File 's3/cfn_bucket.rb', line 494

def intelligent_tiering_configurations=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuQ2ZuQnVja2V0LkludGVsbGlnZW50VGllcmluZ0NvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "intelligentTieringConfigurations") unless value.nil?
  jsii_set_property("intelligentTieringConfigurations", value)
end

#inventory_configurationsAWSCDK::IResolvable, ...

Specifies the S3 Inventory configuration for an Amazon S3 bucket.



502
503
504
# File 's3/cfn_bucket.rb', line 502

def inventory_configurations()
  jsii_get_property("inventoryConfigurations")
end

#inventory_configurations=(value) ⇒ Object



506
507
508
509
# File 's3/cfn_bucket.rb', line 506

def inventory_configurations=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuQ2ZuQnVja2V0LkludmVudG9yeUNvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "inventoryConfigurations") unless value.nil?
  jsii_set_property("inventoryConfigurations", value)
end

#lifecycle_configurationAWSCDK::IResolvable, ...

Specifies the lifecycle configuration for objects in an Amazon S3 bucket.



514
515
516
# File 's3/cfn_bucket.rb', line 514

def lifecycle_configuration()
  jsii_get_property("lifecycleConfiguration")
end

#lifecycle_configuration=(value) ⇒ Object



518
519
520
521
522
# File 's3/cfn_bucket.rb', line 518

def lifecycle_configuration=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::LifecycleConfigurationProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuTGlmZWN5Y2xlQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "lifecycleConfiguration") unless value.nil?
  jsii_set_property("lifecycleConfiguration", value)
end

#logging_configurationAWSCDK::IResolvable, ...

Settings that define where logs are stored.



527
528
529
# File 's3/cfn_bucket.rb', line 527

def logging_configuration()
  jsii_get_property("loggingConfiguration")
end

#logging_configuration=(value) ⇒ Object



531
532
533
534
535
# File 's3/cfn_bucket.rb', line 531

def logging_configuration=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::LoggingConfigurationProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuTG9nZ2luZ0NvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "loggingConfiguration") unless value.nil?
  jsii_set_property("loggingConfiguration", value)
end

#logical_idString

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use override_logical_id(new_logical_id).

Returns:

  • (String)


173
174
175
# File 's3/cfn_bucket.rb', line 173

def logical_id()
  jsii_get_property("logicalId")
end

#metadata_configurationAWSCDK::IResolvable, ...

The S3 Metadata configuration for a general purpose bucket.



540
541
542
# File 's3/cfn_bucket.rb', line 540

def ()
  jsii_get_property("metadataConfiguration")
end

#metadata_configuration=(value) ⇒ Object



544
545
546
547
548
# File 's3/cfn_bucket.rb', line 544

def (value)
  value = value.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::MetadataConfigurationProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuTWV0YWRhdGFDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "metadataConfiguration") unless value.nil?
  jsii_set_property("metadataConfiguration", value)
end

#metadata_table_configurationAWSCDK::IResolvable, ...

The metadata table configuration of an Amazon S3 general purpose bucket.



553
554
555
# File 's3/cfn_bucket.rb', line 553

def ()
  jsii_get_property("metadataTableConfiguration")
end

#metadata_table_configuration=(value) ⇒ Object



557
558
559
560
561
# File 's3/cfn_bucket.rb', line 557

def (value)
  value = value.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::MetadataTableConfigurationProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuTWV0YWRhdGFUYWJsZUNvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "metadataTableConfiguration") unless value.nil?
  jsii_set_property("metadataTableConfiguration", value)
end

#metrics_configurationsAWSCDK::IResolvable, ...

Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket.



566
567
568
# File 's3/cfn_bucket.rb', line 566

def metrics_configurations()
  jsii_get_property("metricsConfigurations")
end

#metrics_configurations=(value) ⇒ Object



570
571
572
573
# File 's3/cfn_bucket.rb', line 570

def metrics_configurations=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuQ2ZuQnVja2V0Lk1ldHJpY3NDb25maWd1cmF0aW9uUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "metricsConfigurations") unless value.nil?
  jsii_set_property("metricsConfigurations", value)
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


156
157
158
# File 's3/cfn_bucket.rb', line 156

def node()
  jsii_get_property("node")
end

#notification_configurationAWSCDK::IResolvable, ...

Configuration that defines how Amazon S3 handles bucket notifications.



578
579
580
# File 's3/cfn_bucket.rb', line 578

def notification_configuration()
  jsii_get_property("notificationConfiguration")
end

#notification_configuration=(value) ⇒ Object



582
583
584
585
586
# File 's3/cfn_bucket.rb', line 582

def notification_configuration=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::NotificationConfigurationProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuTm90aWZpY2F0aW9uQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "notificationConfiguration") unless value.nil?
  jsii_set_property("notificationConfiguration", value)
end

#object_lock_configurationAWSCDK::IResolvable, ...

This operation is not supported for directory buckets.



591
592
593
# File 's3/cfn_bucket.rb', line 591

def object_lock_configuration()
  jsii_get_property("objectLockConfiguration")
end

#object_lock_configuration=(value) ⇒ Object



595
596
597
598
599
# File 's3/cfn_bucket.rb', line 595

def object_lock_configuration=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::ObjectLockConfigurationProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuT2JqZWN0TG9ja0NvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "objectLockConfiguration") unless value.nil?
  jsii_set_property("objectLockConfiguration", value)
end

#object_lock_enabledBoolean, ...

Indicates whether this bucket has an Object Lock configuration enabled.

Returns:



604
605
606
# File 's3/cfn_bucket.rb', line 604

def object_lock_enabled()
  jsii_get_property("objectLockEnabled")
end

#object_lock_enabled=(value) ⇒ Object



608
609
610
611
# File 's3/cfn_bucket.rb', line 608

def object_lock_enabled=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "objectLockEnabled") unless value.nil?
  jsii_set_property("objectLockEnabled", value)
end

#obtain_dependenciesArray<AWSCDK::CfnResource, AWSCDK::Stack>

Retrieves an array of resources this resource depends on.

This assembles dependencies on resources across stacks (including nested stacks) automatically.

Returns:



918
919
920
# File 's3/cfn_bucket.rb', line 918

def obtain_dependencies()
  jsii_call_method("obtainDependencies", [])
end

#obtain_resource_dependenciesArray<AWSCDK::CfnResource>

Get a shallow copy of dependencies between this resource and other resources in the same stack.

Returns:



925
926
927
# File 's3/cfn_bucket.rb', line 925

def obtain_resource_dependencies()
  jsii_call_method("obtainResourceDependencies", [])
end

#override_logical_id(new_logical_id) ⇒ void

This method returns an undefined value.

Overrides the auto-generated logical ID with a specific ID.

Parameters:

  • new_logical_id (String)

    The new logical ID to use for this stack element.



718
719
720
721
# File 's3/cfn_bucket.rb', line 718

def override_logical_id(new_logical_id)
  Jsii::Type.check_type(new_logical_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "newLogicalId")
  jsii_call_method("overrideLogicalId", [new_logical_id])
end

#ownership_controlsAWSCDK::IResolvable, ...

Configuration that defines how Amazon S3 handles Object Ownership rules.



616
617
618
# File 's3/cfn_bucket.rb', line 616

def ownership_controls()
  jsii_get_property("ownershipControls")
end

#ownership_controls=(value) ⇒ Object



620
621
622
623
624
# File 's3/cfn_bucket.rb', line 620

def ownership_controls=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::OwnershipControlsProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuT3duZXJzaGlwQ29udHJvbHNQcm9wZXJ0eSJ9XX19")), "ownershipControls") unless value.nil?
  jsii_set_property("ownershipControls", value)
end

#public_access_block_configurationAWSCDK::IResolvable, ...

Configuration that defines how Amazon S3 handles public access.



629
630
631
# File 's3/cfn_bucket.rb', line 629

def public_access_block_configuration()
  jsii_get_property("publicAccessBlockConfiguration")
end

#public_access_block_configuration=(value) ⇒ Object



633
634
635
636
637
# File 's3/cfn_bucket.rb', line 633

def public_access_block_configuration=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::PublicAccessBlockConfigurationProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuUHVibGljQWNjZXNzQmxvY2tDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "publicAccessBlockConfiguration") unless value.nil?
  jsii_set_property("publicAccessBlockConfiguration", value)
end

#refString

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

Returns:

  • (String)


192
193
194
# File 's3/cfn_bucket.rb', line 192

def ref()
  jsii_get_property("ref")
end

#remove_dependency(target) ⇒ void

This method returns an undefined value.

Indicates that this resource no longer depends on another resource.

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

Parameters:



936
937
938
939
# File 's3/cfn_bucket.rb', line 936

def remove_dependency(target)
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5SZXNvdXJjZSJ9")), "target")
  jsii_call_method("removeDependency", [target])
end

#render_properties(props) ⇒ Hash{String => Object}

Parameters:

  • props (Hash{String => Object})

Returns:

  • (Hash{String => Object})


943
944
945
946
# File 's3/cfn_bucket.rb', line 943

def render_properties(props)
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "props")
  jsii_call_method("renderProperties", [props])
end

#replace_dependency(target, new_target) ⇒ void

This method returns an undefined value.

Replaces one dependency with another.

Parameters:



953
954
955
956
957
# File 's3/cfn_bucket.rb', line 953

def replace_dependency(target, new_target)
  Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5SZXNvdXJjZSJ9")), "target")
  Jsii::Type.check_type(new_target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5SZXNvdXJjZSJ9")), "newTarget")
  jsii_call_method("replaceDependency", [target, new_target])
end

#replication_configurationAWSCDK::IResolvable, ...

Configuration for replicating objects in an S3 bucket.



642
643
644
# File 's3/cfn_bucket.rb', line 642

def replication_configuration()
  jsii_get_property("replicationConfiguration")
end

#replication_configuration=(value) ⇒ Object



646
647
648
649
650
# File 's3/cfn_bucket.rb', line 646

def replication_configuration=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::ReplicationConfigurationProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuUmVwbGljYXRpb25Db25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "replicationConfiguration") unless value.nil?
  jsii_set_property("replicationConfiguration", value)
end

#should_synthesizeBoolean

Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.

Returns:

  • (Boolean)

    true if the resource should be included or false is the resource should be omitted.



962
963
964
# File 's3/cfn_bucket.rb', line 962

def should_synthesize()
  jsii_call_method("shouldSynthesize", [])
end

#stackAWSCDK::Stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

Returns:



182
183
184
# File 's3/cfn_bucket.rb', line 182

def stack()
  jsii_get_property("stack")
end

#tagsAWSCDK::TagManager

Tag Manager which manages the tags for this resource.

Returns:



376
377
378
# File 's3/cfn_bucket.rb', line 376

def tags()
  jsii_get_property("tags")
end

#tags_rawArray<AWSCDK::CfnTag>?

An arbitrary set of tags (key-value pairs) for this S3 bucket.

Returns:



655
656
657
# File 's3/cfn_bucket.rb', line 655

def tags_raw()
  jsii_get_property("tagsRaw")
end

#tags_raw=(value) ⇒ Object



659
660
661
662
663
# File 's3/cfn_bucket.rb', line 659

def tags_raw=(value)
  value = value.is_a?(Array) ? value.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tagsRaw") unless value.nil?
  jsii_set_property("tagsRaw", value)
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)

    a string representation of this resource



694
695
696
# File 's3/cfn_bucket.rb', line 694

def to_string()
  jsii_call_method("toString", [])
end

#updated_properitesHash{String => Object}

Deprecated.

use updatedProperties Return properties modified after initiation Resources that expose mutable properties should override this function to collect and return the properties object for this resource.

Deprecated.

Returns:

  • (Hash{String => Object})


229
230
231
# File 's3/cfn_bucket.rb', line 229

def updated_properites()
  jsii_get_property("updatedProperites")
end

#updated_propertiesHash{String => Object}

Return properties modified after initiation.

Resources that expose mutable properties should override this function to collect and return the properties object for this resource.

Returns:

  • (Hash{String => Object})


239
240
241
# File 's3/cfn_bucket.rb', line 239

def updated_properties()
  jsii_get_property("updatedProperties")
end

#validate_properties(_properties) ⇒ void

This method returns an undefined value.

Parameters:

  • _properties (Object)


968
969
970
971
# File 's3/cfn_bucket.rb', line 968

def validate_properties(_properties)
  Jsii::Type.check_type(_properties, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "_properties")
  jsii_call_method("validateProperties", [_properties])
end

#versioning_configurationAWSCDK::IResolvable, ...

Enables multiple versions of all objects in this bucket.



668
669
670
# File 's3/cfn_bucket.rb', line 668

def versioning_configuration()
  jsii_get_property("versioningConfiguration")
end

#versioning_configuration=(value) ⇒ Object



672
673
674
675
676
# File 's3/cfn_bucket.rb', line 672

def versioning_configuration=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::VersioningConfigurationProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuVmVyc2lvbmluZ0NvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "versioningConfiguration") unless value.nil?
  jsii_set_property("versioningConfiguration", value)
end

#website_configurationAWSCDK::IResolvable, ...

Information used to configure the bucket as a static website.



681
682
683
# File 's3/cfn_bucket.rb', line 681

def website_configuration()
  jsii_get_property("websiteConfiguration")
end

#website_configuration=(value) ⇒ Object



685
686
687
688
689
# File 's3/cfn_bucket.rb', line 685

def website_configuration=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::WebsiteConfigurationProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuV2Vic2l0ZUNvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "websiteConfiguration") unless value.nil?
  jsii_set_property("websiteConfiguration", value)
end

#with(*mixins) ⇒ Constructs::IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

Parameters:

  • mixins (Array<Constructs::IMixin>)

Returns:

  • (Constructs::IConstruct)


707
708
709
710
711
712
# File 's3/cfn_bucket.rb', line 707

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end