Skip to content

AWS::S3::Bucket

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

Generated by cfn-typegen --out cfn_types AWS::S3::Bucket into cfn_types/s3.py:

# Generated by cfn-typegen from the CloudFormation registry schemas. Do not edit.
# fmt: off
# ruff: noqa
"""AWS::S3 resources."""

from collections.abc import Mapping, Sequence
from typing import Any, Literal, NotRequired, Unpack
from typing_extensions import TypedDict
from cfn_typed.base import DeletionPolicy, DependsOn, ResourceAttrs, Tag, UpdateReplacePolicy, build
from cfn_typed.intrinsics import Expr


_c0={'P':{'Format':{'e':["CSV","ORC","Parquet"]}}}
_c1={'P':{'SseAlgorithm':{'e':["aws:kms","AES256"]}}}
_c2={'P':{'S3Key':{'P':{'Rules':{'T':{'P':{'Name':{'L':1024}}}}}}}}
_c3=["DEEP_ARCHIVE","GLACIER","Glacier","GLACIER_IR","INTELLIGENT_TIERING","ONEZONE_IA","STANDARD_IA"]
_c4={'P':{'TransitionDate':{'p':"^(\\d{4})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$"},'StorageClass':{'e':_c3}}}
_c5={'P':{'StorageClass':{'e':_c3}}}
CONSTRAINTS:dict[str,Any]={
'AWS::S3::Bucket':{'BucketNamespace':{'e':["global","account-regional"]},'InventoryConfigurations':{'T':{'P':{'Destination':_c0,'OptionalFields':{'T':{'e':["Size","LastModifiedDate","StorageClass","ETag","IsMultipartUploaded","ReplicationStatus","EncryptionStatus","ObjectLockRetainUntilDate","ObjectLockMode","ObjectLockLegalHoldStatus","ObjectLockEventHoldStatus","ObjectLockEventHoldDuration","IntelligentTieringAccessTier","BucketKeyStatus","ChecksumAlgorithm","ObjectAccessControlList","ObjectOwner","LifecycleExpirationDate","IntelligentTieringReferenceDate"]}},'IncludedObjectVersions':{'e':["All","Current"]},'ScheduleFrequency':{'e':["Daily","Weekly"]}}}},'WebsiteConfiguration':{'P':{'RedirectAllRequestsTo':{'P':{'Protocol':{'e':["http","https"]}}},'RoutingRules':{'T':{'P':{'RedirectRule':{'P':{'Protocol':{'e':["http","https"]}}}}}}}},'AccessControl':{'e':["AuthenticatedRead","AwsExecRead","BucketOwnerFullControl","BucketOwnerRead","LogDeliveryWrite","Private","PublicRead","PublicReadWrite"]},'AnalyticsConfigurations':{'T':{'P':{'StorageClassAnalysis':{'P':{'DataExport':{'P':{'Destination':_c0}}}}}}},'AbacStatus':{'e':["Enabled","Disabled"]},'AccelerateConfiguration':{'P':{'AccelerationStatus':{'e':["Enabled","Suspended"]}}},'OwnershipControls':{'P':{'Rules':{'T':{'P':{'ObjectOwnership':{'e':["ObjectWriter","BucketOwnerPreferred","BucketOwnerEnforced"]}}}}}},'ObjectLockConfiguration':{'P':{'Rule':{'P':{'DefaultRetention':{'P':{'Mode':{'e':["COMPLIANCE","GOVERNANCE"]}}}}}}},'MetadataConfiguration':{'P':{'Destination':{'P':{'TableBucketType':{'e':["aws","customer"]}}},'JournalTableConfiguration':{'P':{'EncryptionConfiguration':_c1,'RecordExpiration':{'P':{'Expiration':{'e':["ENABLED","DISABLED"]}}}}},'InventoryTableConfiguration':{'P':{'ConfigurationState':{'e':["ENABLED","DISABLED"]},'EncryptionConfiguration':_c1}},'AnnotationTableConfiguration':{'P':{'ConfigurationState':{'e':["ENABLED","DISABLED"]},'EncryptionConfiguration':_c1}}}},'ReplicationConfiguration':{'P':{'Rules':{'T':{'P':{'Status':{'e':["Disabled","Enabled"]},'Destination':{'P':{'Metrics':{'P':{'Status':{'e':["Disabled","Enabled"]}}},'StorageClass':{'e':["DEEP_ARCHIVE","GLACIER","GLACIER_IR","INTELLIGENT_TIERING","ONEZONE_IA","REDUCED_REDUNDANCY","STANDARD","STANDARD_IA"]},'ReplicationTime':{'P':{'Status':{'e':["Disabled","Enabled"]}}}}},'SourceSelectionCriteria':{'P':{'ReplicaModifications':{'P':{'Status':{'e':["Enabled","Disabled"]}}},'SseKmsEncryptedObjects':{'P':{'Status':{'e':["Disabled","Enabled"]}}}}},'Id':{'L':255},'Prefix':{'L':1024},'DeleteMarkerReplication':{'P':{'Status':{'e':["Disabled","Enabled"]}}}}}}}},'Tags':{'T':{'P':{'Value':{'L':256},'Key':{'l':1,'L':128}}}},'BucketEncryption':{'P':{'ServerSideEncryptionConfiguration':{'T':{'P':{'BlockedEncryptionTypes':{'P':{'EncryptionType':{'T':{'e':["NONE","SSE-C"]}}}},'ServerSideEncryptionByDefault':{'P':{'SSEAlgorithm':{'e':["aws:kms","AES256","aws:kms:dsse"]}}}}}}}},'NotificationConfiguration':{'P':{'TopicConfigurations':{'T':{'P':{'Filter':_c2}}},'QueueConfigurations':{'T':{'P':{'Filter':_c2}}},'LambdaConfigurations':{'T':{'P':{'Filter':_c2}}}}},'LifecycleConfiguration':{'P':{'TransitionDefaultMinimumObjectSize':{'e':["varies_by_storage_class","all_storage_classes_128K"]},'Rules':{'T':{'P':{'Status':{'e':["Enabled","Disabled"]},'Transitions':{'T':_c4},'ObjectSizeGreaterThan':{'p':"[0-9]+",'L':20},'NoncurrentVersionTransitions':{'T':_c5},'ObjectSizeLessThan':{'p':"[0-9]+",'L':20},'NoncurrentVersionTransition':_c5,'ExpirationDate':{'p':"^(\\d{4})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$"},'Transition':_c4,'Id':{'L':255},'AbortIncompleteMultipartUpload':{'P':{'DaysAfterInitiation':{'m':0}}}}}}}},'VersioningConfiguration':{'P':{'Status':{'e':["Enabled","Suspended"]}}},'IntelligentTieringConfigurations':{'T':{'P':{'Status':{'e':["Disabled","Enabled"]},'Tierings':{'T':{'P':{'AccessTier':{'e':["ARCHIVE_ACCESS","DEEP_ARCHIVE_ACCESS"]}}}}}}},'CorsConfiguration':{'P':{'CorsRules':{'T':{'P':{'AllowedMethods':{'T':{'e':["GET","PUT","HEAD","POST","DELETE"]}},'MaxAge':{'m':0},'Id':{'L':255}}}}}}},
}


