CfnBucket
- class aws_cdk.aws_s3.CfnBucket(scope, id, *, accelerate_configuration=None, access_control=None, analytics_configurations=None, bucket_encryption=None, bucket_name=None, cors_configuration=None, intelligent_tiering_configurations=None, inventory_configurations=None, lifecycle_configuration=None, logging_configuration=None, metrics_configurations=None, notification_configuration=None, object_lock_configuration=None, object_lock_enabled=None, ownership_controls=None, public_access_block_configuration=None, replication_configuration=None, tags=None, versioning_configuration=None, website_configuration=None)
Bases:
CfnResource
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 . .. epigraph:
You can only delete empty buckets. Deletion fails for buckets that have contents.
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html
- CloudformationResource:
AWS::S3::Bucket
- ExampleMetadata:
infused
Example:
# cfn_template: cfn_inc.CfnInclude cfn_bucket = cfn_template.get_resource("Bucket") role = iam.Role(self, "Role", assumed_by=iam.AnyPrincipal() ) role.add_to_policy(iam.PolicyStatement( actions=["s3:*"], resources=[cfn_bucket.attr_arn] ))
- Parameters:
scope (
Construct
) – Scope in which this resource is defined.id (
str
) – Construct identifier for this resource (unique in its scope).accelerate_configuration (
Union
[IResolvable
,AccelerateConfigurationProperty
,Dict
[str
,Any
],None
]) – Configures the transfer acceleration state for an Amazon S3 bucket. For more information, see Amazon S3 Transfer Acceleration in the Amazon S3 User Guide .access_control (
Optional
[str
]) –This is a legacy property, and it is not recommended for most use cases. A majority of modern use cases in Amazon S3 no longer require the use of ACLs, and we recommend that you keep ACLs disabled. For more information, see Controlling object ownership in the Amazon S3 User Guide . A canned access control list (ACL) that grants predefined permissions to the bucket. For more information about canned ACLs, see Canned ACL in the Amazon S3 User Guide . S3 buckets are created with ACLs disabled by default. Therefore, unless you explicitly set the AWS::S3::OwnershipControls property to enable ACLs, your resource will fail to deploy with any value other than Private. Use cases requiring ACLs are uncommon. The majority of access control configurations can be successfully and more easily achieved with bucket policies. For more information, see AWS::S3::BucketPolicy . For examples of common policy configurations, including S3 Server Access Logs buckets and more, see Bucket policy examples in the Amazon S3 User Guide .
analytics_configurations (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,AnalyticsConfigurationProperty
,Dict
[str
,Any
]]],None
]) – Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket.bucket_encryption (
Union
[IResolvable
,BucketEncryptionProperty
,Dict
[str
,Any
],None
]) – 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). For information about the Amazon S3 default encryption feature, see Amazon S3 Default Encryption for S3 Buckets in the Amazon S3 User Guide .bucket_name (
Optional
[str
]) – A name for the bucket. If you don’t specify a name, AWS CloudFormation generates a unique ID and uses that ID for the bucket name. The bucket name must contain only lowercase letters, numbers, periods (.), and dashes (-) and must follow Amazon S3 bucket restrictions and limitations . For more information, see Rules for naming Amazon S3 buckets in the Amazon S3 User Guide . .. epigraph:: If you specify a name, you can’t perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you need to replace the resource, specify a new name.cors_configuration (
Union
[IResolvable
,CorsConfigurationProperty
,Dict
[str
,Any
],None
]) – Describes the cross-origin access configuration for objects in an Amazon S3 bucket. For more information, see Enabling Cross-Origin Resource Sharing in the Amazon S3 User Guide .intelligent_tiering_configurations (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,IntelligentTieringConfigurationProperty
,Dict
[str
,Any
]]],None
]) – Defines how Amazon S3 handles Intelligent-Tiering storage.inventory_configurations (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,InventoryConfigurationProperty
,Dict
[str
,Any
]]],None
]) – Specifies the inventory configuration for an Amazon S3 bucket. For more information, see GET Bucket inventory in the Amazon S3 API Reference .lifecycle_configuration (
Union
[IResolvable
,LifecycleConfigurationProperty
,Dict
[str
,Any
],None
]) – Specifies the lifecycle configuration for objects in an Amazon S3 bucket. For more information, see Object Lifecycle Management in the Amazon S3 User Guide .logging_configuration (
Union
[IResolvable
,LoggingConfigurationProperty
,Dict
[str
,Any
],None
]) – Settings that define where logs are stored.metrics_configurations (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,MetricsConfigurationProperty
,Dict
[str
,Any
]]],None
]) – Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket. If you’re updating an existing metrics configuration, note that this is a full replacement of the existing metrics configuration. If you don’t include the elements you want to keep, they are erased. For more information, see PutBucketMetricsConfiguration .notification_configuration (
Union
[IResolvable
,NotificationConfigurationProperty
,Dict
[str
,Any
],None
]) – Configuration that defines how Amazon S3 handles bucket notifications.object_lock_configuration (
Union
[IResolvable
,ObjectLockConfigurationProperty
,Dict
[str
,Any
],None
]) –This operation is not supported by directory buckets. Places an Object Lock configuration on the specified bucket. The rule specified in the Object Lock configuration will be applied by default to every new object placed in the specified bucket. For more information, see Locking Objects . .. epigraph:: - The
DefaultRetention
settings require both a mode and a period. - TheDefaultRetention
period can be eitherDays
orYears
but you must select one. You cannot specifyDays
andYears
at the same time. - You can enable Object Lock for new or existing buckets. For more information, see Configuring Object Lock .object_lock_enabled (
Union
[bool
,IResolvable
,None
]) – Indicates whether this bucket has an Object Lock configuration enabled. EnableObjectLockEnabled
when you applyObjectLockConfiguration
to a bucket.ownership_controls (
Union
[IResolvable
,OwnershipControlsProperty
,Dict
[str
,Any
],None
]) – Configuration that defines how Amazon S3 handles Object Ownership rules.public_access_block_configuration (
Union
[IResolvable
,PublicAccessBlockConfigurationProperty
,Dict
[str
,Any
],None
]) – Configuration that defines how Amazon S3 handles public access.replication_configuration (
Union
[IResolvable
,ReplicationConfigurationProperty
,Dict
[str
,Any
],None
]) – Configuration for replicating objects in an S3 bucket. To enable replication, you must also enable versioning by using theVersioningConfiguration
property. Amazon S3 can store replicated objects in a single destination bucket or multiple destination buckets. The destination bucket or buckets must already exist.tags (
Optional
[Sequence
[Union
[CfnTag
,Dict
[str
,Any
]]]]) – An arbitrary set of tags (key-value pairs) for this S3 bucket.versioning_configuration (
Union
[IResolvable
,VersioningConfigurationProperty
,Dict
[str
,Any
],None
]) – Enables multiple versions of all objects in this bucket. You might enable versioning to prevent objects from being deleted or overwritten by mistake or to archive objects so that you can retrieve previous versions of them. .. epigraph:: When you enable versioning on a bucket for the first time, it might take a short amount of time for the change to be fully propagated. We recommend that you wait for 15 minutes after enabling versioning before issuing write operations (PUT
orDELETE
) on objects in the bucket.website_configuration (
Union
[IResolvable
,WebsiteConfigurationProperty
,Dict
[str
,Any
],None
]) – Information used to configure the bucket as a static website. For more information, see Hosting Websites on Amazon S3 .
Methods
- add_deletion_override(path)
Syntactic sugar for
addOverride(path, undefined)
.- Parameters:
path (
str
) – The path of the value to delete.- Return type:
None
- add_dependency(target)
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:
target (
CfnResource
) –- Return type:
None
- add_depends_on(target)
(deprecated) Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
- Parameters:
target (
CfnResource
) –- Deprecated:
use addDependency
- Stability:
deprecated
- Return type:
None
- add_metadata(key, value)
Add a value to the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –value (
Any
) –
- See:
- Return type:
None
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- add_override(path, value)
Adds an override to the synthesized CloudFormation resource.
To add a property override, either use
addPropertyOverride
or prefixpath
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:
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"]) cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")
would add the overrides Example:
"Properties": { "GlobalSecondaryIndexes": [ { "Projection": { "NonKeyAttributes": [ "myattribute" ] ... } ... }, { "ProjectionType": "INCLUDE" ... }, ] ... }
The
value
argument toaddOverride
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 (
str
) –The path of the property, you can use dot notation to override values in complex types. Any intermediate keys will be created as needed.
value (
Any
) –The value. Could be primitive or complex.
- Return type:
None
- add_property_deletion_override(property_path)
Adds an override that deletes the value of a property from the resource definition.
- Parameters:
property_path (
str
) – The path to the property.- Return type:
None
- add_property_override(property_path, value)
Adds an override to a resource property.
Syntactic sugar for
addOverride("Properties.<...>", value)
.- Parameters:
property_path (
str
) – The path of the property.value (
Any
) – The value.
- Return type:
None
- apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)
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:- Parameters:
policy (
Optional
[RemovalPolicy
]) –apply_to_update_replace_policy (
Optional
[bool
]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: truedefault (
Optional
[RemovalPolicy
]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resource, please consult that specific resource’s documentation.
- See:
- Return type:
None
- get_att(attribute_name, type_hint=None)
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:
attribute_name (
str
) – The name of the attribute.type_hint (
Optional
[ResolutionTypeHint
]) –
- Return type:
- get_metadata(key)
Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –- See:
- Return type:
Any
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- inspect(inspector)
Examines the CloudFormation resource and discloses attributes.
- Parameters:
inspector (
TreeInspector
) – tree inspector to collect and process attributes.- Return type:
None
- obtain_dependencies()
Retrieves an array of resources this resource depends on.
This assembles dependencies on resources across stacks (including nested stacks) automatically.
- Return type:
List
[Union
[Stack
,CfnResource
]]
- obtain_resource_dependencies()
Get a shallow copy of dependencies between this resource and other resources in the same stack.
- Return type:
List
[CfnResource
]
- override_logical_id(new_logical_id)
Overrides the auto-generated logical ID with a specific ID.
- Parameters:
new_logical_id (
str
) – The new logical ID to use for this stack element.- Return type:
None
- remove_dependency(target)
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:
target (
CfnResource
) –- Return type:
None
- replace_dependency(target, new_target)
Replaces one dependency with another.
- Parameters:
target (
CfnResource
) – The dependency to replace.new_target (
CfnResource
) – The new dependency to add.
- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
- Returns:
a string representation of this resource
Attributes
- CFN_RESOURCE_TYPE_NAME = 'AWS::S3::Bucket'
- accelerate_configuration
Configures the transfer acceleration state for an Amazon S3 bucket.
- access_control
This is a legacy property, and it is not recommended for most use cases.
- analytics_configurations
Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket.
- attr_arn
Returns the Amazon Resource Name (ARN) of the specified bucket.
Example:
arn:aws:s3:::DOC-EXAMPLE-BUCKET
- CloudformationAttribute:
Arn
- attr_domain_name
Returns the IPv4 DNS name of the specified bucket.
Example:
DOC-EXAMPLE-BUCKET.s3.amazonaws.com
- CloudformationAttribute:
DomainName
- attr_dual_stack_domain_name
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 .
- CloudformationAttribute:
DualStackDomainName
- attr_regional_domain_name
Returns the regional domain name of the specified bucket.
Example:
DOC-EXAMPLE-BUCKET.s3.us-east-2.amazonaws.com
- CloudformationAttribute:
RegionalDomainName
- attr_website_url
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
- CloudformationAttribute:
WebsiteURL
- bucket_encryption
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).
- bucket_name
A name for the bucket.
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- cors_configuration
Describes the cross-origin access configuration for objects in an Amazon S3 bucket.
- creation_stack
return:
the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.
- intelligent_tiering_configurations
Defines how Amazon S3 handles Intelligent-Tiering storage.
- inventory_configurations
Specifies the inventory configuration for an Amazon S3 bucket.
- lifecycle_configuration
Specifies the lifecycle configuration for objects in an Amazon S3 bucket.
- logging_configuration
Settings that define where logs are stored.
- logical_id
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
overrideLogicalId(newLogicalId)
.- Returns:
the logical ID as a stringified token. This value will only get resolved during synthesis.
- metrics_configurations
Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket.
- node
The tree node.
- notification_configuration
Configuration that defines how Amazon S3 handles bucket notifications.
- object_lock_configuration
This operation is not supported by directory buckets.
- object_lock_enabled
Indicates whether this bucket has an Object Lock configuration enabled.
- ownership_controls
Configuration that defines how Amazon S3 handles Object Ownership rules.
- public_access_block_configuration
Configuration that defines how Amazon S3 handles public access.
- ref
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 })
.
- replication_configuration
Configuration for replicating objects in an S3 bucket.
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- tags
Tag Manager which manages the tags for this resource.
- tags_raw
An arbitrary set of tags (key-value pairs) for this S3 bucket.
- versioning_configuration
Enables multiple versions of all objects in this bucket.
- website_configuration
Information used to configure the bucket as a static website.
Static Methods
- classmethod is_cfn_element(x)
Returns
true
if a construct is a stack element (i.e. part of the synthesized cloudformation template).Uses duck-typing instead of
instanceof
to allow stack elements from different versions of this library to be included in the same stack.- Parameters:
x (
Any
) –- Return type:
bool
- Returns:
The construct as a stack element or undefined if it is not a stack element.
- classmethod is_cfn_resource(x)
Check whether the given object is a CfnResource.
- Parameters:
x (
Any
) –- Return type:
bool
- classmethod is_construct(x)
Checks if
x
is a construct.Use this method instead of
instanceof
to properly detectConstruct
instances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructs
library on disk are seen as independent, completely different libraries. As a consequence, the classConstruct
in each copy of theconstructs
library is seen as a different class, and an instance of one class will not test asinstanceof
the other class.npm install
will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructs
library can be accidentally installed, andinstanceof
will behave unpredictably. It is safest to avoid usinginstanceof
, and using this type-testing method instead.- Parameters:
x (
Any
) – Any object.- Return type:
bool
- Returns:
true if
x
is an object created from a class which extendsConstruct
.
AbortIncompleteMultipartUploadProperty
- class CfnBucket.AbortIncompleteMultipartUploadProperty(*, days_after_initiation)
Bases:
object
Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload.
For more information, see Stopping Incomplete Multipart Uploads Using a Bucket Lifecycle Policy in the Amazon S3 User Guide .
- Parameters:
days_after_initiation (
Union
[int
,float
]) – Specifies the number of days after which Amazon S3 stops an incomplete multipart upload.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 abort_incomplete_multipart_upload_property = s3.CfnBucket.AbortIncompleteMultipartUploadProperty( days_after_initiation=123 )
Attributes
- days_after_initiation
Specifies the number of days after which Amazon S3 stops an incomplete multipart upload.
AccelerateConfigurationProperty
- class CfnBucket.AccelerateConfigurationProperty(*, acceleration_status)
Bases:
object
Configures the transfer acceleration state for an Amazon S3 bucket.
For more information, see Amazon S3 Transfer Acceleration in the Amazon S3 User Guide .
- Parameters:
acceleration_status (
str
) – Specifies the transfer acceleration status of the bucket.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 accelerate_configuration_property = s3.CfnBucket.AccelerateConfigurationProperty( acceleration_status="accelerationStatus" )
Attributes
- acceleration_status
Specifies the transfer acceleration status of the bucket.
AccessControlTranslationProperty
- class CfnBucket.AccessControlTranslationProperty(*, owner)
Bases:
object
Specify this only in a cross-account scenario (where source and destination bucket owners are not the same), and you want to change replica ownership to the AWS account that owns the destination bucket.
If this is not specified in the replication configuration, the replicas are owned by same AWS account that owns the source object.
- Parameters:
owner (
str
) – Specifies the replica ownership. For default and valid values, see PUT bucket replication in the Amazon S3 API Reference .- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 access_control_translation_property = s3.CfnBucket.AccessControlTranslationProperty( owner="owner" )
Attributes
- owner
Specifies the replica ownership.
For default and valid values, see PUT bucket replication in the Amazon S3 API Reference .
AnalyticsConfigurationProperty
- class CfnBucket.AnalyticsConfigurationProperty(*, id, storage_class_analysis, prefix=None, tag_filters=None)
Bases:
object
Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket.
- Parameters:
id (
str
) – The ID that identifies the analytics configuration.storage_class_analysis (
Union
[IResolvable
,StorageClassAnalysisProperty
,Dict
[str
,Any
]]) – Contains data related to access patterns to be collected and made available to analyze the tradeoffs between different storage classes.prefix (
Optional
[str
]) – The prefix that an object must have to be included in the analytics results.tag_filters (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,TagFilterProperty
,Dict
[str
,Any
]]],None
]) – The tags to use when evaluating an analytics filter. The analytics only includes objects that meet the filter’s criteria. If no filter is specified, all of the contents of the bucket are included in the analysis.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 analytics_configuration_property = s3.CfnBucket.AnalyticsConfigurationProperty( id="id", storage_class_analysis=s3.CfnBucket.StorageClassAnalysisProperty( data_export=s3.CfnBucket.DataExportProperty( destination=s3.CfnBucket.DestinationProperty( bucket_arn="bucketArn", format="format", # the properties below are optional bucket_account_id="bucketAccountId", prefix="prefix" ), output_schema_version="outputSchemaVersion" ) ), # the properties below are optional prefix="prefix", tag_filters=[s3.CfnBucket.TagFilterProperty( key="key", value="value" )] )
Attributes
- id
The ID that identifies the analytics configuration.
- prefix
The prefix that an object must have to be included in the analytics results.
- storage_class_analysis
Contains data related to access patterns to be collected and made available to analyze the tradeoffs between different storage classes.
- tag_filters
The tags to use when evaluating an analytics filter.
The analytics only includes objects that meet the filter’s criteria. If no filter is specified, all of the contents of the bucket are included in the analysis.
BucketEncryptionProperty
- class CfnBucket.BucketEncryptionProperty(*, server_side_encryption_configuration)
Bases:
object
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).
For information about the Amazon S3 default encryption feature, see Amazon S3 Default Encryption for S3 Buckets in the Amazon S3 User Guide .
- Parameters:
server_side_encryption_configuration (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ServerSideEncryptionRuleProperty
,Dict
[str
,Any
]]]]) – Specifies the default server-side-encryption configuration.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 bucket_encryption_property = s3.CfnBucket.BucketEncryptionProperty( server_side_encryption_configuration=[s3.CfnBucket.ServerSideEncryptionRuleProperty( bucket_key_enabled=False, server_side_encryption_by_default=s3.CfnBucket.ServerSideEncryptionByDefaultProperty( sse_algorithm="sseAlgorithm", # the properties below are optional kms_master_key_id="kmsMasterKeyId" ) )] )
Attributes
- server_side_encryption_configuration
Specifies the default server-side-encryption configuration.
CorsConfigurationProperty
- class CfnBucket.CorsConfigurationProperty(*, cors_rules)
Bases:
object
Describes the cross-origin access configuration for objects in an Amazon S3 bucket.
For more information, see Enabling Cross-Origin Resource Sharing in the Amazon S3 User Guide .
- Parameters:
cors_rules (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,CorsRuleProperty
,Dict
[str
,Any
]]]]) – A set of origins and methods (cross-origin access that you want to allow). You can add up to 100 rules to the configuration.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 cors_configuration_property = s3.CfnBucket.CorsConfigurationProperty( cors_rules=[s3.CfnBucket.CorsRuleProperty( allowed_methods=["allowedMethods"], allowed_origins=["allowedOrigins"], # the properties below are optional allowed_headers=["allowedHeaders"], exposed_headers=["exposedHeaders"], id="id", max_age=123 )] )
Attributes
- cors_rules
A set of origins and methods (cross-origin access that you want to allow).
You can add up to 100 rules to the configuration.
CorsRuleProperty
- class CfnBucket.CorsRuleProperty(*, allowed_methods, allowed_origins, allowed_headers=None, exposed_headers=None, id=None, max_age=None)
Bases:
object
Specifies a cross-origin access rule for an Amazon S3 bucket.
- Parameters:
allowed_methods (
Sequence
[str
]) – An HTTP method that you allow the origin to run. Allowed values :GET
|PUT
|HEAD
|POST
|DELETE
allowed_origins (
Sequence
[str
]) – One or more origins you want customers to be able to access the bucket from.allowed_headers (
Optional
[Sequence
[str
]]) – Headers that are specified in theAccess-Control-Request-Headers
header. These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed.exposed_headers (
Optional
[Sequence
[str
]]) – One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScriptXMLHttpRequest
object).id (
Optional
[str
]) – A unique identifier for this rule. The value must be no more than 255 characters.max_age (
Union
[int
,float
,None
]) – The time in seconds that your browser is to cache the preflight response for the specified resource.
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-corsrule.html
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 cors_rule_property = s3.CfnBucket.CorsRuleProperty( allowed_methods=["allowedMethods"], allowed_origins=["allowedOrigins"], # the properties below are optional allowed_headers=["allowedHeaders"], exposed_headers=["exposedHeaders"], id="id", max_age=123 )
Attributes
- allowed_headers
Headers that are specified in the
Access-Control-Request-Headers
header.These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed.
- allowed_methods
An HTTP method that you allow the origin to run.
Allowed values :
GET
|PUT
|HEAD
|POST
|DELETE
- allowed_origins
One or more origins you want customers to be able to access the bucket from.
- exposed_headers
One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript
XMLHttpRequest
object).
- id
A unique identifier for this rule.
The value must be no more than 255 characters.
- max_age
The time in seconds that your browser is to cache the preflight response for the specified resource.
DataExportProperty
- class CfnBucket.DataExportProperty(*, destination, output_schema_version)
Bases:
object
Specifies how data related to the storage class analysis for an Amazon S3 bucket should be exported.
- Parameters:
destination (
Union
[IResolvable
,DestinationProperty
,Dict
[str
,Any
]]) – The place to store the data for an analysis.output_schema_version (
str
) – The version of the output schema to use when exporting data. Must beV_1
.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 data_export_property = s3.CfnBucket.DataExportProperty( destination=s3.CfnBucket.DestinationProperty( bucket_arn="bucketArn", format="format", # the properties below are optional bucket_account_id="bucketAccountId", prefix="prefix" ), output_schema_version="outputSchemaVersion" )
Attributes
- destination
The place to store the data for an analysis.
- output_schema_version
The version of the output schema to use when exporting data.
Must be
V_1
.
DefaultRetentionProperty
- class CfnBucket.DefaultRetentionProperty(*, days=None, mode=None, years=None)
Bases:
object
The container element for optionally specifying the default Object Lock retention settings for new objects placed in the specified bucket.
The
DefaultRetention
settings require both a mode and a period.The
DefaultRetention
period can be eitherDays
orYears
but you must select one. You cannot specifyDays
andYears
at the same time.
- Parameters:
days (
Union
[int
,float
,None
]) – The number of days that you want to specify for the default retention period. If Object Lock is turned on, you must specifyMode
and specify eitherDays
orYears
.mode (
Optional
[str
]) – The default Object Lock retention mode you want to apply to new objects placed in the specified bucket. If Object Lock is turned on, you must specifyMode
and specify eitherDays
orYears
.years (
Union
[int
,float
,None
]) – The number of years that you want to specify for the default retention period. If Object Lock is turned on, you must specifyMode
and specify eitherDays
orYears
.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 default_retention_property = s3.CfnBucket.DefaultRetentionProperty( days=123, mode="mode", years=123 )
Attributes
- days
The number of days that you want to specify for the default retention period.
If Object Lock is turned on, you must specify
Mode
and specify eitherDays
orYears
.
- mode
The default Object Lock retention mode you want to apply to new objects placed in the specified bucket.
If Object Lock is turned on, you must specify
Mode
and specify eitherDays
orYears
.
- years
The number of years that you want to specify for the default retention period.
If Object Lock is turned on, you must specify
Mode
and specify eitherDays
orYears
.
DeleteMarkerReplicationProperty
- class CfnBucket.DeleteMarkerReplicationProperty(*, status=None)
Bases:
object
Specifies whether Amazon S3 replicates delete markers.
If you specify a
Filter
in your replication configuration, you must also include aDeleteMarkerReplication
element. If yourFilter
includes aTag
element, theDeleteMarkerReplication
Status
must be set to Disabled, because Amazon S3 does not support replicating delete markers for tag-based rules. For an example configuration, see Basic Rule Configuration .For more information about delete marker replication, see Basic Rule Configuration . .. epigraph:
If you are using an earlier version of the replication configuration, Amazon S3 handles replication of delete markers differently. For more information, see `Backward Compatibility <https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations>`_ .
- Parameters:
status (
Optional
[str
]) – Indicates whether to replicate delete markers. Disabled by default.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 delete_marker_replication_property = s3.CfnBucket.DeleteMarkerReplicationProperty( status="status" )
Attributes
- status
Indicates whether to replicate delete markers.
Disabled by default.
DestinationProperty
- class CfnBucket.DestinationProperty(*, bucket_arn, format, bucket_account_id=None, prefix=None)
Bases:
object
Specifies information about where to publish analysis or configuration results for an Amazon S3 bucket.
- Parameters:
bucket_arn (
str
) – The Amazon Resource Name (ARN) of the bucket to which data is exported.format (
str
) – Specifies the file format used when exporting data to Amazon S3. Allowed values :CSV
|ORC
|Parquet
bucket_account_id (
Optional
[str
]) – The account ID that owns the destination S3 bucket. If no account ID is provided, the owner is not validated before exporting data. .. epigraph:: Although this value is optional, we strongly recommend that you set it to help prevent problems if the destination bucket ownership changes.prefix (
Optional
[str
]) – The prefix to use when exporting data. The prefix is prepended to all results.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 destination_property = s3.CfnBucket.DestinationProperty( bucket_arn="bucketArn", format="format", # the properties below are optional bucket_account_id="bucketAccountId", prefix="prefix" )
Attributes
- bucket_account_id
The account ID that owns the destination S3 bucket.
If no account ID is provided, the owner is not validated before exporting data. .. epigraph:
Although this value is optional, we strongly recommend that you set it to help prevent problems if the destination bucket ownership changes.
- bucket_arn
The Amazon Resource Name (ARN) of the bucket to which data is exported.
- format
Specifies the file format used when exporting data to Amazon S3.
Allowed values :
CSV
|ORC
|Parquet
- prefix
The prefix to use when exporting data.
The prefix is prepended to all results.
EncryptionConfigurationProperty
- class CfnBucket.EncryptionConfigurationProperty(*, replica_kms_key_id)
Bases:
object
Specifies encryption-related information for an Amazon S3 bucket that is a destination for replicated objects.
If you’re specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then AWS KMS resolves the key within the requester’s account. This behavior can result in data that’s encrypted with a KMS key that belongs to the requester, and not the bucket owner.
- Parameters:
replica_kms_key_id (
str
) – Specifies the ID (Key ARN or Alias ARN) of the customer managed AWS KMS key stored in AWS Key Management Service (KMS) for the destination bucket. Amazon S3 uses this key to encrypt replica objects. Amazon S3 only supports symmetric encryption KMS keys. For more information, see Asymmetric keys in AWS KMS in the AWS Key Management Service Developer Guide .- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 encryption_configuration_property = s3.CfnBucket.EncryptionConfigurationProperty( replica_kms_key_id="replicaKmsKeyId" )
Attributes
- replica_kms_key_id
Specifies the ID (Key ARN or Alias ARN) of the customer managed AWS KMS key stored in AWS Key Management Service (KMS) for the destination bucket.
Amazon S3 uses this key to encrypt replica objects. Amazon S3 only supports symmetric encryption KMS keys. For more information, see Asymmetric keys in AWS KMS in the AWS Key Management Service Developer Guide .
EventBridgeConfigurationProperty
- class CfnBucket.EventBridgeConfigurationProperty(*, event_bridge_enabled)
Bases:
object
Amazon S3 can send events to Amazon EventBridge whenever certain events happen in your bucket, see Using EventBridge in the Amazon S3 User Guide .
Unlike other destinations, delivery of events to EventBridge can be either enabled or disabled for a bucket. If enabled, all events will be sent to EventBridge and you can use EventBridge rules to route events to additional targets. For more information, see What Is Amazon EventBridge in the Amazon EventBridge User Guide
- Parameters:
event_bridge_enabled (
Union
[bool
,IResolvable
]) – Enables delivery of events to Amazon EventBridge.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 event_bridge_configuration_property = s3.CfnBucket.EventBridgeConfigurationProperty( event_bridge_enabled=False )
Attributes
- event_bridge_enabled
Enables delivery of events to Amazon EventBridge.
FilterRuleProperty
- class CfnBucket.FilterRuleProperty(*, name, value)
Bases:
object
Specifies the Amazon S3 object key name to filter on.
An object key name is the name assigned to an object in your Amazon S3 bucket. You specify whether to filter on the suffix or prefix of the object key name. A prefix is a specific string of characters at the beginning of an object key name, which you can use to organize objects. For example, you can start the key names of related objects with a prefix, such as
2023-
orengineering/
. Then, you can useFilterRule
to find objects in a bucket with key names that have the same prefix. A suffix is similar to a prefix, but it is at the end of the object key name instead of at the beginning.- Parameters:
name (
str
) – The object key name prefix or suffix identifying one or more objects to which the filtering rule applies. The maximum length is 1,024 characters. Overlapping prefixes and suffixes are not supported. For more information, see Configuring Event Notifications in the Amazon S3 User Guide .value (
str
) – The value that the filter searches for in object key names.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 filter_rule_property = s3.CfnBucket.FilterRuleProperty( name="name", value="value" )
Attributes
- name
The object key name prefix or suffix identifying one or more objects to which the filtering rule applies.
The maximum length is 1,024 characters. Overlapping prefixes and suffixes are not supported. For more information, see Configuring Event Notifications in the Amazon S3 User Guide .
- value
The value that the filter searches for in object key names.
IntelligentTieringConfigurationProperty
- class CfnBucket.IntelligentTieringConfigurationProperty(*, id, status, tierings, prefix=None, tag_filters=None)
Bases:
object
Specifies the S3 Intelligent-Tiering configuration for an Amazon S3 bucket.
For information about the S3 Intelligent-Tiering storage class, see Storage class for automatically optimizing frequently and infrequently accessed objects .
- Parameters:
id (
str
) – The ID used to identify the S3 Intelligent-Tiering configuration.status (
str
) – Specifies the status of the configuration.tierings (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,TieringProperty
,Dict
[str
,Any
]]]]) – Specifies a list of S3 Intelligent-Tiering storage class tiers in the configuration. At least one tier must be defined in the list. At most, you can specify two tiers in the list, one for each available AccessTier:ARCHIVE_ACCESS
andDEEP_ARCHIVE_ACCESS
. .. epigraph:: You only need Intelligent Tiering Configuration enabled on a bucket if you want to automatically move objects stored in the Intelligent-Tiering storage class to Archive Access or Deep Archive Access tiers.prefix (
Optional
[str
]) – An object key name prefix that identifies the subset of objects to which the rule applies.tag_filters (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,TagFilterProperty
,Dict
[str
,Any
]]],None
]) – A container for a key-value pair.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 intelligent_tiering_configuration_property = s3.CfnBucket.IntelligentTieringConfigurationProperty( id="id", status="status", tierings=[s3.CfnBucket.TieringProperty( access_tier="accessTier", days=123 )], # the properties below are optional prefix="prefix", tag_filters=[s3.CfnBucket.TagFilterProperty( key="key", value="value" )] )
Attributes
- id
The ID used to identify the S3 Intelligent-Tiering configuration.
- prefix
An object key name prefix that identifies the subset of objects to which the rule applies.
- status
Specifies the status of the configuration.
- tag_filters
A container for a key-value pair.
- tierings
Specifies a list of S3 Intelligent-Tiering storage class tiers in the configuration.
At least one tier must be defined in the list. At most, you can specify two tiers in the list, one for each available AccessTier:
ARCHIVE_ACCESS
andDEEP_ARCHIVE_ACCESS
. .. epigraph:You only need Intelligent Tiering Configuration enabled on a bucket if you want to automatically move objects stored in the Intelligent-Tiering storage class to Archive Access or Deep Archive Access tiers.
InventoryConfigurationProperty
- class CfnBucket.InventoryConfigurationProperty(*, destination, enabled, id, included_object_versions, schedule_frequency, optional_fields=None, prefix=None)
Bases:
object
Specifies the inventory configuration for an Amazon S3 bucket.
For more information, see GET Bucket inventory in the Amazon S3 API Reference .
- Parameters:
destination (
Union
[IResolvable
,DestinationProperty
,Dict
[str
,Any
]]) – Contains information about where to publish the inventory results.enabled (
Union
[bool
,IResolvable
]) – Specifies whether the inventory is enabled or disabled. If set toTrue
, an inventory list is generated. If set toFalse
, no inventory list is generated.id (
str
) – The ID used to identify the inventory configuration.included_object_versions (
str
) – Object versions to include in the inventory list. If set toAll
, the list includes all the object versions, which adds the version-related fieldsVersionId
,IsLatest
, andDeleteMarker
to the list. If set toCurrent
, the list does not contain these version-related fields.schedule_frequency (
str
) – Specifies the schedule for generating inventory results.optional_fields (
Optional
[Sequence
[str
]]) – Contains the optional fields that are included in the inventory results.prefix (
Optional
[str
]) – Specifies the inventory filter prefix.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 inventory_configuration_property = s3.CfnBucket.InventoryConfigurationProperty( destination=s3.CfnBucket.DestinationProperty( bucket_arn="bucketArn", format="format", # the properties below are optional bucket_account_id="bucketAccountId", prefix="prefix" ), enabled=False, id="id", included_object_versions="includedObjectVersions", schedule_frequency="scheduleFrequency", # the properties below are optional optional_fields=["optionalFields"], prefix="prefix" )
Attributes
- destination
Contains information about where to publish the inventory results.
- enabled
Specifies whether the inventory is enabled or disabled.
If set to
True
, an inventory list is generated. If set toFalse
, no inventory list is generated.
- id
The ID used to identify the inventory configuration.
- included_object_versions
Object versions to include in the inventory list.
If set to
All
, the list includes all the object versions, which adds the version-related fieldsVersionId
,IsLatest
, andDeleteMarker
to the list. If set toCurrent
, the list does not contain these version-related fields.
- optional_fields
Contains the optional fields that are included in the inventory results.
- prefix
Specifies the inventory filter prefix.
- schedule_frequency
Specifies the schedule for generating inventory results.
LambdaConfigurationProperty
- class CfnBucket.LambdaConfigurationProperty(*, event, function, filter=None)
Bases:
object
Describes the AWS Lambda functions to invoke and the events for which to invoke them.
- Parameters:
event (
str
) – The Amazon S3 bucket event for which to invoke the AWS Lambda function. For more information, see Supported Event Types in the Amazon S3 User Guide .function (
str
) – The Amazon Resource Name (ARN) of the AWS Lambda function that Amazon S3 invokes when the specified event type occurs.filter (
Union
[IResolvable
,NotificationFilterProperty
,Dict
[str
,Any
],None
]) – The filtering rules that determine which objects invoke the AWS Lambda function. For example, you can create a filter so that only image files with a.jpg
extension invoke the function when they are added to the Amazon S3 bucket.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 lambda_configuration_property = s3.CfnBucket.LambdaConfigurationProperty( event="event", function="function", # the properties below are optional filter=s3.CfnBucket.NotificationFilterProperty( s3_key=s3.CfnBucket.S3KeyFilterProperty( rules=[s3.CfnBucket.FilterRuleProperty( name="name", value="value" )] ) ) )
Attributes
- event
The Amazon S3 bucket event for which to invoke the AWS Lambda function.
For more information, see Supported Event Types in the Amazon S3 User Guide .
- filter
The filtering rules that determine which objects invoke the AWS Lambda function.
For example, you can create a filter so that only image files with a
.jpg
extension invoke the function when they are added to the Amazon S3 bucket.
- function
The Amazon Resource Name (ARN) of the AWS Lambda function that Amazon S3 invokes when the specified event type occurs.
LifecycleConfigurationProperty
- class CfnBucket.LifecycleConfigurationProperty(*, rules, transition_default_minimum_object_size=None)
Bases:
object
Specifies the lifecycle configuration for objects in an Amazon S3 bucket.
For more information, see Object Lifecycle Management in the Amazon S3 User Guide .
- Parameters:
rules (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,RuleProperty
,Dict
[str
,Any
]]]]) – A lifecycle rule for individual objects in an Amazon S3 bucket.transition_default_minimum_object_size (
Optional
[str
]) –
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 lifecycle_configuration_property = s3.CfnBucket.LifecycleConfigurationProperty( rules=[s3.CfnBucket.RuleProperty( status="status", # the properties below are optional abort_incomplete_multipart_upload=s3.CfnBucket.AbortIncompleteMultipartUploadProperty( days_after_initiation=123 ), expiration_date=Date(), expiration_in_days=123, expired_object_delete_marker=False, id="id", noncurrent_version_expiration=s3.CfnBucket.NoncurrentVersionExpirationProperty( noncurrent_days=123, # the properties below are optional newer_noncurrent_versions=123 ), noncurrent_version_expiration_in_days=123, noncurrent_version_transition=s3.CfnBucket.NoncurrentVersionTransitionProperty( storage_class="storageClass", transition_in_days=123, # the properties below are optional newer_noncurrent_versions=123 ), noncurrent_version_transitions=[s3.CfnBucket.NoncurrentVersionTransitionProperty( storage_class="storageClass", transition_in_days=123, # the properties below are optional newer_noncurrent_versions=123 )], object_size_greater_than=123, object_size_less_than=123, prefix="prefix", tag_filters=[s3.CfnBucket.TagFilterProperty( key="key", value="value" )], transition=s3.CfnBucket.TransitionProperty( storage_class="storageClass", # the properties below are optional transition_date=Date(), transition_in_days=123 ), transitions=[s3.CfnBucket.TransitionProperty( storage_class="storageClass", # the properties below are optional transition_date=Date(), transition_in_days=123 )] )], # the properties below are optional transition_default_minimum_object_size="transitionDefaultMinimumObjectSize" )
Attributes
- rules
A lifecycle rule for individual objects in an Amazon S3 bucket.
- transition_default_minimum_object_size
-
- Type:
see
LoggingConfigurationProperty
- class CfnBucket.LoggingConfigurationProperty(*, destination_bucket_name=None, log_file_prefix=None, target_object_key_format=None)
Bases:
object
Describes where logs are stored and the prefix that Amazon S3 assigns to all log object keys for a bucket.
For examples and more information, see PUT Bucket logging in the Amazon S3 API Reference . .. epigraph:
To successfully complete the ``AWS::S3::Bucket LoggingConfiguration`` request, you must have ``s3:PutObject`` and ``s3:PutObjectAcl`` in your IAM permissions.
- Parameters:
destination_bucket_name (
Optional
[str
]) – The name of the bucket where Amazon S3 should store server access log files. You can store log files in any bucket that you own. By default, logs are stored in the bucket where theLoggingConfiguration
property is defined.log_file_prefix (
Optional
[str
]) – A prefix for all log object keys. If you store log files from multiple Amazon S3 buckets in a single bucket, you can use a prefix to distinguish which log files came from which bucket.target_object_key_format (
Union
[IResolvable
,TargetObjectKeyFormatProperty
,Dict
[str
,Any
],None
]) – Amazon S3 key format for log objects. Only one format, either PartitionedPrefix or SimplePrefix, is allowed.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 # simple_prefix: Any logging_configuration_property = s3.CfnBucket.LoggingConfigurationProperty( destination_bucket_name="destinationBucketName", log_file_prefix="logFilePrefix", target_object_key_format=s3.CfnBucket.TargetObjectKeyFormatProperty( partitioned_prefix=s3.CfnBucket.PartitionedPrefixProperty( partition_date_source="partitionDateSource" ), simple_prefix=simple_prefix ) )
Attributes
- destination_bucket_name
The name of the bucket where Amazon S3 should store server access log files.
You can store log files in any bucket that you own. By default, logs are stored in the bucket where the
LoggingConfiguration
property is defined.
- log_file_prefix
A prefix for all log object keys.
If you store log files from multiple Amazon S3 buckets in a single bucket, you can use a prefix to distinguish which log files came from which bucket.
- target_object_key_format
Amazon S3 key format for log objects.
Only one format, either PartitionedPrefix or SimplePrefix, is allowed.
MetricsConfigurationProperty
- class CfnBucket.MetricsConfigurationProperty(*, id, access_point_arn=None, prefix=None, tag_filters=None)
Bases:
object
Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket.
If you’re updating an existing metrics configuration, note that this is a full replacement of the existing metrics configuration. If you don’t include the elements you want to keep, they are erased. For examples, see AWS::S3::Bucket . For more information, see PUT Bucket metrics in the Amazon S3 API Reference .
- Parameters:
id (
str
) – The ID used to identify the metrics configuration. This can be any value you choose that helps you identify your metrics configuration.access_point_arn (
Optional
[str
]) – The access point that was used while performing operations on the object. The metrics configuration only includes objects that meet the filter’s criteria.prefix (
Optional
[str
]) – The prefix that an object must have to be included in the metrics results.tag_filters (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,TagFilterProperty
,Dict
[str
,Any
]]],None
]) – Specifies a list of tag filters to use as a metrics configuration filter. The metrics configuration includes only objects that meet the filter’s criteria.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 metrics_configuration_property = s3.CfnBucket.MetricsConfigurationProperty( id="id", # the properties below are optional access_point_arn="accessPointArn", prefix="prefix", tag_filters=[s3.CfnBucket.TagFilterProperty( key="key", value="value" )] )
Attributes
- access_point_arn
The access point that was used while performing operations on the object.
The metrics configuration only includes objects that meet the filter’s criteria.
- id
The ID used to identify the metrics configuration.
This can be any value you choose that helps you identify your metrics configuration.
- prefix
The prefix that an object must have to be included in the metrics results.
- tag_filters
Specifies a list of tag filters to use as a metrics configuration filter.
The metrics configuration includes only objects that meet the filter’s criteria.
MetricsProperty
- class CfnBucket.MetricsProperty(*, status, event_threshold=None)
Bases:
object
A container specifying replication metrics-related settings enabling replication metrics and events.
- Parameters:
status (
str
) – Specifies whether the replication metrics are enabled.event_threshold (
Union
[IResolvable
,ReplicationTimeValueProperty
,Dict
[str
,Any
],None
]) – A container specifying the time threshold for emitting thes3:Replication:OperationMissedThreshold
event.
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metrics.html
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 metrics_property = s3.CfnBucket.MetricsProperty( status="status", # the properties below are optional event_threshold=s3.CfnBucket.ReplicationTimeValueProperty( minutes=123 ) )
Attributes
- event_threshold
A container specifying the time threshold for emitting the
s3:Replication:OperationMissedThreshold
event.
- status
Specifies whether the replication metrics are enabled.
NoncurrentVersionExpirationProperty
- class CfnBucket.NoncurrentVersionExpirationProperty(*, noncurrent_days, newer_noncurrent_versions=None)
Bases:
object
Specifies when noncurrent object versions expire.
Upon expiration, Amazon S3 permanently deletes the noncurrent object versions. You set this lifecycle configuration action on a bucket that has versioning enabled (or suspended) to request that Amazon S3 delete noncurrent object versions at a specific period in the object’s lifetime. For more information about setting a lifecycle rule configuration, see AWS::S3::Bucket Rule .
- Parameters:
noncurrent_days (
Union
[int
,float
]) – Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. For information about the noncurrent days calculations, see How Amazon S3 Calculates When an Object Became Noncurrent in the Amazon S3 User Guide .newer_noncurrent_versions (
Union
[int
,float
,None
]) – Specifies how many noncurrent versions Amazon S3 will retain. If there are this many more recent noncurrent versions, Amazon S3 will take the associated action. For more information about noncurrent versions, see Lifecycle configuration elements in the Amazon S3 User Guide .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 noncurrent_version_expiration_property = s3.CfnBucket.NoncurrentVersionExpirationProperty( noncurrent_days=123, # the properties below are optional newer_noncurrent_versions=123 )
Attributes
- newer_noncurrent_versions
Specifies how many noncurrent versions Amazon S3 will retain.
If there are this many more recent noncurrent versions, Amazon S3 will take the associated action. For more information about noncurrent versions, see Lifecycle configuration elements in the Amazon S3 User Guide .
- noncurrent_days
Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action.
For information about the noncurrent days calculations, see How Amazon S3 Calculates When an Object Became Noncurrent in the Amazon S3 User Guide .
NoncurrentVersionTransitionProperty
- class CfnBucket.NoncurrentVersionTransitionProperty(*, storage_class, transition_in_days, newer_noncurrent_versions=None)
Bases:
object
Container for the transition rule that describes when noncurrent objects transition to the
STANDARD_IA
,ONEZONE_IA
,INTELLIGENT_TIERING
,GLACIER_IR
,GLACIER
, orDEEP_ARCHIVE
storage class.If your bucket is versioning-enabled (or versioning is suspended), you can set this action to request that Amazon S3 transition noncurrent object versions to the
STANDARD_IA
,ONEZONE_IA
,INTELLIGENT_TIERING
,GLACIER_IR
,GLACIER
, orDEEP_ARCHIVE
storage class at a specific period in the object’s lifetime. If you specify this property, don’t specify theNoncurrentVersionTransitions
property.- Parameters:
storage_class (
str
) – The class of storage used to store the object.transition_in_days (
Union
[int
,float
]) – Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. For information about the noncurrent days calculations, see How Amazon S3 Calculates How Long an Object Has Been Noncurrent in the Amazon S3 User Guide .newer_noncurrent_versions (
Union
[int
,float
,None
]) –Specifies how many noncurrent versions Amazon S3 will retain. If there are this many more recent noncurrent versions, Amazon S3 will take the associated action. For more information about noncurrent versions, see Lifecycle configuration elements in the Amazon S3 User Guide .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 noncurrent_version_transition_property = s3.CfnBucket.NoncurrentVersionTransitionProperty( storage_class="storageClass", transition_in_days=123, # the properties below are optional newer_noncurrent_versions=123 )
Attributes
- newer_noncurrent_versions
Specifies how many noncurrent versions Amazon S3 will retain.
If there are this many more recent noncurrent versions, Amazon S3 will take the associated action. For more information about noncurrent versions, see Lifecycle configuration elements in the Amazon S3 User Guide .
- storage_class
The class of storage used to store the object.
- transition_in_days
Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action.
For information about the noncurrent days calculations, see How Amazon S3 Calculates How Long an Object Has Been Noncurrent in the Amazon S3 User Guide .
NotificationConfigurationProperty
- class CfnBucket.NotificationConfigurationProperty(*, event_bridge_configuration=None, lambda_configurations=None, queue_configurations=None, topic_configurations=None)
Bases:
object
Describes the notification configuration for an Amazon S3 bucket.
If you create the target resource and related permissions in the same template, you might have a circular dependency.
For example, you might use the
AWS::Lambda::Permission
resource to grant the bucket permission to invoke an AWS Lambda function. However, AWS CloudFormation can’t create the bucket until the bucket has permission to invoke the function ( AWS CloudFormation checks whether the bucket can invoke the function). If you’re using Refs to pass the bucket name, this leads to a circular dependency.To avoid this dependency, you can create all resources without specifying the notification configuration. Then, update the stack with a notification configuration.
For more information on permissions, see AWS::Lambda::Permission and Granting Permissions to Publish Event Notification Messages to a Destination .
- Parameters:
event_bridge_configuration (
Union
[IResolvable
,EventBridgeConfigurationProperty
,Dict
[str
,Any
],None
]) – Enables delivery of events to Amazon EventBridge.lambda_configurations (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,LambdaConfigurationProperty
,Dict
[str
,Any
]]],None
]) – Describes the AWS Lambda functions to invoke and the events for which to invoke them.queue_configurations (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,QueueConfigurationProperty
,Dict
[str
,Any
]]],None
]) – The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages.topic_configurations (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,TopicConfigurationProperty
,Dict
[str
,Any
]]],None
]) – The topic to which notifications are sent and the events for which notifications are generated.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 notification_configuration_property = s3.CfnBucket.NotificationConfigurationProperty( event_bridge_configuration=s3.CfnBucket.EventBridgeConfigurationProperty( event_bridge_enabled=False ), lambda_configurations=[s3.CfnBucket.LambdaConfigurationProperty( event="event", function="function", # the properties below are optional filter=s3.CfnBucket.NotificationFilterProperty( s3_key=s3.CfnBucket.S3KeyFilterProperty( rules=[s3.CfnBucket.FilterRuleProperty( name="name", value="value" )] ) ) )], queue_configurations=[s3.CfnBucket.QueueConfigurationProperty( event="event", queue="queue", # the properties below are optional filter=s3.CfnBucket.NotificationFilterProperty( s3_key=s3.CfnBucket.S3KeyFilterProperty( rules=[s3.CfnBucket.FilterRuleProperty( name="name", value="value" )] ) ) )], topic_configurations=[s3.CfnBucket.TopicConfigurationProperty( event="event", topic="topic", # the properties below are optional filter=s3.CfnBucket.NotificationFilterProperty( s3_key=s3.CfnBucket.S3KeyFilterProperty( rules=[s3.CfnBucket.FilterRuleProperty( name="name", value="value" )] ) ) )] )
Attributes
- event_bridge_configuration
Enables delivery of events to Amazon EventBridge.
- lambda_configurations
Describes the AWS Lambda functions to invoke and the events for which to invoke them.
- queue_configurations
The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages.
- topic_configurations
The topic to which notifications are sent and the events for which notifications are generated.
NotificationFilterProperty
- class CfnBucket.NotificationFilterProperty(*, s3_key)
Bases:
object
Specifies object key name filtering rules.
For information about key name filtering, see Configuring event notifications using object key name filtering in the Amazon S3 User Guide .
- Parameters:
s3_key (
Union
[IResolvable
,S3KeyFilterProperty
,Dict
[str
,Any
]]) – A container for object key name prefix and suffix filtering rules.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 notification_filter_property = s3.CfnBucket.NotificationFilterProperty( s3_key=s3.CfnBucket.S3KeyFilterProperty( rules=[s3.CfnBucket.FilterRuleProperty( name="name", value="value" )] ) )
Attributes
- s3_key
A container for object key name prefix and suffix filtering rules.
ObjectLockConfigurationProperty
- class CfnBucket.ObjectLockConfigurationProperty(*, object_lock_enabled=None, rule=None)
Bases:
object
Places an Object Lock configuration on the specified bucket.
The rule specified in the Object Lock configuration will be applied by default to every new object placed in the specified bucket. For more information, see Locking Objects .
- Parameters:
object_lock_enabled (
Optional
[str
]) – Indicates whether this bucket has an Object Lock configuration enabled. EnableObjectLockEnabled
when you applyObjectLockConfiguration
to a bucket.rule (
Union
[IResolvable
,ObjectLockRuleProperty
,Dict
[str
,Any
],None
]) – Specifies the Object Lock rule for the specified object. Enable this rule when you applyObjectLockConfiguration
to a bucket. If Object Lock is turned on, bucket settings require bothMode
and a period of eitherDays
orYears
. You cannot specifyDays
andYears
at the same time. For more information, see ObjectLockRule and DefaultRetention .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 object_lock_configuration_property = s3.CfnBucket.ObjectLockConfigurationProperty( object_lock_enabled="objectLockEnabled", rule=s3.CfnBucket.ObjectLockRuleProperty( default_retention=s3.CfnBucket.DefaultRetentionProperty( days=123, mode="mode", years=123 ) ) )
Attributes
- object_lock_enabled
Indicates whether this bucket has an Object Lock configuration enabled.
Enable
ObjectLockEnabled
when you applyObjectLockConfiguration
to a bucket.
- rule
Specifies the Object Lock rule for the specified object.
Enable this rule when you apply
ObjectLockConfiguration
to a bucket. If Object Lock is turned on, bucket settings require bothMode
and a period of eitherDays
orYears
. You cannot specifyDays
andYears
at the same time. For more information, see ObjectLockRule and DefaultRetention .
ObjectLockRuleProperty
- class CfnBucket.ObjectLockRuleProperty(*, default_retention=None)
Bases:
object
Specifies the Object Lock rule for the specified object.
Enable the this rule when you apply
ObjectLockConfiguration
to a bucket.- Parameters:
default_retention (
Union
[IResolvable
,DefaultRetentionProperty
,Dict
[str
,Any
],None
]) –The default Object Lock retention mode and period that you want to apply to new objects placed in the specified bucket. If Object Lock is turned on, bucket settings require both
Mode
and a period of eitherDays
orYears
. You cannot specifyDays
andYears
at the same time. For more information about allowable values for mode and period, see DefaultRetention .- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 object_lock_rule_property = s3.CfnBucket.ObjectLockRuleProperty( default_retention=s3.CfnBucket.DefaultRetentionProperty( days=123, mode="mode", years=123 ) )
Attributes
- default_retention
The default Object Lock retention mode and period that you want to apply to new objects placed in the specified bucket.
If Object Lock is turned on, bucket settings require both
Mode
and a period of eitherDays
orYears
. You cannot specifyDays
andYears
at the same time. For more information about allowable values for mode and period, see DefaultRetention .
OwnershipControlsProperty
- class CfnBucket.OwnershipControlsProperty(*, rules)
Bases:
object
Specifies the container element for Object Ownership rules.
S3 Object Ownership is an Amazon S3 bucket-level setting that you can use to disable access control lists (ACLs) and take ownership of every object in your bucket, simplifying access management for data stored in Amazon S3. For more information, see Controlling ownership of objects and disabling ACLs in the Amazon S3 User Guide .
- Parameters:
rules (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,OwnershipControlsRuleProperty
,Dict
[str
,Any
]]]]) – Specifies the container element for Object Ownership rules.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 ownership_controls_property = s3.CfnBucket.OwnershipControlsProperty( rules=[s3.CfnBucket.OwnershipControlsRuleProperty( object_ownership="objectOwnership" )] )
Attributes
- rules
Specifies the container element for Object Ownership rules.
OwnershipControlsRuleProperty
- class CfnBucket.OwnershipControlsRuleProperty(*, object_ownership=None)
Bases:
object
Specifies an Object Ownership rule.
S3 Object Ownership is an Amazon S3 bucket-level setting that you can use to disable access control lists (ACLs) and take ownership of every object in your bucket, simplifying access management for data stored in Amazon S3. For more information, see Controlling ownership of objects and disabling ACLs in the Amazon S3 User Guide .
- Parameters:
object_ownership (
Optional
[str
]) – Specifies an object ownership rule.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 ownership_controls_rule_property = s3.CfnBucket.OwnershipControlsRuleProperty( object_ownership="objectOwnership" )
Attributes
- object_ownership
Specifies an object ownership rule.
PartitionedPrefixProperty
- class CfnBucket.PartitionedPrefixProperty(*, partition_date_source=None)
Bases:
object
Amazon S3 keys for log objects are partitioned in the following format:.
[DestinationPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]
PartitionedPrefix defaults to EventTime delivery when server access logs are delivered.
- Parameters:
partition_date_source (
Optional
[str
]) – Specifies the partition date source for the partitioned prefix.PartitionDateSource
can beEventTime
orDeliveryTime
. ForDeliveryTime
, the time in the log file names corresponds to the delivery time for the log files. ForEventTime
, The logs delivered are for a specific day only. The year, month, and day correspond to the day on which the event occurred, and the hour, minutes and seconds are set to 00 in the key.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 partitioned_prefix_property = s3.CfnBucket.PartitionedPrefixProperty( partition_date_source="partitionDateSource" )
Attributes
- partition_date_source
Specifies the partition date source for the partitioned prefix.
PartitionDateSource
can beEventTime
orDeliveryTime
.For
DeliveryTime
, the time in the log file names corresponds to the delivery time for the log files.For
EventTime
, The logs delivered are for a specific day only. The year, month, and day correspond to the day on which the event occurred, and the hour, minutes and seconds are set to 00 in the key.
PublicAccessBlockConfigurationProperty
- class CfnBucket.PublicAccessBlockConfigurationProperty(*, block_public_acls=None, block_public_policy=None, ignore_public_acls=None, restrict_public_buckets=None)
Bases:
object
The PublicAccessBlock configuration that you want to apply to this Amazon S3 bucket.
You can enable the configuration options in any combination. For more information about when Amazon S3 considers a bucket or object public, see The Meaning of “Public” in the Amazon S3 User Guide .
- Parameters:
block_public_acls (
Union
[bool
,IResolvable
,None
]) – Specifies whether Amazon S3 should block public access control lists (ACLs) for this bucket and objects in this bucket. Setting this element toTRUE
causes the following behavior: - PUT Bucket ACL and PUT Object ACL calls fail if the specified ACL is public. - PUT Object calls fail if the request includes a public ACL. - PUT Bucket calls fail if the request includes a public ACL. Enabling this setting doesn’t affect existing policies or ACLs.block_public_policy (
Union
[bool
,IResolvable
,None
]) – Specifies whether Amazon S3 should block public bucket policies for this bucket. Setting this element toTRUE
causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access. Enabling this setting doesn’t affect existing bucket policies.ignore_public_acls (
Union
[bool
,IResolvable
,None
]) – Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket. Setting this element toTRUE
causes Amazon S3 to ignore all public ACLs on this bucket and objects in this bucket. Enabling this setting doesn’t affect the persistence of any existing ACLs and doesn’t prevent new public ACLs from being set.restrict_public_buckets (
Union
[bool
,IResolvable
,None
]) – Specifies whether Amazon S3 should restrict public bucket policies for this bucket. Setting this element toTRUE
restricts access to this bucket to only AWS service principals and authorized users within this account if the bucket has a public policy. Enabling this setting doesn’t affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non-public delegation to specific accounts, is blocked.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 public_access_block_configuration_property = s3.CfnBucket.PublicAccessBlockConfigurationProperty( block_public_acls=False, block_public_policy=False, ignore_public_acls=False, restrict_public_buckets=False )
Attributes
- block_public_acls
Specifies whether Amazon S3 should block public access control lists (ACLs) for this bucket and objects in this bucket.
Setting this element to
TRUE
causes the following behavior:PUT Bucket ACL and PUT Object ACL calls fail if the specified ACL is public.
PUT Object calls fail if the request includes a public ACL.
PUT Bucket calls fail if the request includes a public ACL.
Enabling this setting doesn’t affect existing policies or ACLs.
- block_public_policy
Specifies whether Amazon S3 should block public bucket policies for this bucket.
Setting this element to
TRUE
causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access.Enabling this setting doesn’t affect existing bucket policies.
- ignore_public_acls
Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket.
Setting this element to
TRUE
causes Amazon S3 to ignore all public ACLs on this bucket and objects in this bucket.Enabling this setting doesn’t affect the persistence of any existing ACLs and doesn’t prevent new public ACLs from being set.
- restrict_public_buckets
Specifies whether Amazon S3 should restrict public bucket policies for this bucket.
Setting this element to
TRUE
restricts access to this bucket to only AWS service principals and authorized users within this account if the bucket has a public policy.Enabling this setting doesn’t affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non-public delegation to specific accounts, is blocked.
QueueConfigurationProperty
- class CfnBucket.QueueConfigurationProperty(*, event, queue, filter=None)
Bases:
object
Specifies the configuration for publishing messages to an Amazon Simple Queue Service (Amazon SQS) queue when Amazon S3 detects specified events.
- Parameters:
event (
str
) –The Amazon S3 bucket event about which you want to publish messages to Amazon SQS. For more information, see Supported Event Types in the Amazon S3 User Guide .
queue (
str
) – The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 publishes a message when it detects events of the specified type. FIFO queues are not allowed when enabling an SQS queue as the event notification destination.filter (
Union
[IResolvable
,NotificationFilterProperty
,Dict
[str
,Any
],None
]) –The filtering rules that determine which objects trigger notifications. For example, you can create a filter so that Amazon S3 sends notifications only when image files with a
.jpg
extension are added to the bucket. For more information, see Configuring event notifications using object key name filtering in the Amazon S3 User Guide .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 queue_configuration_property = s3.CfnBucket.QueueConfigurationProperty( event="event", queue="queue", # the properties below are optional filter=s3.CfnBucket.NotificationFilterProperty( s3_key=s3.CfnBucket.S3KeyFilterProperty( rules=[s3.CfnBucket.FilterRuleProperty( name="name", value="value" )] ) ) )
Attributes
- event
The Amazon S3 bucket event about which you want to publish messages to Amazon SQS.
For more information, see Supported Event Types in the Amazon S3 User Guide .
- filter
The filtering rules that determine which objects trigger notifications.
For example, you can create a filter so that Amazon S3 sends notifications only when image files with a
.jpg
extension are added to the bucket. For more information, see Configuring event notifications using object key name filtering in the Amazon S3 User Guide .
- queue
The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 publishes a message when it detects events of the specified type.
FIFO queues are not allowed when enabling an SQS queue as the event notification destination.
RedirectAllRequestsToProperty
- class CfnBucket.RedirectAllRequestsToProperty(*, host_name, protocol=None)
Bases:
object
Specifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket.
- Parameters:
host_name (
str
) – Name of the host where requests are redirected.protocol (
Optional
[str
]) – Protocol to use when redirecting requests. The default is the protocol that is used in the original request.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 redirect_all_requests_to_property = s3.CfnBucket.RedirectAllRequestsToProperty( host_name="hostName", # the properties below are optional protocol="protocol" )
Attributes
- host_name
Name of the host where requests are redirected.
- protocol
Protocol to use when redirecting requests.
The default is the protocol that is used in the original request.
RedirectRuleProperty
- class CfnBucket.RedirectRuleProperty(*, host_name=None, http_redirect_code=None, protocol=None, replace_key_prefix_with=None, replace_key_with=None)
Bases:
object
Specifies how requests are redirected.
In the event of an error, you can specify a different error code to return.
- Parameters:
host_name (
Optional
[str
]) – The host name to use in the redirect request.http_redirect_code (
Optional
[str
]) – The HTTP redirect code to use on the response. Not required if one of the siblings is present.protocol (
Optional
[str
]) – Protocol to use when redirecting requests. The default is the protocol that is used in the original request.replace_key_prefix_with (
Optional
[str
]) – The object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefixdocs/
(objects in thedocs/
folder) todocuments/
, you can set a condition block withKeyPrefixEquals
set todocs/
and in the Redirect setReplaceKeyPrefixWith
to/documents
. Not required if one of the siblings is present. Can be present only ifReplaceKeyWith
is not provided. .. epigraph:: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints .replace_key_with (
Optional
[str
]) –The specific object key to use in the redirect request. For example, redirect request to
error.html
. Not required if one of the siblings is present. Can be present only ifReplaceKeyPrefixWith
is not provided. .. epigraph:: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 redirect_rule_property = s3.CfnBucket.RedirectRuleProperty( host_name="hostName", http_redirect_code="httpRedirectCode", protocol="protocol", replace_key_prefix_with="replaceKeyPrefixWith", replace_key_with="replaceKeyWith" )
Attributes
- host_name
The host name to use in the redirect request.
- http_redirect_code
The HTTP redirect code to use on the response.
Not required if one of the siblings is present.
- protocol
Protocol to use when redirecting requests.
The default is the protocol that is used in the original request.
- replace_key_prefix_with
The object key prefix to use in the redirect request.
For example, to redirect requests for all pages with prefix
docs/
(objects in thedocs/
folder) todocuments/
, you can set a condition block withKeyPrefixEquals
set todocs/
and in the Redirect setReplaceKeyPrefixWith
to/documents
. Not required if one of the siblings is present. Can be present only ifReplaceKeyWith
is not provided. .. epigraph:Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see `XML related object key constraints <https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints>`_ .
- replace_key_with
The specific object key to use in the redirect request.
For example, redirect request to
error.html
. Not required if one of the siblings is present. Can be present only ifReplaceKeyPrefixWith
is not provided. .. epigraph:Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see `XML related object key constraints <https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints>`_ .
ReplicaModificationsProperty
- class CfnBucket.ReplicaModificationsProperty(*, status)
Bases:
object
A filter that you can specify for selection for modifications on replicas.
- Parameters:
status (
str
) – Specifies whether Amazon S3 replicates modifications on replicas. Allowed values :Enabled
|Disabled
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 replica_modifications_property = s3.CfnBucket.ReplicaModificationsProperty( status="status" )
Attributes
- status
Specifies whether Amazon S3 replicates modifications on replicas.
Allowed values :
Enabled
|Disabled
ReplicationConfigurationProperty
- class CfnBucket.ReplicationConfigurationProperty(*, role, rules)
Bases:
object
A container for replication rules.
You can add up to 1,000 rules. The maximum size of a replication configuration is 2 MB. The latest version of the replication configuration XML is V2. For more information about XML V2 replication configurations, see Replication configuration in the Amazon S3 User Guide .
- Parameters:
role (
str
) – The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that Amazon S3 assumes when replicating objects. For more information, see How to Set Up Replication in the Amazon S3 User Guide .rules (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ReplicationRuleProperty
,Dict
[str
,Any
]]]]) – A container for one or more replication rules. A replication configuration must have at least one rule and can contain a maximum of 1,000 rules.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 replication_configuration_property = s3.CfnBucket.ReplicationConfigurationProperty( role="role", rules=[s3.CfnBucket.ReplicationRuleProperty( destination=s3.CfnBucket.ReplicationDestinationProperty( bucket="bucket", # the properties below are optional access_control_translation=s3.CfnBucket.AccessControlTranslationProperty( owner="owner" ), account="account", encryption_configuration=s3.CfnBucket.EncryptionConfigurationProperty( replica_kms_key_id="replicaKmsKeyId" ), metrics=s3.CfnBucket.MetricsProperty( status="status", # the properties below are optional event_threshold=s3.CfnBucket.ReplicationTimeValueProperty( minutes=123 ) ), replication_time=s3.CfnBucket.ReplicationTimeProperty( status="status", time=s3.CfnBucket.ReplicationTimeValueProperty( minutes=123 ) ), storage_class="storageClass" ), status="status", # the properties below are optional delete_marker_replication=s3.CfnBucket.DeleteMarkerReplicationProperty( status="status" ), filter=s3.CfnBucket.ReplicationRuleFilterProperty( and=s3.CfnBucket.ReplicationRuleAndOperatorProperty( prefix="prefix", tag_filters=[s3.CfnBucket.TagFilterProperty( key="key", value="value" )] ), prefix="prefix", tag_filter=s3.CfnBucket.TagFilterProperty( key="key", value="value" ) ), id="id", prefix="prefix", priority=123, source_selection_criteria=s3.CfnBucket.SourceSelectionCriteriaProperty( replica_modifications=s3.CfnBucket.ReplicaModificationsProperty( status="status" ), sse_kms_encrypted_objects=s3.CfnBucket.SseKmsEncryptedObjectsProperty( status="status" ) ) )] )
Attributes
- role
The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that Amazon S3 assumes when replicating objects.
For more information, see How to Set Up Replication in the Amazon S3 User Guide .
- rules
A container for one or more replication rules.
A replication configuration must have at least one rule and can contain a maximum of 1,000 rules.
ReplicationDestinationProperty
- class CfnBucket.ReplicationDestinationProperty(*, bucket, access_control_translation=None, account=None, encryption_configuration=None, metrics=None, replication_time=None, storage_class=None)
Bases:
object
A container for information about the replication destination and its configurations including enabling the S3 Replication Time Control (S3 RTC).
- Parameters:
bucket (
str
) – The Amazon Resource Name (ARN) of the bucket where you want Amazon S3 to store the results.access_control_translation (
Union
[IResolvable
,AccessControlTranslationProperty
,Dict
[str
,Any
],None
]) – Specify this only in a cross-account scenario (where source and destination bucket owners are not the same), and you want to change replica ownership to the AWS account that owns the destination bucket. If this is not specified in the replication configuration, the replicas are owned by same AWS account that owns the source object.account (
Optional
[str
]) – Destination bucket owner account ID. In a cross-account scenario, if you direct Amazon S3 to change replica ownership to the AWS account that owns the destination bucket by specifying theAccessControlTranslation
property, this is the account ID of the destination bucket owner. For more information, see Cross-Region Replication Additional Configuration: Change Replica Owner in the Amazon S3 User Guide . If you specify theAccessControlTranslation
property, theAccount
property is required.encryption_configuration (
Union
[IResolvable
,EncryptionConfigurationProperty
,Dict
[str
,Any
],None
]) – Specifies encryption-related information.metrics (
Union
[IResolvable
,MetricsProperty
,Dict
[str
,Any
],None
]) – A container specifying replication metrics-related settings enabling replication metrics and events.replication_time (
Union
[IResolvable
,ReplicationTimeProperty
,Dict
[str
,Any
],None
]) – A container specifying S3 Replication Time Control (S3 RTC), including whether S3 RTC is enabled and the time when all objects and operations on objects must be replicated. Must be specified together with aMetrics
block.storage_class (
Optional
[str
]) –The storage class to use when replicating objects, such as S3 Standard or reduced redundancy. By default, Amazon S3 uses the storage class of the source object to create the object replica. For valid values, see the
StorageClass
element of the PUT Bucket replication action in the Amazon S3 API Reference .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 replication_destination_property = s3.CfnBucket.ReplicationDestinationProperty( bucket="bucket", # the properties below are optional access_control_translation=s3.CfnBucket.AccessControlTranslationProperty( owner="owner" ), account="account", encryption_configuration=s3.CfnBucket.EncryptionConfigurationProperty( replica_kms_key_id="replicaKmsKeyId" ), metrics=s3.CfnBucket.MetricsProperty( status="status", # the properties below are optional event_threshold=s3.CfnBucket.ReplicationTimeValueProperty( minutes=123 ) ), replication_time=s3.CfnBucket.ReplicationTimeProperty( status="status", time=s3.CfnBucket.ReplicationTimeValueProperty( minutes=123 ) ), storage_class="storageClass" )
Attributes
- access_control_translation
Specify this only in a cross-account scenario (where source and destination bucket owners are not the same), and you want to change replica ownership to the AWS account that owns the destination bucket.
If this is not specified in the replication configuration, the replicas are owned by same AWS account that owns the source object.
- account
Destination bucket owner account ID.
In a cross-account scenario, if you direct Amazon S3 to change replica ownership to the AWS account that owns the destination bucket by specifying the
AccessControlTranslation
property, this is the account ID of the destination bucket owner. For more information, see Cross-Region Replication Additional Configuration: Change Replica Owner in the Amazon S3 User Guide .If you specify the
AccessControlTranslation
property, theAccount
property is required.
- bucket
The Amazon Resource Name (ARN) of the bucket where you want Amazon S3 to store the results.
- encryption_configuration
Specifies encryption-related information.
- metrics
A container specifying replication metrics-related settings enabling replication metrics and events.
- replication_time
A container specifying S3 Replication Time Control (S3 RTC), including whether S3 RTC is enabled and the time when all objects and operations on objects must be replicated.
Must be specified together with a
Metrics
block.
- storage_class
The storage class to use when replicating objects, such as S3 Standard or reduced redundancy.
By default, Amazon S3 uses the storage class of the source object to create the object replica.
For valid values, see the
StorageClass
element of the PUT Bucket replication action in the Amazon S3 API Reference .
ReplicationRuleAndOperatorProperty
- class CfnBucket.ReplicationRuleAndOperatorProperty(*, prefix=None, tag_filters=None)
Bases:
object
A container for specifying rule filters.
The filters determine the subset of objects to which the rule applies. This element is required only if you specify more than one filter.
For example:
If you specify both a
Prefix
and aTagFilter
, wrap these filters in anAnd
tag.If you specify a filter based on multiple tags, wrap the
TagFilter
elements in anAnd
tag
- Parameters:
prefix (
Optional
[str
]) – An object key name prefix that identifies the subset of objects to which the rule applies.tag_filters (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,TagFilterProperty
,Dict
[str
,Any
]]],None
]) – An array of tags containing key and value pairs.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 replication_rule_and_operator_property = s3.CfnBucket.ReplicationRuleAndOperatorProperty( prefix="prefix", tag_filters=[s3.CfnBucket.TagFilterProperty( key="key", value="value" )] )
Attributes
- prefix
An object key name prefix that identifies the subset of objects to which the rule applies.
- tag_filters
An array of tags containing key and value pairs.
ReplicationRuleFilterProperty
- class CfnBucket.ReplicationRuleFilterProperty(*, and_=None, prefix=None, tag_filter=None)
Bases:
object
A filter that identifies the subset of objects to which the replication rule applies.
A
Filter
must specify exactly onePrefix
,TagFilter
, or anAnd
child element.- Parameters:
and – A container for specifying rule filters. The filters determine the subset of objects to which the rule applies. This element is required only if you specify more than one filter. For example: - If you specify both a
Prefix
and aTagFilter
, wrap these filters in anAnd
tag. - If you specify a filter based on multiple tags, wrap theTagFilter
elements in anAnd
tag.prefix (
Optional
[str
]) –An object key name prefix that identifies the subset of objects to which the rule applies. .. epigraph:: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints .
tag_filter (
Union
[IResolvable
,TagFilterProperty
,Dict
[str
,Any
],None
]) – A container for specifying a tag key and value. The rule applies only to objects that have the tag in their tag set.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 replication_rule_filter_property = s3.CfnBucket.ReplicationRuleFilterProperty( and=s3.CfnBucket.ReplicationRuleAndOperatorProperty( prefix="prefix", tag_filters=[s3.CfnBucket.TagFilterProperty( key="key", value="value" )] ), prefix="prefix", tag_filter=s3.CfnBucket.TagFilterProperty( key="key", value="value" ) )
Attributes
- and_
A container for specifying rule filters.
The filters determine the subset of objects to which the rule applies. This element is required only if you specify more than one filter. For example:
If you specify both a
Prefix
and aTagFilter
, wrap these filters in anAnd
tag.If you specify a filter based on multiple tags, wrap the
TagFilter
elements in anAnd
tag.
- prefix
An object key name prefix that identifies the subset of objects to which the rule applies.
Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints .
- tag_filter
A container for specifying a tag key and value.
The rule applies only to objects that have the tag in their tag set.
ReplicationRuleProperty
- class CfnBucket.ReplicationRuleProperty(*, destination, status, delete_marker_replication=None, filter=None, id=None, prefix=None, priority=None, source_selection_criteria=None)
Bases:
object
Specifies which Amazon S3 objects to replicate and where to store the replicas.
- Parameters:
destination (
Union
[IResolvable
,ReplicationDestinationProperty
,Dict
[str
,Any
]]) – A container for information about the replication destination and its configurations including enabling the S3 Replication Time Control (S3 RTC).status (
str
) – Specifies whether the rule is enabled.delete_marker_replication (
Union
[IResolvable
,DeleteMarkerReplicationProperty
,Dict
[str
,Any
],None
]) –Specifies whether Amazon S3 replicates delete markers. If you specify a
Filter
in your replication configuration, you must also include aDeleteMarkerReplication
element. If yourFilter
includes aTag
element, theDeleteMarkerReplication
Status
must be set to Disabled, because Amazon S3 does not support replicating delete markers for tag-based rules. For an example configuration, see Basic Rule Configuration . For more information about delete marker replication, see Basic Rule Configuration . .. epigraph:: If you are using an earlier version of the replication configuration, Amazon S3 handles replication of delete markers differently. For more information, see Backward Compatibility .filter (
Union
[IResolvable
,ReplicationRuleFilterProperty
,Dict
[str
,Any
],None
]) – A filter that identifies the subset of objects to which the replication rule applies. AFilter
must specify exactly onePrefix
,TagFilter
, or anAnd
child element. The use of the filter field indicates that this is a V2 replication configuration. This field isn’t supported in a V1 replication configuration. .. epigraph:: V1 replication configuration only supports filtering by key prefix. To filter using a V1 replication configuration, add thePrefix
directly as a child element of theRule
element.id (
Optional
[str
]) – A unique identifier for the rule. The maximum value is 255 characters. If you don’t specify a value, AWS CloudFormation generates a random ID. When using a V2 replication configuration this property is capitalized as “ID”.prefix (
Optional
[str
]) –An object key name prefix that identifies the object or objects to which the rule applies. The maximum prefix length is 1,024 characters. To include all objects in a bucket, specify an empty string. To filter using a V1 replication configuration, add the
Prefix
directly as a child element of theRule
element. .. epigraph:: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints .priority (
Union
[int
,float
,None
]) – The priority indicates which rule has precedence whenever two or more replication rules conflict. Amazon S3 will attempt to replicate objects according to all replication rules. However, if there are two or more rules with the same destination bucket, then objects will be replicated according to the rule with the highest priority. The higher the number, the higher the priority. For more information, see Replication in the Amazon S3 User Guide .source_selection_criteria (
Union
[IResolvable
,SourceSelectionCriteriaProperty
,Dict
[str
,Any
],None
]) – A container that describes additional filters for identifying the source objects that you want to replicate. You can choose to enable or disable the replication of these objects.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 replication_rule_property = s3.CfnBucket.ReplicationRuleProperty( destination=s3.CfnBucket.ReplicationDestinationProperty( bucket="bucket", # the properties below are optional access_control_translation=s3.CfnBucket.AccessControlTranslationProperty( owner="owner" ), account="account", encryption_configuration=s3.CfnBucket.EncryptionConfigurationProperty( replica_kms_key_id="replicaKmsKeyId" ), metrics=s3.CfnBucket.MetricsProperty( status="status", # the properties below are optional event_threshold=s3.CfnBucket.ReplicationTimeValueProperty( minutes=123 ) ), replication_time=s3.CfnBucket.ReplicationTimeProperty( status="status", time=s3.CfnBucket.ReplicationTimeValueProperty( minutes=123 ) ), storage_class="storageClass" ), status="status", # the properties below are optional delete_marker_replication=s3.CfnBucket.DeleteMarkerReplicationProperty( status="status" ), filter=s3.CfnBucket.ReplicationRuleFilterProperty( and=s3.CfnBucket.ReplicationRuleAndOperatorProperty( prefix="prefix", tag_filters=[s3.CfnBucket.TagFilterProperty( key="key", value="value" )] ), prefix="prefix", tag_filter=s3.CfnBucket.TagFilterProperty( key="key", value="value" ) ), id="id", prefix="prefix", priority=123, source_selection_criteria=s3.CfnBucket.SourceSelectionCriteriaProperty( replica_modifications=s3.CfnBucket.ReplicaModificationsProperty( status="status" ), sse_kms_encrypted_objects=s3.CfnBucket.SseKmsEncryptedObjectsProperty( status="status" ) ) )
Attributes
- delete_marker_replication
Specifies whether Amazon S3 replicates delete markers.
If you specify a
Filter
in your replication configuration, you must also include aDeleteMarkerReplication
element. If yourFilter
includes aTag
element, theDeleteMarkerReplication
Status
must be set to Disabled, because Amazon S3 does not support replicating delete markers for tag-based rules. For an example configuration, see Basic Rule Configuration .For more information about delete marker replication, see Basic Rule Configuration . .. epigraph:
If you are using an earlier version of the replication configuration, Amazon S3 handles replication of delete markers differently. For more information, see `Backward Compatibility <https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations>`_ .
- destination
A container for information about the replication destination and its configurations including enabling the S3 Replication Time Control (S3 RTC).
- filter
A filter that identifies the subset of objects to which the replication rule applies.
A
Filter
must specify exactly onePrefix
,TagFilter
, or anAnd
child element. The use of the filter field indicates that this is a V2 replication configuration. This field isn’t supported in a V1 replication configuration. .. epigraph:V1 replication configuration only supports filtering by key prefix. To filter using a V1 replication configuration, add the ``Prefix`` directly as a child element of the ``Rule`` element.
- id
A unique identifier for the rule.
The maximum value is 255 characters. If you don’t specify a value, AWS CloudFormation generates a random ID. When using a V2 replication configuration this property is capitalized as “ID”.
- prefix
An object key name prefix that identifies the object or objects to which the rule applies.
The maximum prefix length is 1,024 characters. To include all objects in a bucket, specify an empty string. To filter using a V1 replication configuration, add the
Prefix
directly as a child element of theRule
element. .. epigraph:Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see `XML related object key constraints <https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints>`_ .
- priority
The priority indicates which rule has precedence whenever two or more replication rules conflict.
Amazon S3 will attempt to replicate objects according to all replication rules. However, if there are two or more rules with the same destination bucket, then objects will be replicated according to the rule with the highest priority. The higher the number, the higher the priority.
For more information, see Replication in the Amazon S3 User Guide .
- source_selection_criteria
A container that describes additional filters for identifying the source objects that you want to replicate.
You can choose to enable or disable the replication of these objects.
- status
Specifies whether the rule is enabled.
ReplicationTimeProperty
- class CfnBucket.ReplicationTimeProperty(*, status, time)
Bases:
object
A container specifying S3 Replication Time Control (S3 RTC) related information, including whether S3 RTC is enabled and the time when all objects and operations on objects must be replicated.
Must be specified together with a
Metrics
block.- Parameters:
status (
str
) – Specifies whether the replication time is enabled.time (
Union
[IResolvable
,ReplicationTimeValueProperty
,Dict
[str
,Any
]]) – A container specifying the time by which replication should be complete for all objects and operations on objects.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 replication_time_property = s3.CfnBucket.ReplicationTimeProperty( status="status", time=s3.CfnBucket.ReplicationTimeValueProperty( minutes=123 ) )
Attributes
- status
Specifies whether the replication time is enabled.
- time
A container specifying the time by which replication should be complete for all objects and operations on objects.
ReplicationTimeValueProperty
- class CfnBucket.ReplicationTimeValueProperty(*, minutes)
Bases:
object
A container specifying the time value for S3 Replication Time Control (S3 RTC) and replication metrics
EventThreshold
.- Parameters:
minutes (
Union
[int
,float
]) – Contains an integer specifying time in minutes. Valid value: 15- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 replication_time_value_property = s3.CfnBucket.ReplicationTimeValueProperty( minutes=123 )
Attributes
- minutes
Contains an integer specifying time in minutes.
Valid value: 15
RoutingRuleConditionProperty
- class CfnBucket.RoutingRuleConditionProperty(*, http_error_code_returned_equals=None, key_prefix_equals=None)
Bases:
object
A container for describing a condition that must be met for the specified redirect to apply.
For example, 1. If request is for pages in the
/docs
folder, redirect to the/documents
folder. 2. If request results in HTTP error 4xx, redirect request to another host where you might process the error.- Parameters:
http_error_code_returned_equals (
Optional
[str
]) – The HTTP error code when the redirect is applied. In the event of an error, if the error code equals this value, then the specified redirect is applied. Required when parent elementCondition
is specified and siblingKeyPrefixEquals
is not specified. If both are specified, then both must be true for the redirect to be applied.key_prefix_equals (
Optional
[str
]) – The object key name prefix when the redirect is applied. For example, to redirect requests forExamplePage.html
, the key prefix will beExamplePage.html
. To redirect request for all pages with the prefixdocs/
, the key prefix will be/docs
, which identifies all objects in the docs/ folder. Required when the parent elementCondition
is specified and siblingHttpErrorCodeReturnedEquals
is not specified. If both conditions are specified, both must be true for the redirect to be applied.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 routing_rule_condition_property = s3.CfnBucket.RoutingRuleConditionProperty( http_error_code_returned_equals="httpErrorCodeReturnedEquals", key_prefix_equals="keyPrefixEquals" )
Attributes
- http_error_code_returned_equals
The HTTP error code when the redirect is applied.
In the event of an error, if the error code equals this value, then the specified redirect is applied.
Required when parent element
Condition
is specified and siblingKeyPrefixEquals
is not specified. If both are specified, then both must be true for the redirect to be applied.
- key_prefix_equals
The object key name prefix when the redirect is applied.
For example, to redirect requests for
ExamplePage.html
, the key prefix will beExamplePage.html
. To redirect request for all pages with the prefixdocs/
, the key prefix will be/docs
, which identifies all objects in the docs/ folder.Required when the parent element
Condition
is specified and siblingHttpErrorCodeReturnedEquals
is not specified. If both conditions are specified, both must be true for the redirect to be applied.
RoutingRuleProperty
- class CfnBucket.RoutingRuleProperty(*, redirect_rule, routing_rule_condition=None)
Bases:
object
Specifies the redirect behavior and when a redirect is applied.
For more information about routing rules, see Configuring advanced conditional redirects in the Amazon S3 User Guide .
- Parameters:
redirect_rule (
Union
[IResolvable
,RedirectRuleProperty
,Dict
[str
,Any
]]) – Container for redirect information. You can redirect requests to another host, to another page, or with another protocol. In the event of an error, you can specify a different error code to return.routing_rule_condition (
Union
[IResolvable
,RoutingRuleConditionProperty
,Dict
[str
,Any
],None
]) – A container for describing a condition that must be met for the specified redirect to apply. For example, 1. If request is for pages in the/docs
folder, redirect to the/documents
folder. 2. If request results in HTTP error 4xx, redirect request to another host where you might process the error.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 routing_rule_property = s3.CfnBucket.RoutingRuleProperty( redirect_rule=s3.CfnBucket.RedirectRuleProperty( host_name="hostName", http_redirect_code="httpRedirectCode", protocol="protocol", replace_key_prefix_with="replaceKeyPrefixWith", replace_key_with="replaceKeyWith" ), # the properties below are optional routing_rule_condition=s3.CfnBucket.RoutingRuleConditionProperty( http_error_code_returned_equals="httpErrorCodeReturnedEquals", key_prefix_equals="keyPrefixEquals" ) )
Attributes
- redirect_rule
Container for redirect information.
You can redirect requests to another host, to another page, or with another protocol. In the event of an error, you can specify a different error code to return.
- routing_rule_condition
A container for describing a condition that must be met for the specified redirect to apply.
For example, 1. If request is for pages in the
/docs
folder, redirect to the/documents
folder. 2. If request results in HTTP error 4xx, redirect request to another host where you might process the error.
RuleProperty
- class CfnBucket.RuleProperty(*, status, abort_incomplete_multipart_upload=None, expiration_date=None, expiration_in_days=None, expired_object_delete_marker=None, id=None, noncurrent_version_expiration=None, noncurrent_version_expiration_in_days=None, noncurrent_version_transition=None, noncurrent_version_transitions=None, object_size_greater_than=None, object_size_less_than=None, prefix=None, tag_filters=None, transition=None, transitions=None)
Bases:
object
Specifies lifecycle rules for an Amazon S3 bucket.
For more information, see Put Bucket Lifecycle Configuration in the Amazon S3 API Reference .
You must specify at least one of the following properties:
AbortIncompleteMultipartUpload
,ExpirationDate
,ExpirationInDays
,NoncurrentVersionExpirationInDays
,NoncurrentVersionTransition
,NoncurrentVersionTransitions
,Transition
, orTransitions
.- Parameters:
status (
str
) – IfEnabled
, the rule is currently being applied. IfDisabled
, the rule is not currently being applied.abort_incomplete_multipart_upload (
Union
[IResolvable
,AbortIncompleteMultipartUploadProperty
,Dict
[str
,Any
],None
]) – Specifies a lifecycle rule that stops incomplete multipart uploads to an Amazon S3 bucket.expiration_date (
Union
[IResolvable
,datetime
,None
]) – Indicates when objects are deleted from Amazon S3 and Amazon S3 Glacier. The date value must be in ISO 8601 format. The time is always midnight UTC. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time.expiration_in_days (
Union
[int
,float
,None
]) – Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon S3 Glacier. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time.expired_object_delete_marker (
Union
[bool
,IResolvable
,None
]) – Indicates whether Amazon S3 will remove a delete marker without any noncurrent versions. If set to true, the delete marker will be removed if there are no noncurrent versions. This cannot be specified withExpirationInDays
,ExpirationDate
, orTagFilters
.id (
Optional
[str
]) – Unique identifier for the rule. The value can’t be longer than 255 characters.noncurrent_version_expiration (
Union
[IResolvable
,NoncurrentVersionExpirationProperty
,Dict
[str
,Any
],None
]) – Specifies when noncurrent object versions expire. Upon expiration, Amazon S3 permanently deletes the noncurrent object versions. You set this lifecycle configuration action on a bucket that has versioning enabled (or suspended) to request that Amazon S3 delete noncurrent object versions at a specific period in the object’s lifetime.noncurrent_version_expiration_in_days (
Union
[int
,float
,None
]) – (Deprecated.) For buckets with versioning enabled (or suspended), specifies the time, in days, between when a new version of the object is uploaded to the bucket and when old versions of the object expire. When object versions expire, Amazon S3 permanently deletes them. If you specify a transition and expiration time, the expiration time must be later than the transition time.noncurrent_version_transition (
Union
[IResolvable
,NoncurrentVersionTransitionProperty
,Dict
[str
,Any
],None
]) – (Deprecated.) For buckets with versioning enabled (or suspended), specifies when non-current objects transition to a specified storage class. If you specify a transition and expiration time, the expiration time must be later than the transition time. If you specify this property, don’t specify theNoncurrentVersionTransitions
property.noncurrent_version_transitions (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,NoncurrentVersionTransitionProperty
,Dict
[str
,Any
]]],None
]) – For buckets with versioning enabled (or suspended), one or more transition rules that specify when non-current objects transition to a specified storage class. If you specify a transition and expiration time, the expiration time must be later than the transition time. If you specify this property, don’t specify theNoncurrentVersionTransition
property.object_size_greater_than (
Union
[int
,float
,None
]) – Specifies the minimum object size in bytes for this rule to apply to. Objects must be larger than this value in bytes. For more information about size based rules, see Lifecycle configuration using size-based rules in the Amazon S3 User Guide .object_size_less_than (
Union
[int
,float
,None
]) –Specifies the maximum object size in bytes for this rule to apply to. Objects must be smaller than this value in bytes. For more information about sized based rules, see Lifecycle configuration using size-based rules in the Amazon S3 User Guide .
prefix (
Optional
[str
]) –Object key prefix that identifies one or more objects to which this rule applies. .. epigraph:: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints .
tag_filters (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,TagFilterProperty
,Dict
[str
,Any
]]],None
]) – Tags to use to identify a subset of objects to which the lifecycle rule applies.transition (
Union
[IResolvable
,TransitionProperty
,Dict
[str
,Any
],None
]) – (Deprecated.) Specifies when an object transitions to a specified storage class. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time. If you specify this property, don’t specify theTransitions
property.transitions (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,TransitionProperty
,Dict
[str
,Any
]]],None
]) – One or more transition rules that specify when an object transitions to a specified storage class. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time. If you specify this property, don’t specify theTransition
property.
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-rule.html
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 rule_property = s3.CfnBucket.RuleProperty( status="status", # the properties below are optional abort_incomplete_multipart_upload=s3.CfnBucket.AbortIncompleteMultipartUploadProperty( days_after_initiation=123 ), expiration_date=Date(), expiration_in_days=123, expired_object_delete_marker=False, id="id", noncurrent_version_expiration=s3.CfnBucket.NoncurrentVersionExpirationProperty( noncurrent_days=123, # the properties below are optional newer_noncurrent_versions=123 ), noncurrent_version_expiration_in_days=123, noncurrent_version_transition=s3.CfnBucket.NoncurrentVersionTransitionProperty( storage_class="storageClass", transition_in_days=123, # the properties below are optional newer_noncurrent_versions=123 ), noncurrent_version_transitions=[s3.CfnBucket.NoncurrentVersionTransitionProperty( storage_class="storageClass", transition_in_days=123, # the properties below are optional newer_noncurrent_versions=123 )], object_size_greater_than=123, object_size_less_than=123, prefix="prefix", tag_filters=[s3.CfnBucket.TagFilterProperty( key="key", value="value" )], transition=s3.CfnBucket.TransitionProperty( storage_class="storageClass", # the properties below are optional transition_date=Date(), transition_in_days=123 ), transitions=[s3.CfnBucket.TransitionProperty( storage_class="storageClass", # the properties below are optional transition_date=Date(), transition_in_days=123 )] )
Attributes
- abort_incomplete_multipart_upload
Specifies a lifecycle rule that stops incomplete multipart uploads to an Amazon S3 bucket.
- expiration_date
Indicates when objects are deleted from Amazon S3 and Amazon S3 Glacier.
The date value must be in ISO 8601 format. The time is always midnight UTC. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time.
- expiration_in_days
Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon S3 Glacier.
If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time.
- expired_object_delete_marker
Indicates whether Amazon S3 will remove a delete marker without any noncurrent versions.
If set to true, the delete marker will be removed if there are no noncurrent versions. This cannot be specified with
ExpirationInDays
,ExpirationDate
, orTagFilters
.
- id
Unique identifier for the rule.
The value can’t be longer than 255 characters.
- noncurrent_version_expiration
Specifies when noncurrent object versions expire.
Upon expiration, Amazon S3 permanently deletes the noncurrent object versions. You set this lifecycle configuration action on a bucket that has versioning enabled (or suspended) to request that Amazon S3 delete noncurrent object versions at a specific period in the object’s lifetime.
- noncurrent_version_expiration_in_days
(Deprecated.) For buckets with versioning enabled (or suspended), specifies the time, in days, between when a new version of the object is uploaded to the bucket and when old versions of the object expire. When object versions expire, Amazon S3 permanently deletes them. If you specify a transition and expiration time, the expiration time must be later than the transition time.
- noncurrent_version_transition
(Deprecated.) For buckets with versioning enabled (or suspended), specifies when non-current objects transition to a specified storage class. If you specify a transition and expiration time, the expiration time must be later than the transition time. If you specify this property, don’t specify the
NoncurrentVersionTransitions
property.
- noncurrent_version_transitions
For buckets with versioning enabled (or suspended), one or more transition rules that specify when non-current objects transition to a specified storage class.
If you specify a transition and expiration time, the expiration time must be later than the transition time. If you specify this property, don’t specify the
NoncurrentVersionTransition
property.
- object_size_greater_than
Specifies the minimum object size in bytes for this rule to apply to.
Objects must be larger than this value in bytes. For more information about size based rules, see Lifecycle configuration using size-based rules in the Amazon S3 User Guide .
- object_size_less_than
Specifies the maximum object size in bytes for this rule to apply to.
Objects must be smaller than this value in bytes. For more information about sized based rules, see Lifecycle configuration using size-based rules in the Amazon S3 User Guide .
- prefix
Object key prefix that identifies one or more objects to which this rule applies.
Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints .
- status
If
Enabled
, the rule is currently being applied.If
Disabled
, the rule is not currently being applied.
- tag_filters
Tags to use to identify a subset of objects to which the lifecycle rule applies.
- transition
(Deprecated.) Specifies when an object transitions to a specified storage class. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time. If you specify this property, don’t specify the
Transitions
property.
- transitions
One or more transition rules that specify when an object transitions to a specified storage class.
If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time. If you specify this property, don’t specify the
Transition
property.
S3KeyFilterProperty
- class CfnBucket.S3KeyFilterProperty(*, rules)
Bases:
object
A container for object key name prefix and suffix filtering rules.
For more information about object key name filtering, see Configuring event notifications using object key name filtering in the Amazon S3 User Guide . .. epigraph:
The same type of filter rule cannot be used more than once. For example, you cannot specify two prefix rules.
- Parameters:
rules (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,FilterRuleProperty
,Dict
[str
,Any
]]]]) – A list of containers for the key-value pair that defines the criteria for the filter rule.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 s3_key_filter_property = s3.CfnBucket.S3KeyFilterProperty( rules=[s3.CfnBucket.FilterRuleProperty( name="name", value="value" )] )
Attributes
- rules
A list of containers for the key-value pair that defines the criteria for the filter rule.
ServerSideEncryptionByDefaultProperty
- class CfnBucket.ServerSideEncryptionByDefaultProperty(*, sse_algorithm, kms_master_key_id=None)
Bases:
object
Describes the default server-side encryption to apply to new objects in the bucket.
If a PUT Object request doesn’t specify any server-side encryption, this default encryption will be applied. For more information, see PutBucketEncryption . .. epigraph:
- *General purpose buckets* - If you don't specify a customer managed key at configuration, Amazon S3 automatically creates an AWS KMS key ( ``aws/s3`` ) in your AWS account the first time that you add an object encrypted with SSE-KMS to a bucket. By default, Amazon S3 uses this KMS key for SSE-KMS. - *Directory buckets* - Your SSE-KMS configuration can only support 1 `customer managed key <https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk>`_ per directory bucket for the lifetime of the bucket. The `AWS managed key <https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk>`_ ( ``aws/s3`` ) isn't supported. - *Directory buckets* - For directory buckets, there are only two supported options for server-side encryption: SSE-S3 and SSE-KMS.
- Parameters:
sse_algorithm (
str
) – Server-side encryption algorithm to use for the default encryption. .. epigraph:: For directory buckets, there are only two supported values for server-side encryption:AES256
andaws:kms
.kms_master_key_id (
Optional
[str
]) –AWS Key Management Service (KMS) customer managed key ID to use for the default encryption. .. epigraph:: - General purpose buckets - This parameter is allowed if and only if
SSEAlgorithm
is set toaws:kms
oraws:kms:dsse
. - Directory buckets - This parameter is allowed if and only ifSSEAlgorithm
is set toaws:kms
. You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the KMS key. - Key ID:1234abcd-12ab-34cd-56ef-1234567890ab
- Key ARN:arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
- Key Alias:alias/alias-name
If you are using encryption with cross-account or AWS service operations, you must use a fully qualified KMS key ARN. For more information, see Using encryption for cross-account operations . .. epigraph:: - General purpose buckets - If you’re specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then AWS KMS resolves the key within the requester’s account. This behavior can result in data that’s encrypted with a KMS key that belongs to the requester, and not the bucket owner. Also, if you use a key ID, you can run into a LogDestination undeliverable error when creating a VPC flow log. - Directory buckets - When you specify an AWS KMS customer managed key for encryption in your directory bucket, only use the key ID or key ARN. The key alias format of the KMS key isn’t supported. > Amazon S3 only supports symmetric encryption KMS keys. For more information, see Asymmetric keys in AWS KMS in the AWS Key Management Service Developer Guide .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 server_side_encryption_by_default_property = s3.CfnBucket.ServerSideEncryptionByDefaultProperty( sse_algorithm="sseAlgorithm", # the properties below are optional kms_master_key_id="kmsMasterKeyId" )
Attributes
- kms_master_key_id
AWS Key Management Service (KMS) customer managed key ID to use for the default encryption.
General purpose buckets - This parameter is allowed if and only if
SSEAlgorithm
is set toaws:kms
oraws:kms:dsse
.Directory buckets - This parameter is allowed if and only if
SSEAlgorithm
is set toaws:kms
.
You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the KMS key.
Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
Key Alias:
alias/alias-name
If you are using encryption with cross-account or AWS service operations, you must use a fully qualified KMS key ARN. For more information, see Using encryption for cross-account operations . .. epigraph:
- *General purpose buckets* - If you're specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then AWS KMS resolves the key within the requester’s account. This behavior can result in data that's encrypted with a KMS key that belongs to the requester, and not the bucket owner. Also, if you use a key ID, you can run into a LogDestination undeliverable error when creating a VPC flow log. - *Directory buckets* - When you specify an `AWS KMS customer managed key <https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk>`_ for encryption in your directory bucket, only use the key ID or key ARN. The key alias format of the KMS key isn't supported. > Amazon S3 only supports symmetric encryption KMS keys. For more information, see `Asymmetric keys in AWS KMS <https://docs.aws.amazon.com//kms/latest/developerguide/symmetric-asymmetric.html>`_ in the *AWS Key Management Service Developer Guide* .
- sse_algorithm
Server-side encryption algorithm to use for the default encryption.
For directory buckets, there are only two supported values for server-side encryption:
AES256
andaws:kms
.
ServerSideEncryptionRuleProperty
- class CfnBucket.ServerSideEncryptionRuleProperty(*, bucket_key_enabled=None, server_side_encryption_by_default=None)
Bases:
object
Specifies the default server-side encryption configuration.
General purpose buckets - If you’re specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then AWS KMS resolves the key within the requester’s account. This behavior can result in data that’s encrypted with a KMS key that belongs to the requester, and not the bucket owner.
Directory buckets - When you specify an AWS KMS customer managed key for encryption in your directory bucket, only use the key ID or key ARN. The key alias format of the KMS key isn’t supported.
- Parameters:
bucket_key_enabled (
Union
[bool
,IResolvable
,None
]) – Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects are not affected. Setting theBucketKeyEnabled
element totrue
causes Amazon S3 to use an S3 Bucket Key. By default, S3 Bucket Key is not enabled. For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide .server_side_encryption_by_default (
Union
[IResolvable
,ServerSideEncryptionByDefaultProperty
,Dict
[str
,Any
],None
]) – Specifies the default server-side encryption to apply to new objects in the bucket. If a PUT Object request doesn’t specify any server-side encryption, this default encryption will be applied.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 server_side_encryption_rule_property = s3.CfnBucket.ServerSideEncryptionRuleProperty( bucket_key_enabled=False, server_side_encryption_by_default=s3.CfnBucket.ServerSideEncryptionByDefaultProperty( sse_algorithm="sseAlgorithm", # the properties below are optional kms_master_key_id="kmsMasterKeyId" ) )
Attributes
- bucket_key_enabled
Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new objects in the bucket.
Existing objects are not affected. Setting the
BucketKeyEnabled
element totrue
causes Amazon S3 to use an S3 Bucket Key. By default, S3 Bucket Key is not enabled.For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide .
- server_side_encryption_by_default
Specifies the default server-side encryption to apply to new objects in the bucket.
If a PUT Object request doesn’t specify any server-side encryption, this default encryption will be applied.
SourceSelectionCriteriaProperty
- class CfnBucket.SourceSelectionCriteriaProperty(*, replica_modifications=None, sse_kms_encrypted_objects=None)
Bases:
object
A container that describes additional filters for identifying the source objects that you want to replicate.
You can choose to enable or disable the replication of these objects.
- Parameters:
replica_modifications (
Union
[IResolvable
,ReplicaModificationsProperty
,Dict
[str
,Any
],None
]) – A filter that you can specify for selection for modifications on replicas.sse_kms_encrypted_objects (
Union
[IResolvable
,SseKmsEncryptedObjectsProperty
,Dict
[str
,Any
],None
]) – A container for filter information for the selection of Amazon S3 objects encrypted with AWS KMS.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 source_selection_criteria_property = s3.CfnBucket.SourceSelectionCriteriaProperty( replica_modifications=s3.CfnBucket.ReplicaModificationsProperty( status="status" ), sse_kms_encrypted_objects=s3.CfnBucket.SseKmsEncryptedObjectsProperty( status="status" ) )
Attributes
- replica_modifications
A filter that you can specify for selection for modifications on replicas.
- sse_kms_encrypted_objects
A container for filter information for the selection of Amazon S3 objects encrypted with AWS KMS.
SseKmsEncryptedObjectsProperty
- class CfnBucket.SseKmsEncryptedObjectsProperty(*, status)
Bases:
object
A container for filter information for the selection of S3 objects encrypted with AWS KMS.
- Parameters:
status (
str
) – Specifies whether Amazon S3 replicates objects created with server-side encryption using an AWS KMS key stored in AWS Key Management Service.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 sse_kms_encrypted_objects_property = s3.CfnBucket.SseKmsEncryptedObjectsProperty( status="status" )
Attributes
- status
Specifies whether Amazon S3 replicates objects created with server-side encryption using an AWS KMS key stored in AWS Key Management Service.
StorageClassAnalysisProperty
- class CfnBucket.StorageClassAnalysisProperty(*, data_export=None)
Bases:
object
Specifies data related to access patterns to be collected and made available to analyze the tradeoffs between different storage classes for an Amazon S3 bucket.
- Parameters:
data_export (
Union
[IResolvable
,DataExportProperty
,Dict
[str
,Any
],None
]) – Specifies how data related to the storage class analysis for an Amazon S3 bucket should be exported.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 storage_class_analysis_property = s3.CfnBucket.StorageClassAnalysisProperty( data_export=s3.CfnBucket.DataExportProperty( destination=s3.CfnBucket.DestinationProperty( bucket_arn="bucketArn", format="format", # the properties below are optional bucket_account_id="bucketAccountId", prefix="prefix" ), output_schema_version="outputSchemaVersion" ) )
Attributes
- data_export
Specifies how data related to the storage class analysis for an Amazon S3 bucket should be exported.
TagFilterProperty
- class CfnBucket.TagFilterProperty(*, key, value)
Bases:
object
Specifies tags to use to identify a subset of objects for an Amazon S3 bucket.
- Parameters:
key (
str
) – The tag key.value (
str
) – The tag value.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 tag_filter_property = s3.CfnBucket.TagFilterProperty( key="key", value="value" )
Attributes
- key
The tag key.
TargetObjectKeyFormatProperty
- class CfnBucket.TargetObjectKeyFormatProperty(*, partitioned_prefix=None, simple_prefix=None)
Bases:
object
Amazon S3 key format for log objects.
Only one format, PartitionedPrefix or SimplePrefix, is allowed.
- Parameters:
partitioned_prefix (
Union
[IResolvable
,PartitionedPrefixProperty
,Dict
[str
,Any
],None
]) – Partitioned S3 key for log objects.simple_prefix (
Any
) – To use the simple format for S3 keys for log objects. To specify SimplePrefix format, set SimplePrefix to {}.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 # simple_prefix: Any target_object_key_format_property = s3.CfnBucket.TargetObjectKeyFormatProperty( partitioned_prefix=s3.CfnBucket.PartitionedPrefixProperty( partition_date_source="partitionDateSource" ), simple_prefix=simple_prefix )
Attributes
- partitioned_prefix
Partitioned S3 key for log objects.
- simple_prefix
To use the simple format for S3 keys for log objects.
To specify SimplePrefix format, set SimplePrefix to {}.
TieringProperty
- class CfnBucket.TieringProperty(*, access_tier, days)
Bases:
object
The S3 Intelligent-Tiering storage class is designed to optimize storage costs by automatically moving data to the most cost-effective storage access tier, without additional operational overhead.
- Parameters:
access_tier (
str
) –S3 Intelligent-Tiering access tier. See Storage class for automatically optimizing frequently and infrequently accessed objects for a list of access tiers in the S3 Intelligent-Tiering storage class.
days (
Union
[int
,float
]) – The number of consecutive days of no access after which an object will be eligible to be transitioned to the corresponding tier. The minimum number of days specified for Archive Access tier must be at least 90 days and Deep Archive Access tier must be at least 180 days. The maximum can be up to 2 years (730 days).
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tiering.html
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 tiering_property = s3.CfnBucket.TieringProperty( access_tier="accessTier", days=123 )
Attributes
- access_tier
S3 Intelligent-Tiering access tier.
See Storage class for automatically optimizing frequently and infrequently accessed objects for a list of access tiers in the S3 Intelligent-Tiering storage class.
- days
The number of consecutive days of no access after which an object will be eligible to be transitioned to the corresponding tier.
The minimum number of days specified for Archive Access tier must be at least 90 days and Deep Archive Access tier must be at least 180 days. The maximum can be up to 2 years (730 days).
TopicConfigurationProperty
- class CfnBucket.TopicConfigurationProperty(*, event, topic, filter=None)
Bases:
object
A container for specifying the configuration for publication of messages to an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 detects specified events.
- Parameters:
event (
str
) –The Amazon S3 bucket event about which to send notifications. For more information, see Supported Event Types in the Amazon S3 User Guide .
topic (
str
) – The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 publishes a message when it detects events of the specified type.filter (
Union
[IResolvable
,NotificationFilterProperty
,Dict
[str
,Any
],None
]) – The filtering rules that determine for which objects to send notifications. For example, you can create a filter so that Amazon S3 sends notifications only when image files with a.jpg
extension are added to the bucket.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 topic_configuration_property = s3.CfnBucket.TopicConfigurationProperty( event="event", topic="topic", # the properties below are optional filter=s3.CfnBucket.NotificationFilterProperty( s3_key=s3.CfnBucket.S3KeyFilterProperty( rules=[s3.CfnBucket.FilterRuleProperty( name="name", value="value" )] ) ) )
Attributes
- event
The Amazon S3 bucket event about which to send notifications.
For more information, see Supported Event Types in the Amazon S3 User Guide .
- filter
The filtering rules that determine for which objects to send notifications.
For example, you can create a filter so that Amazon S3 sends notifications only when image files with a
.jpg
extension are added to the bucket.
- topic
The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 publishes a message when it detects events of the specified type.
TransitionProperty
- class CfnBucket.TransitionProperty(*, storage_class, transition_date=None, transition_in_days=None)
Bases:
object
Specifies when an object transitions to a specified storage class.
For more information about Amazon S3 lifecycle configuration rules, see Transitioning Objects Using Amazon S3 Lifecycle in the Amazon S3 User Guide .
- Parameters:
storage_class (
str
) – The storage class to which you want the object to transition.transition_date (
Union
[IResolvable
,datetime
,None
]) – Indicates when objects are transitioned to the specified storage class. The date value must be in ISO 8601 format. The time is always midnight UTC.transition_in_days (
Union
[int
,float
,None
]) – Indicates the number of days after creation when objects are transitioned to the specified storage class. The value must be a positive integer.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 transition_property = s3.CfnBucket.TransitionProperty( storage_class="storageClass", # the properties below are optional transition_date=Date(), transition_in_days=123 )
Attributes
- storage_class
The storage class to which you want the object to transition.
- transition_date
Indicates when objects are transitioned to the specified storage class.
The date value must be in ISO 8601 format. The time is always midnight UTC.
- transition_in_days
Indicates the number of days after creation when objects are transitioned to the specified storage class.
The value must be a positive integer.
VersioningConfigurationProperty
- class CfnBucket.VersioningConfigurationProperty(*, status)
Bases:
object
Describes the versioning state of an Amazon S3 bucket.
For more information, see PUT Bucket versioning in the Amazon S3 API Reference . .. epigraph:
When you enable versioning on a bucket for the first time, it might take a short amount of time for the change to be fully propagated. We recommend that you wait for 15 minutes after enabling versioning before issuing write operations ( ``PUT`` or ``DELETE`` ) on objects in the bucket.
- Parameters:
status (
str
) – The versioning state of the bucket. Default: - “Suspended”- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 versioning_configuration_property = s3.CfnBucket.VersioningConfigurationProperty( status="status" )
Attributes
- status
The versioning state of the bucket.
WebsiteConfigurationProperty
- class CfnBucket.WebsiteConfigurationProperty(*, error_document=None, index_document=None, redirect_all_requests_to=None, routing_rules=None)
Bases:
object
Specifies website configuration parameters for an Amazon S3 bucket.
- Parameters:
error_document (
Optional
[str
]) – The name of the error document for the website.index_document (
Optional
[str
]) – The name of the index document for the website.redirect_all_requests_to (
Union
[IResolvable
,RedirectAllRequestsToProperty
,Dict
[str
,Any
],None
]) – The redirect behavior for every request to this bucket’s website endpoint. .. epigraph:: If you specify this property, you can’t specify any other property.routing_rules (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,RoutingRuleProperty
,Dict
[str
,Any
]]],None
]) – Rules that define when a redirect is applied and the redirect behavior.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_s3 as s3 website_configuration_property = s3.CfnBucket.WebsiteConfigurationProperty( error_document="errorDocument", index_document="indexDocument", redirect_all_requests_to=s3.CfnBucket.RedirectAllRequestsToProperty( host_name="hostName", # the properties below are optional protocol="protocol" ), routing_rules=[s3.CfnBucket.RoutingRuleProperty( redirect_rule=s3.CfnBucket.RedirectRuleProperty( host_name="hostName", http_redirect_code="httpRedirectCode", protocol="protocol", replace_key_prefix_with="replaceKeyPrefixWith", replace_key_with="replaceKeyWith" ), # the properties below are optional routing_rule_condition=s3.CfnBucket.RoutingRuleConditionProperty( http_error_code_returned_equals="httpErrorCodeReturnedEquals", key_prefix_equals="keyPrefixEquals" ) )] )
Attributes
- error_document
The name of the error document for the website.
- index_document
The name of the index document for the website.
- redirect_all_requests_to
The redirect behavior for every request to this bucket’s website endpoint.
If you specify this property, you can’t specify any other property.
- routing_rules
Rules that define when a redirect is applied and the redirect behavior.