ATTRIBUTES:dict[str,Any]={"AWS::S3::Bucket":["Arn","BucketName","DomainName","DualStackDomainName","MetadataConfiguration.AnnotationTableConfiguration.TableArn","MetadataConfiguration.AnnotationTableConfiguration.TableName","MetadataConfiguration.Destination","MetadataConfiguration.InventoryTableConfiguration.TableArn","MetadataConfiguration.InventoryTableConfiguration.TableName","MetadataConfiguration.JournalTableConfiguration.TableArn","MetadataConfiguration.JournalTableConfiguration.TableName","MetadataTableConfiguration.S3TablesDestination.TableArn","MetadataTableConfiguration.S3TablesDestination.TableNamespace","RegionalDomainName","WebsiteURL"]}


RULES:dict[str,Any]={}
Nested types (70)

These are defined above the properties in the generated module.

class BucketDestination(TypedDict, closed=True):
    'Specifies information about where to publish analysis or configuration results for an Amazon S3 bucket.'
    BucketArn: Expr[str]
    'The Amazon Resource Name (ARN) of the bucket to which data is exported.'
    Format: Expr[str]
    'Specifies the file format used when exporting data to Amazon S3.'
    BucketAccountId: NotRequired[Expr[str]]
    'The account ID that owns the destination S3 bucket.'
    Prefix: NotRequired[Expr[str]]
    'The prefix to use when exporting data.'


class BucketInventoryConfiguration(TypedDict, closed=True):
    'Specifies the S3 Inventory configuration for an Amazon S3 bucket.'
    Destination: Expr[BucketDestination]
    'Contains information about where to publish the inventory results.'
    OptionalFields: NotRequired[Expr[list[Expr[str]]]]
    'Contains the optional fields that are included in the inventory results.'
    IncludedObjectVersions: Expr[str]
    'Object versions to include in the inventory list.'
    Enabled: Expr[bool]
    'Specifies whether the inventory is enabled or disabled.'
    Id: Expr[str]
    'The ID used to identify the inventory configuration.'
    Prefix: NotRequired[Expr[str]]
    'Specifies the inventory filter prefix.'
    ScheduleFrequency: Expr[str]
    'Specifies the schedule for generating inventory results.'


class BucketRedirectAllRequestsTo(TypedDict, closed=True):
    'Specifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket.'
    Protocol: NotRequired[Expr[str]]
    'Protocol to use when redirecting requests.'
    HostName: Expr[str]
    'Name of the host where requests are redirected.'


class BucketRedirectRule(TypedDict, closed=True):
    'Specifies how requests are redirected.'
    ReplaceKeyWith: NotRequired[Expr[str]]
    'The specific object key to use in the redirect request.'
    HttpRedirectCode: NotRequired[Expr[str]]
    'The HTTP redirect code to use on the response.'
    Protocol: NotRequired[Expr[str]]
    'Protocol to use when redirecting requests.'
    HostName: NotRequired[Expr[str]]
    'The host name to use in the redirect request.'
    ReplaceKeyPrefixWith: NotRequired[Expr[str]]
    'The object key prefix to use in the redirect request.'


class BucketRoutingRuleCondition(TypedDict, closed=True):
    'A container for describing a condition that must be met for the specified redirect to apply.'
    KeyPrefixEquals: NotRequired[Expr[str]]
    'The object key name prefix when the redirect is applied.'
    HttpErrorCodeReturnedEquals: NotRequired[Expr[str]]
    'The HTTP error code when the redirect is applied.'


class BucketRoutingRule(TypedDict, closed=True):
    'Specifies the redirect behavior and when a redirect is applied.'
    RedirectRule: Expr[BucketRedirectRule]
    'Container for redirect information.'
    RoutingRuleCondition: NotRequired[Expr[BucketRoutingRuleCondition]]
    'A container for describing a condition that must be met for the specified redirect to apply.'


class BucketWebsiteConfiguration(TypedDict, closed=True):
    'Specifies website configuration parameters for an Amazon S3 bucket.'
    IndexDocument: NotRequired[Expr[str]]
    'The name of the index document for the website.'
    RedirectAllRequestsTo: NotRequired[Expr[BucketRedirectAllRequestsTo]]
    "The redirect behavior for every request to this bucket's website endpoint."
    RoutingRules: NotRequired[Expr[Sequence[Expr[BucketRoutingRule]]]]
    'Rules that define when a redirect is applied and the redirect behavior.'
    ErrorDocument: NotRequired[Expr[str]]
    'The name of the error document for the website.'


class BucketS3TablesDestination(TypedDict, closed=True):
    'The destination information for a V1 S3 Metadata configuration.'
    TableBucketArn: Expr[str]
    "The Amazon Resource Name (ARN) for the table bucket that's specified as the destination in the metadata table configuration."
    TableName: Expr[str]
    'The name for the metadata table in your metadata table configuration.'
    TableArn: NotRequired[Expr[str]]
    'The Amazon Resource Name (ARN) for the metadata table in the metadata table configuration.'
    TableNamespace: NotRequired[Expr[str]]
    'The table bucket namespace for the metadata table in your metadata table configuration.'


class BucketMetadataTableConfiguration(TypedDict, closed=True):
    'We recommend that you create your S3 Metadata configurations by using the V2 [MetadataConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/Tem...'
    S3TablesDestination: Expr[BucketS3TablesDestination]
    'The destination information for the metadata table configuration.'


class BucketDataExport(TypedDict, closed=True):
    'Specifies how data related to the storage class analysis for an Amazon S3 bucket should be exported.'
    Destination: Expr[BucketDestination]
    'The place to store the data for an analysis.'
    OutputSchemaVersion: Expr[str]
    'The version of the output schema to use when exporting data.'


class BucketStorageClassAnalysis(TypedDict, closed=True):
    '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.'
    DataExport: NotRequired[Expr[BucketDataExport]]
    'Specifies how data related to the storage class analysis for an Amazon S3 bucket should be exported.'


class BucketTagFilter(TypedDict, closed=True):
    'Specifies tags to use to identify a subset of objects for an Amazon S3 bucket.'
    Value: Expr[str]
    'The tag value.'
    Key: Expr[str]
    'The tag key.'


class BucketAnalyticsConfiguration(TypedDict, closed=True):
    'Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket.'
    StorageClassAnalysis: Expr[BucketStorageClassAnalysis]
    'Contains data related to access patterns to be collected and made available to analyze the tradeoffs between different storage classes.'
    TagFilters: NotRequired[Expr[Sequence[Expr[BucketTagFilter]]]]
    'The tags to use when evaluating an analytics filter.'
    Id: Expr[str]
    'The ID that identifies the analytics configuration.'
    Prefix: NotRequired[Expr[str]]
    'The prefix that an object must have to be included in the analytics results.'


class BucketAccelerateConfiguration(TypedDict, closed=True):
    'Configures the transfer acceleration state for an Amazon S3 bucket.'
    AccelerationStatus: Expr[str]
    'Specifies the transfer acceleration status of the bucket.'


class BucketPublicAccessBlockConfiguration(TypedDict, closed=True):
    'The PublicAccessBlock configuration that you want to apply to this Amazon S3 bucket.'
    RestrictPublicBuckets: NotRequired[Expr[bool]]
    'Specifies whether Amazon S3 should restrict public bucket policies for this bucket.'
    BlockPublicPolicy: NotRequired[Expr[bool]]
    'Specifies whether Amazon S3 should block public bucket policies for this bucket.'
    BlockPublicAcls: NotRequired[Expr[bool]]
    'Specifies whether Amazon S3 should block public access control lists (ACLs) for this bucket and objects in this bucket.'
    IgnorePublicAcls: NotRequired[Expr[bool]]
    'Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket.'


class BucketOwnershipControlsRule(TypedDict, closed=True):
    'Specifies an Object Ownership rule.'
    ObjectOwnership: NotRequired[Expr[str]]
    'Specifies an object ownership rule.'


class BucketOwnershipControls(TypedDict, closed=True):
    'Specifies the container element for Object Ownership rules.'
    Rules: Expr[Sequence[Expr[BucketOwnershipControlsRule]]]
    'Specifies the container element for Object Ownership rules.'


class BucketDefaultEventHold(TypedDict, closed=True):
    "The default Object Lock event hold duration that you want to apply to new objects placed in the specified bucket, unless an object's upload request specifies..."
    Years: NotRequired[Expr[int]]
    'The number of years that you want to specify for the default event hold duration.'
    Days: NotRequired[Expr[int]]
    'The number of days that you want to specify for the default event hold duration.'


class BucketDefaultRetention(TypedDict, closed=True):
    'The container element for optionally specifying the default Object Lock retention settings for new objects placed in the specified bucket.'
    Years: NotRequired[Expr[int]]
    'The number of years that you want to specify for the default retention period.'
    Days: NotRequired[Expr[int]]
    'The number of days that you want to specify for the default retention period.'
    Mode: NotRequired[Expr[str]]
    'The default Object Lock retention mode you want to apply to new objects placed in the specified bucket.'
    DefaultEventHold: NotRequired[Expr[BucketDefaultEventHold]]
    'The default Object Lock event hold duration that you want to apply to new objects placed in the specified bucket.'


class BucketObjectLockRule(TypedDict, closed=True):
    'Specifies the Object Lock rule for the specified object.'
    DefaultRetention: NotRequired[Expr[BucketDefaultRetention]]
    'The default Object Lock retention mode and period that you want to apply to new objects placed in the specified bucket.'


class BucketObjectLockConfiguration(TypedDict, closed=True):
    'Places an Object Lock configuration on the specified bucket.'
    ObjectLockEnabled: NotRequired[Expr[str]]
    'Indicates whether this bucket has an Object Lock configuration enabled.'
    Rule: NotRequired[Expr[BucketObjectLockRule]]
    'Specifies the Object Lock rule for the specified object.'


class BucketLoggingConfiguration(TypedDict, closed=True):
    'Describes where logs are stored and the prefix that Amazon S3 assigns to all log object keys for a bucket.'
    TargetObjectKeyFormat: NotRequired[Expr[Mapping[str, Any]]]
    'Amazon S3 key format for log objects.'
    LogFilePrefix: NotRequired[Expr[str]]
    'A prefix for all log object keys.'
    DestinationBucketName: NotRequired[Expr[str]]
    'The name of the bucket where Amazon S3 should store server access log files.'


class BucketMetadataDestination(TypedDict, closed=True):
    'The destination information for the S3 Metadata configuration.'
    TableBucketArn: NotRequired[Expr[str]]
    'The Amazon Resource Name (ARN) of the table bucket where the metadata configuration is stored.'
    TableBucketType: Expr[str]
    'The type of the table bucket where the metadata configuration is stored.'
    TableNamespace: NotRequired[Expr[str]]
    'The namespace in the table bucket where the metadata tables for a metadata configuration are stored.'


class BucketMetadataTableEncryptionConfiguration(TypedDict, closed=True):
    'The encryption settings for an S3 Metadata journal table or inventory table configuration.'
    KmsKeyArn: NotRequired[Expr[str]]
    'If server-side encryption with KMSlong (KMS) keys (SSE-KMS) is specified, you must also specify the KMS key Amazon Resource Name (ARN).'
    SseAlgorithm: Expr[str]
    'The encryption type specified for a metadata table.'


class BucketRecordExpiration(TypedDict, closed=True):
    'The journal table record expiration settings for a journal table in an S3 Metadata configuration.'
    Days: NotRequired[Expr[int]]
    'If you enable journal table record expiration, you can set the number of days to retain your journal table records.'
    Expiration: Expr[str]
    'Specifies whether journal table record expiration is enabled or disabled.'


class BucketJournalTableConfiguration(TypedDict, closed=True):
    'The journal table configuration for an S3 Metadata configuration.'
    TableName: NotRequired[Expr[str]]
    'The name of the journal table.'
    TableArn: NotRequired[Expr[str]]
    'The Amazon Resource Name (ARN) for the journal table.'
    EncryptionConfiguration: NotRequired[Expr[BucketMetadataTableEncryptionConfiguration]]
    'The encryption configuration for the journal table.'
    RecordExpiration: Expr[BucketRecordExpiration]
    'The journal table record expiration settings for the journal table.'


class BucketInventoryTableConfiguration(TypedDict, closed=True):
    'The inventory table configuration for an S3 Metadata configuration.'
    TableName: NotRequired[Expr[str]]
    'The name of the inventory table.'
    ConfigurationState: Expr[str]
    'The configuration state of the inventory table, indicating whether the inventory table is enabled or disabled.'
    TableArn: NotRequired[Expr[str]]
    'The Amazon Resource Name (ARN) for the inventory table.'
    EncryptionConfiguration: NotRequired[Expr[BucketMetadataTableEncryptionConfiguration]]
    'The encryption configuration for the inventory table.'


class BucketAnnotationTableConfiguration(TypedDict, closed=True):
    'The annotation table configuration for an S3 Metadata configuration.'
    Role: NotRequired[Expr[str]]
    'The ARN of the IAM role that grants Amazon S3 Metadata permission to read annotations from your bucket.'
    TableName: NotRequired[Expr[str]]
    'The name of the annotation table.'
    ConfigurationState: Expr[str]
    'Specifies whether the annotation table configuration is enabled or disabled.'
    TableArn: NotRequired[Expr[str]]
    'The Amazon Resource Name (ARN) for the annotation table.'
    EncryptionConfiguration: NotRequired[Expr[BucketMetadataTableEncryptionConfiguration]]
    'The encryption configuration for the annotation table.'


class BucketMetadataConfiguration(TypedDict, closed=True):
    'Creates a V2 S3 Metadata configuration of a general purpose bucket.'
    Destination: NotRequired[Expr[BucketMetadataDestination]]
    'The destination information for the S3 Metadata configuration.'
    JournalTableConfiguration: Expr[BucketJournalTableConfiguration]
    'The journal table configuration for a metadata configuration.'
    InventoryTableConfiguration: NotRequired[Expr[BucketInventoryTableConfiguration]]
    'The inventory table configuration for a metadata configuration.'
    AnnotationTableConfiguration: NotRequired[Expr[BucketAnnotationTableConfiguration]]
    'The annotation table configuration for a metadata configuration.'


class BucketAccessControlTranslation(TypedDict, closed=True):
    '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 ...'
    Owner: Expr[str]
    'Specifies the replica ownership.'


class BucketReplicationTimeValue(TypedDict, closed=True):
    'A container specifying the time value for S3 Replication Time Control (S3 RTC) and replication metrics ``EventThreshold``.'
    Minutes: Expr[int]
    'Contains an integer specifying time in minutes.'


class BucketMetrics(TypedDict, closed=True):
    'A container specifying replication metrics-related settings enabling replication metrics and events.'
    Status: Expr[str]
    'Specifies whether the replication metrics are enabled.'
    EventThreshold: NotRequired[Expr[BucketReplicationTimeValue]]
    'A container specifying the time threshold for emitting the ``s3:Replication:OperationMissedThreshold`` event.'


class BucketEncryptionConfiguration(TypedDict, closed=True):
    'Specifies encryption-related information for an Amazon S3 bucket that is a destination for replicated objects.'
    ReplicaKmsKeyID: Expr[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.'


class BucketReplicationTime(TypedDict, closed=True):
    'A container specifying S3 Replication Time Control (S3 RTC) related information, including whether S3 RTC is enabled and the time when all objects and operat...'
    Status: Expr[str]
    'Specifies whether the replication time is enabled.'
    Time: Expr[BucketReplicationTimeValue]
    'A container specifying the time by which replication should be complete for all objects and operations on objects.'


class BucketReplicationDestination(TypedDict, closed=True):
    'A container for information about the replication destination and its configurations including enabling the S3 Replication Time Control (S3 RTC).'
    AccessControlTranslation: NotRequired[Expr[BucketAccessControlTranslation]]
    '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 ...'
    Account: NotRequired[Expr[str]]
    'Destination bucket owner account ID.'
    Metrics: NotRequired[Expr[BucketMetrics]]
    'A container specifying replication metrics-related settings enabling replication metrics and events.'
    Bucket: Expr[str]
    'The Amazon Resource Name (ARN) of the bucket where you want Amazon S3 to store the results.'
    EncryptionConfiguration: NotRequired[Expr[BucketEncryptionConfiguration]]
    'Specifies encryption-related information.'
    StorageClass: NotRequired[Expr[str]]
    'The storage class to use when replicating objects, such as S3 Standard or reduced redundancy.'
    ReplicationTime: NotRequired[Expr[BucketReplicationTime]]
    '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...'


class BucketReplicationRuleAndOperator(TypedDict, closed=True):
    'A container for specifying rule filters.'
    TagFilters: NotRequired[Expr[Sequence[Expr[BucketTagFilter]]]]
    'An array of tags containing key and value pairs.'
    Prefix: NotRequired[Expr[str]]
    'An object key name prefix that identifies the subset of objects to which the rule applies.'


class BucketReplicationRuleFilter(TypedDict, closed=True):
    'A filter that identifies the subset of objects to which the replication rule applies.'
    And: NotRequired[Expr[BucketReplicationRuleAndOperator]]
    'A container for specifying rule filters.'
    TagFilter: NotRequired[Expr[BucketTagFilter]]
    'A container for specifying a tag key and value.'
    Prefix: NotRequired[Expr[str]]
    'An object key name prefix that identifies the subset of objects to which the rule applies.'


class BucketReplicaModifications(TypedDict, closed=True):
    'A filter that you can specify for selection for modifications on replicas.'
    Status: Expr[str]
    'Specifies whether Amazon S3 replicates modifications on replicas.'


class BucketSseKmsEncryptedObjects(TypedDict, closed=True):
    'A container for filter information for the selection of S3 objects encrypted with AWS KMS.'
    Status: Expr[str]
    'Specifies whether Amazon S3 replicates objects created with server-side encryption using an AWS KMS key stored in AWS Key Management Service.'


class BucketSourceSelectionCriteria(TypedDict, closed=True):
    'A container that describes additional filters for identifying the source objects that you want to replicate.'
    ReplicaModifications: NotRequired[Expr[BucketReplicaModifications]]
    'A filter that you can specify for selection for modifications on replicas.'
    SseKmsEncryptedObjects: NotRequired[Expr[BucketSseKmsEncryptedObjects]]
    'A container for filter information for the selection of Amazon S3 objects encrypted with AWS KMS.'


class BucketDeleteMarkerReplication(TypedDict, closed=True):
    'Specifies whether Amazon S3 replicates delete markers.'
    Status: NotRequired[Expr[str]]
    'Indicates whether to replicate delete markers.'


class BucketReplicationRule(TypedDict, closed=True):
    'Specifies which Amazon S3 objects to replicate and where to store the replicas.'
    Status: Expr[str]
    'Specifies whether the rule is enabled.'
    Destination: Expr[BucketReplicationDestination]
    'A container for information about the replication destination and its configurations including enabling the S3 Replication Time Control (S3 RTC).'
    Filter: NotRequired[Expr[BucketReplicationRuleFilter]]
    'A filter that identifies the subset of objects to which the replication rule applies.'
    Priority: NotRequired[Expr[int]]
    'The priority indicates which rule has precedence whenever two or more replication rules conflict.'
    SourceSelectionCriteria: NotRequired[Expr[BucketSourceSelectionCriteria]]
    'A container that describes additional filters for identifying the source objects that you want to replicate.'
    Id: NotRequired[Expr[str]]
    'A unique identifier for the rule.'
    Prefix: NotRequired[Expr[str]]
    'An object key name prefix that identifies the object or objects to which the rule applies.'
    DeleteMarkerReplication: NotRequired[Expr[BucketDeleteMarkerReplication]]
    'Specifies whether Amazon S3 replicates delete markers.'


class BucketReplicationConfiguration(TypedDict, closed=True):
    'A container for replication rules.'
    Role: Expr[str]
    'The Amazon Resource Name (ARN) of the IAMlong (IAM) role that Amazon S3 assumes when replicating objects.'
    Rules: Expr[Sequence[Expr[BucketReplicationRule]]]
    'A container for one or more replication rules.'


class BucketBlockedEncryptionTypes(TypedDict, closed=True):
    'A bucket-level setting for Amazon S3 general purpose buckets used to prevent the upload of new objects encrypted with the specified server-side encryption type.'
    EncryptionType: NotRequired[Expr[list[Expr[str]]]]
    'The object encryption type that you want to block or unblock for an Amazon S3 general purpose bucket.'


class BucketServerSideEncryptionByDefault(TypedDict, closed=True):
    'Describes the default server-side encryption to apply to new objects in the bucket.'
    SSEAlgorithm: Expr[str]
    'Server-side encryption algorithm to use for the default encryption.'
    KMSMasterKeyID: NotRequired[Expr[str]]
    'AWS Key Management Service (KMS) customer managed key ID to use for the default encryption.'


class BucketServerSideEncryptionRule(TypedDict, closed=True):
    'Specifies the default server-side encryption configuration.'
    BucketKeyEnabled: NotRequired[Expr[bool]]
    'Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new objects in the bucket.'
    BlockedEncryptionTypes: NotRequired[Expr[BucketBlockedEncryptionTypes]]
    'A bucket-level setting for Amazon S3 general purpose buckets used to prevent the upload of new objects encrypted with the specified server-side encryption type.'
    ServerSideEncryptionByDefault: NotRequired[Expr[BucketServerSideEncryptionByDefault]]
    'Specifies the default server-side encryption to apply to new objects in the bucket.'


class BucketBucketEncryption(TypedDict, closed=True):
    '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 se...'
    ServerSideEncryptionConfiguration: Expr[Sequence[Expr[BucketServerSideEncryptionRule]]]
    'Specifies the default server-side-encryption configuration.'


class BucketFilterRule(TypedDict, closed=True):
    'Specifies the Amazon S3 object key name to filter on.'
    Value: Expr[str]
    'The value that the filter searches for in object key names.'
    Name: Expr[str]
    'The object key name prefix or suffix identifying one or more objects to which the filtering rule applies.'


class BucketS3KeyFilter(TypedDict, closed=True):
    'A container for object key name prefix and suffix filtering rules.'
    Rules: Expr[Sequence[Expr[BucketFilterRule]]]
    'A list of containers for the key-value pair that defines the criteria for the filter rule.'


class BucketNotificationFilter(TypedDict, closed=True):
    'Specifies object key name filtering rules.'
    S3Key: Expr[BucketS3KeyFilter]
    'A container for object key name prefix and suffix filtering rules.'


class BucketTopicConfiguration(TypedDict, closed=True):
    'A container for specifying the configuration for publication of messages to an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 detects s...'
    Filter: NotRequired[Expr[BucketNotificationFilter]]
    'The filtering rules that determine for which objects to send notifications.'
    Event: Expr[str]
    'The Amazon S3 bucket event about which to send notifications.'
    Topic: Expr[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.'


class BucketQueueConfiguration(TypedDict, closed=True):
    'Specifies the configuration for publishing messages to an Amazon Simple Queue Service (Amazon SQS) queue when Amazon S3 detects specified events.'
    Filter: NotRequired[Expr[BucketNotificationFilter]]
    'The filtering rules that determine which objects trigger notifications.'
    Event: Expr[str]
    'The Amazon S3 bucket event about which you want to publish messages to Amazon SQS.'
    Queue: Expr[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.'


class BucketLambdaConfiguration(TypedDict, closed=True):
    'Describes the LAMlong functions to invoke and the events for which to invoke them.'
    Function: Expr[str]
    'The Amazon Resource Name (ARN) of the LAMlong function that Amazon S3 invokes when the specified event type occurs.'
    Filter: NotRequired[Expr[BucketNotificationFilter]]
    'The filtering rules that determine which objects invoke the AWS Lambda function.'
    Event: Expr[str]
    'The Amazon S3 bucket event for which to invoke the LAMlong function.'


class BucketEventBridgeConfiguration(TypedDict, closed=True):
    'Amazon S3 can send events to Amazon EventBridge whenever certain events happen in your bucket, see [Using EventBridge](https://docs.aws.amazon.com/AmazonS3/l...'
    EventBridgeEnabled: Expr[bool]
    'Enables delivery of events to Amazon EventBridge.'


class BucketNotificationConfiguration(TypedDict, closed=True):
    'Describes the notification configuration for an Amazon S3 bucket.'
    TopicConfigurations: NotRequired[Expr[Sequence[Expr[BucketTopicConfiguration]]]]
    'The topic to which notifications are sent and the events for which notifications are generated.'
    QueueConfigurations: NotRequired[Expr[Sequence[Expr[BucketQueueConfiguration]]]]
    'The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages.'
    LambdaConfigurations: NotRequired[Expr[Sequence[Expr[BucketLambdaConfiguration]]]]
    'Describes the LAMlong functions to invoke and the events for which to invoke them.'
    EventBridgeConfiguration: NotRequired[Expr[BucketEventBridgeConfiguration]]
    'Enables delivery of events to Amazon EventBridge.'


class BucketTransition(TypedDict, closed=True):
    'Specifies when an object transitions to a specified storage class.'
    TransitionDate: NotRequired[Expr[str]]
    'Indicates when objects are transitioned to the specified storage class.'
    StorageClass: Expr[str]
    'The storage class to which you want the object to transition.'
    TransitionInDays: NotRequired[Expr[int]]
    'Indicates the number of days after creation when objects are transitioned to the specified storage class.'


class BucketNoncurrentVersionTransition(TypedDict, closed=True):
    'Container for the transition rule that describes when noncurrent objects transition to the ``STANDARD_IA``, ``ONEZONE_IA``, ``INTELLIGENT_TIERING``, ``GLACIE...'
    StorageClass: Expr[str]
    'The class of storage used to store the object.'
    TransitionInDays: Expr[int]
    'Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action.'
    NewerNoncurrentVersions: NotRequired[Expr[int]]
    'Specifies how many noncurrent versions S3 will retain.'


class BucketNoncurrentVersionExpiration(TypedDict, closed=True):
    'Specifies when noncurrent object versions expire.'
    NoncurrentDays: Expr[int]
    'Specifies the number of days an object is noncurrent before S3 can perform the associated action.'
    NewerNoncurrentVersions: NotRequired[Expr[int]]
    'Specifies how many noncurrent versions S3 will retain.'


class BucketAbortIncompleteMultipartUpload(TypedDict, closed=True):
    'Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload.'
    DaysAfterInitiation: Expr[int]
    'Specifies the number of days after which Amazon S3 stops an incomplete multipart upload.'


class BucketRule(TypedDict, closed=True):
    'Specifies lifecycle rules for an Amazon S3 bucket.'
    Status: Expr[str]
    'If ``Enabled``, the rule is currently being applied.'
    ExpiredObjectDeleteMarker: NotRequired[Expr[bool]]
    'Indicates whether Amazon S3 will remove a delete marker without any noncurrent versions.'
    NoncurrentVersionExpirationInDays: NotRequired[Expr[int]]
    '(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 bu...'
    Transitions: NotRequired[Expr[Sequence[Expr[BucketTransition]]]]
    'One or more transition rules that specify when an object transitions to a specified storage class.'
    ObjectSizeGreaterThan: NotRequired[Expr[str]]
    'Specifies the minimum object size in bytes for this rule to apply to.'
    TagFilters: NotRequired[Expr[Sequence[Expr[BucketTagFilter]]]]
    'Tags to use to identify a subset of objects to which the lifecycle rule applies.'
    NoncurrentVersionTransitions: NotRequired[Expr[Sequence[Expr[BucketNoncurrentVersionTransition]]]]
    'For buckets with versioning enabled (or suspended), one or more transition rules that specify when non-current objects transition to a specified storage class.'
    Prefix: NotRequired[Expr[str]]
    'Object key prefix that identifies one or more objects to which this rule applies.'
    ObjectSizeLessThan: NotRequired[Expr[str]]
    'Specifies the maximum object size in bytes for this rule to apply to.'
    NoncurrentVersionTransition: NotRequired[Expr[BucketNoncurrentVersionTransition]]
    '(Deprecated.) For buckets with versioning enabled (or suspended), specifies when non-current objects transition to a specified storage class.'
    ExpirationDate: NotRequired[Expr[str]]
    'Indicates when objects are deleted from Amazon S3 and Amazon S3 Glacier.'
    NoncurrentVersionExpiration: NotRequired[Expr[BucketNoncurrentVersionExpiration]]
    'Specifies when noncurrent object versions expire.'
    ExpirationInDays: NotRequired[Expr[int]]
    'Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon S3 Glacier.'
    Transition: NotRequired[Expr[BucketTransition]]
    '(Deprecated.) Specifies when an object transitions to a specified storage class.'
    Id: NotRequired[Expr[str]]
    'Unique identifier for the rule.'
    AbortIncompleteMultipartUpload: NotRequired[Expr[BucketAbortIncompleteMultipartUpload]]
    'Specifies a lifecycle rule that stops incomplete multipart uploads to an Amazon S3 bucket.'


class BucketLifecycleConfiguration(TypedDict, closed=True):
    'Specifies the lifecycle configuration for objects in an Amazon S3 bucket.'
    TransitionDefaultMinimumObjectSize: NotRequired[Expr[str]]
    'Indicates which default minimum object size behavior is applied to the lifecycle configuration.'
    Rules: Expr[Sequence[Expr[BucketRule]]]
    'A lifecycle rule for individual objects in an Amazon S3 bucket.'


class BucketVersioningConfiguration(TypedDict, closed=True):
    'Describes the versioning state of an Amazon S3 bucket.'
    Status: Expr[str]
    'The versioning state of the bucket.'


class BucketMetricsConfiguration(TypedDict, closed=True):
    'Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket.'
    AccessPointArn: NotRequired[Expr[str]]
    'The access point that was used while performing operations on the object.'
    TagFilters: NotRequired[Expr[Sequence[Expr[BucketTagFilter]]]]
    'Specifies a list of tag filters to use as a metrics configuration filter.'
    Id: Expr[str]
    'The ID used to identify the metrics configuration.'
    Prefix: NotRequired[Expr[str]]
    'The prefix that an object must have to be included in the metrics results.'


class BucketTiering(TypedDict, closed=True):
    'The S3 Intelligent-Tiering storage class is designed to optimize storage costs by automatically moving data to the most cost-effective storage access tier, w...'
    AccessTier: Expr[str]
    'S3 Intelligent-Tiering access tier.'
    Days: Expr[int]
    'The number of consecutive days of no access after which an object will be eligible to be transitioned to the corresponding tier.'


class BucketIntelligentTieringConfiguration(TypedDict, closed=True):
    'Specifies the S3 Intelligent-Tiering configuration for an Amazon S3 bucket.'
    Status: Expr[str]
    'Specifies the status of the configuration.'
    Tierings: Expr[Sequence[Expr[BucketTiering]]]
    'Specifies a list of S3 Intelligent-Tiering storage class tiers in the configuration.'
    TagFilters: NotRequired[Expr[Sequence[Expr[BucketTagFilter]]]]
    'A container for a key-value pair.'
    Id: Expr[str]
    'The ID used to identify the S3 Intelligent-Tiering configuration.'
    Prefix: NotRequired[Expr[str]]
    'An object key name prefix that identifies the subset of objects to which the rule applies.'


class BucketCorsRule(TypedDict, closed=True):
    'Specifies a cross-origin access rule for an Amazon S3 bucket.'
    ExposedHeaders: NotRequired[Expr[list[Expr[str]]]]
    '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`` o...'
    AllowedMethods: Expr[list[Expr[str]]]
    'An HTTP method that you allow the origin to run.'
    AllowedOrigins: Expr[list[Expr[str]]]
    'One or more origins you want customers to be able to access the bucket from.'
    AllowedHeaders: NotRequired[Expr[list[Expr[str]]]]
    'Headers that are specified in the ``Access-Control-Request-Headers`` header.'
    MaxAge: NotRequired[Expr[int]]
    'The time in seconds that your browser is to cache the preflight response for the specified resource.'
    Id: NotRequired[Expr[str]]
    'A unique identifier for this rule.'


class BucketCorsConfiguration(TypedDict, closed=True):
    'Describes the cross-origin access configuration for objects in an Amazon S3 bucket.'
    CorsRules: Expr[Sequence[Expr[BucketCorsRule]]]
    'A set of origins and methods (cross-origin access that you want to allow).'


class BucketProps(TypedDict, closed=True):
    'The ``AWS::S3::Bucket`` resource creates an Amazon S3 bucket in the same AWS Region where you create the AWS CloudFormation stack.'
    BucketNamespace: NotRequired[Expr[str]]
    InventoryConfigurations: NotRequired[Expr[Sequence[Expr[BucketInventoryConfiguration]]]]
    'Specifies the S3 Inventory configuration for an Amazon S3 bucket.'
    BucketNamePrefix: NotRequired[Expr[str]]
    WebsiteConfiguration: NotRequired[Expr[BucketWebsiteConfiguration]]
    'Information used to configure the bucket as a static website.'
    AccessControl: NotRequired[Expr[str]]
    'This is a legacy property, and it is not recommended for most use cases.'
    MetadataTableConfiguration: NotRequired[Expr[BucketMetadataTableConfiguration]]
    'The metadata table configuration of an S3 general purpose bucket.'
    AnalyticsConfigurations: NotRequired[Expr[Sequence[Expr[BucketAnalyticsConfiguration]]]]
    'Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket.'
    AbacStatus: NotRequired[Expr[str]]
    'The ABAC status of the general purpose bucket.'
    AccelerateConfiguration: NotRequired[Expr[BucketAccelerateConfiguration]]
    'Configures the transfer acceleration state for an Amazon S3 bucket.'
    PublicAccessBlockConfiguration: NotRequired[Expr[BucketPublicAccessBlockConfiguration]]
    'Configuration that defines how Amazon S3 handles public access.'
    BucketName: NotRequired[Expr[str]]
    'A name for the bucket.'
    OwnershipControls: NotRequired[Expr[BucketOwnershipControls]]
    'Configuration that defines how Amazon S3 handles Object Ownership rules.'
    ObjectLockConfiguration: NotRequired[Expr[BucketObjectLockConfiguration]]
    'This operation is not supported for directory buckets.'
    ObjectLockEnabled: NotRequired[Expr[bool]]
    'Indicates whether this bucket has an Object Lock configuration enabled.'
    LoggingConfiguration: NotRequired[Expr[BucketLoggingConfiguration]]
    'Settings that define where logs are stored.'
    MetadataConfiguration: NotRequired[Expr[BucketMetadataConfiguration]]
    'The S3 Metadata configuration for a general purpose bucket.'
    ReplicationConfiguration: NotRequired[Expr[BucketReplicationConfiguration]]
    'Configuration for replicating objects in an S3 bucket.'
    Tags: NotRequired[Expr[Sequence[Expr[Tag]]]]
    'An arbitrary set of tags (key-value pairs) for this S3 bucket.'
    BucketEncryption: NotRequired[Expr[BucketBucketEncryption]]
    '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 se...'
    NotificationConfiguration: NotRequired[Expr[BucketNotificationConfiguration]]
    'Configuration that defines how Amazon S3 handles bucket notifications.'
    LifecycleConfiguration: NotRequired[Expr[BucketLifecycleConfiguration]]
    'Specifies the lifecycle configuration for objects in an Amazon S3 bucket.'
    VersioningConfiguration: NotRequired[Expr[BucketVersioningConfiguration]]
    'Enables multiple versions of all objects in this bucket.'
    MetricsConfigurations: NotRequired[Expr[Sequence[Expr[BucketMetricsConfiguration]]]]
    'Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket.'
    IntelligentTieringConfigurations: NotRequired[Expr[Sequence[Expr[BucketIntelligentTieringConfiguration]]]]
    'Defines how Amazon S3 handles Intelligent-Tiering storage.'
    CorsConfiguration: NotRequired[Expr[BucketCorsConfiguration]]
    'Describes the cross-origin access configuration for objects in an Amazon S3 bucket.'


class Bucket(ResourceAttrs):
    'The ``AWS::S3::Bucket`` resource creates an Amazon S3 bucket in the same AWS Region where you create the AWS CloudFormation stack.'
    Type: Literal['AWS::S3::Bucket']
    Properties: NotRequired[BucketProps]


def bucket(
    *,
    depends_on: DependsOn | None = None,
    deletion_policy: DeletionPolicy | None = None,
    update_replace_policy: UpdateReplacePolicy | None = None,
    condition: str | None = None,
    metadata: dict[str, Any] | None = None,
    **props: Unpack[BucketProps],
) -> Bucket:
    return build('AWS::S3::Bucket', props, depends_on, deletion_policy, update_replace_policy, condition, metadata)

Attributes

Read-only values for get_att(logical_id, attribute). They are not accepted as inputs.

  • Arn
  • DomainName
  • DualStackDomainName
  • RegionalDomainName
  • WebsiteURL