Show / Hide Table of Contents

Namespace Amazon.CDK.AWS.S3

Amazon S3 Construct Library

--- cfn-resources: Stable cdk-constructs: Stable

Define an unencrypted S3 bucket.

Bucket bucket = new Bucket(this, "MyFirstBucket");

Bucket constructs expose the following deploy-time attributes:

    Encryption

    Define a KMS-encrypted bucket:

    Bucket bucket = new Bucket(this, "MyEncryptedBucket", new BucketProps {
        Encryption = BucketEncryption.KMS
    });
    
    // you can access the encryption key:
    Assert(bucket.EncryptionKey instanceof Key);

    You can also supply your own key:

    Key myKmsKey = new Key(this, "MyKey");
    
    Bucket bucket = new Bucket(this, "MyEncryptedBucket", new BucketProps {
        Encryption = BucketEncryption.KMS,
        EncryptionKey = myKmsKey
    });
    
    Assert(bucket.EncryptionKey == myKmsKey);

    Enable KMS-SSE encryption via S3 Bucket Keys:

    Bucket bucket = new Bucket(this, "MyEncryptedBucket", new BucketProps {
        Encryption = BucketEncryption.KMS,
        BucketKeyEnabled = true
    });

    Use BucketEncryption.ManagedKms to use the S3 master KMS key:

    Bucket bucket = new Bucket(this, "Buck", new BucketProps {
        Encryption = BucketEncryption.KMS_MANAGED
    });
    
    Assert(bucket.EncryptionKey == null);

    Permissions

    A bucket policy will be automatically created for the bucket upon the first call to addToResourcePolicy(statement):

    Bucket bucket = new Bucket(this, "MyBucket");
    AddToResourcePolicyResult result = bucket.AddToResourcePolicy(new PolicyStatement(new PolicyStatementProps {
        Actions = new [] { "s3:GetObject" },
        Resources = new [] { bucket.ArnForObjects("file.txt") },
        Principals = new [] { new AccountRootPrincipal() }
    }));

    If you try to add a policy statement to an existing bucket, this method will not do anything:

    IBucket bucket = Bucket.FromBucketName(this, "existingBucket", "bucket-name");
    
    // No policy statement will be added to the resource
    AddToResourcePolicyResult result = bucket.AddToResourcePolicy(new PolicyStatement(new PolicyStatementProps {
        Actions = new [] { "s3:GetObject" },
        Resources = new [] { bucket.ArnForObjects("file.txt") },
        Principals = new [] { new AccountRootPrincipal() }
    }));

    That's because it's not possible to tell whether the bucket already has a policy attached, let alone to re-use that policy to add more statements to it. We recommend that you always check the result of the call:

    Bucket bucket = new Bucket(this, "MyBucket");
    AddToResourcePolicyResult result = bucket.AddToResourcePolicy(new PolicyStatement(new PolicyStatementProps {
        Actions = new [] { "s3:GetObject" },
        Resources = new [] { bucket.ArnForObjects("file.txt") },
        Principals = new [] { new AccountRootPrincipal() }
    }));
    
    if (!result.StatementAdded)
    {
    }

    The bucket policy can be directly accessed after creation to add statements or adjust the removal policy.

    Bucket bucket = new Bucket(this, "MyBucket");
    bucket.Policy.ApplyRemovalPolicy(RemovalPolicy.RETAIN);

    Most of the time, you won't have to manipulate the bucket policy directly. Instead, buckets have "grant" methods called to give prepackaged sets of permissions to other resources. For example:

    Function myLambda;
    
    
    Bucket bucket = new Bucket(this, "MyBucket");
    bucket.GrantReadWrite(myLambda);

    Will give the Lambda's execution role permissions to read and write from the bucket.

    AWS Foundational Security Best Practices

    Enforcing SSL

    To require all requests use Secure Socket Layer (SSL):

    Bucket bucket = new Bucket(this, "Bucket", new BucketProps {
        EnforceSSL = true
    });

    Sharing buckets between stacks

    To use a bucket in a different stack in the same CDK application, pass the object to the other stack:

    /**
     * Stack that defines the bucket
     */
    class Producer : Stack
    {
        public Bucket MyBucket { get; }
    
        public Producer(App scope, string id, StackProps? props=null) : base(scope, id, props)
        {
    
            Bucket bucket = new Bucket(this, "MyBucket", new BucketProps {
                RemovalPolicy = RemovalPolicy.DESTROY
            });
            MyBucket = bucket;
        }
    }
    
    class ConsumerProps : StackProps
    {
        public IBucket UserBucket { get; set; }
    }
    
    /**
     * Stack that consumes the bucket
     */
    class Consumer : Stack
    {
        public Consumer(App scope, string id, ConsumerProps props) : base(scope, id, props)
        {
    
            User user = new User(this, "MyUser");
            props.UserBucket.GrantReadWrite(user);
        }
    }
    
    Producer producer = new Producer(app, "ProducerStack");
    new Consumer(app, "ConsumerStack", new ConsumerProps { UserBucket = producer.MyBucket });

    Importing existing buckets

    To import an existing bucket into your CDK application, use the Bucket.fromBucketAttributes factory method. This method accepts BucketAttributes which describes the properties of an already existing bucket:

    Function myLambda;
    
    IBucket bucket = Bucket.FromBucketAttributes(this, "ImportedBucket", new BucketAttributes {
        BucketArn = "arn:aws:s3:::my-bucket"
    });
    
    // now you can just call methods on the bucket
    bucket.AddEventNotification(EventType.OBJECT_CREATED, new LambdaDestination(myLambda), new NotificationKeyFilter { Prefix = "home/myusername/*" });

    Alternatively, short-hand factories are available as Bucket.fromBucketName and Bucket.fromBucketArn, which will derive all bucket attributes from the bucket name or ARN respectively:

    IBucket byName = Bucket.FromBucketName(this, "BucketByName", "my-bucket");
    IBucket byArn = Bucket.FromBucketArn(this, "BucketByArn", "arn:aws:s3:::my-bucket");

    The bucket's region defaults to the current stack's region, but can also be explicitly set in cases where one of the bucket's regional properties needs to contain the correct values.

    IBucket myCrossRegionBucket = Bucket.FromBucketAttributes(this, "CrossRegionImport", new BucketAttributes {
        BucketArn = "arn:aws:s3:::my-bucket",
        Region = "us-east-1"
    });

    Bucket Notifications

    The Amazon S3 notification feature enables you to receive notifications when certain events happen in your bucket as described under [S3 Bucket Notifications] of the S3 Developer Guide.

    To subscribe for bucket notifications, use the bucket.addEventNotification method. The bucket.addObjectCreatedNotification and bucket.addObjectRemovedNotification can also be used for these common use cases.

    The following example will subscribe an SNS topic to be notified of all s3:ObjectCreated:* events:

    Bucket bucket = new Bucket(this, "MyBucket");
    Topic topic = new Topic(this, "MyTopic");
    bucket.AddEventNotification(EventType.OBJECT_CREATED, new SnsDestination(topic));

    This call will also ensure that the topic policy can accept notifications for this specific bucket.

    Supported S3 notification targets are exposed by the @aws-cdk/aws-s3-notifications package.

    It is also possible to specify S3 object key filters when subscribing. The following example will notify myQueue when objects prefixed with foo/ and have the .jpg suffix are removed from the bucket.

    Queue myQueue;
    
    Bucket bucket = new Bucket(this, "MyBucket");
    bucket.AddEventNotification(EventType.OBJECT_REMOVED,
    new SqsDestination(myQueue), new NotificationKeyFilter { Prefix = "foo/", Suffix = ".jpg" });

    Adding notifications on existing buckets:

    Topic topic;
    
    IBucket bucket = Bucket.FromBucketAttributes(this, "ImportedBucket", new BucketAttributes {
        BucketArn = "arn:aws:s3:::my-bucket"
    });
    bucket.AddEventNotification(EventType.OBJECT_CREATED, new SnsDestination(topic));

    When you add an event notification to a bucket, a custom resource is created to manage the notifications. By default, a new role is created for the Lambda function that implements this feature. If you want to use your own role instead, you should provide it in the Bucket constructor:

    IRole myRole;
    
    Bucket bucket = new Bucket(this, "MyBucket", new BucketProps {
        NotificationsHandlerRole = myRole
    });

    Whatever role you provide, the CDK will try to modify it by adding the permissions from AWSLambdaBasicExecutionRole (an AWS managed policy) as well as the permissions s3:PutBucketNotification and s3:GetBucketNotification. If you’re passing an imported role, and you don’t want this to happen, configure it to be immutable:

    IRole importedRole = Role.FromRoleArn(this, "role", "arn:aws:iam::123456789012:role/RoleName", new FromRoleArnOptions {
        Mutable = false
    });
    If you provide an imported immutable role, make sure that it has at least all
    the permissions mentioned above. Otherwise, the deployment will fail!
    

    EventBridge notifications

    Amazon S3 can send events to Amazon EventBridge whenever certain events happen in your bucket. Unlike other destinations, you don't need to select which event types you want to deliver.

    The following example will enable EventBridge notifications:

    Bucket bucket = new Bucket(this, "MyEventBridgeBucket", new BucketProps {
        EventBridgeEnabled = true
    });

    Block Public Access

    Use blockPublicAccess to specify block public access settings on the bucket.

    Enable all block public access settings:

    Bucket bucket = new Bucket(this, "MyBlockedBucket", new BucketProps {
        BlockPublicAccess = BlockPublicAccess.BLOCK_ALL
    });

    Block and ignore public ACLs:

    Bucket bucket = new Bucket(this, "MyBlockedBucket", new BucketProps {
        BlockPublicAccess = BlockPublicAccess.BLOCK_ACLS
    });

    Alternatively, specify the settings manually:

    Bucket bucket = new Bucket(this, "MyBlockedBucket", new BucketProps {
        BlockPublicAccess = new BlockPublicAccess(new BlockPublicAccessOptions { BlockPublicPolicy = true })
    });

    When blockPublicPolicy is set to true, grantPublicRead() throws an error.

    Logging configuration

    Use serverAccessLogsBucket to describe where server access logs are to be stored.

    Bucket accessLogsBucket = new Bucket(this, "AccessLogsBucket");
    
    Bucket bucket = new Bucket(this, "MyBucket", new BucketProps {
        ServerAccessLogsBucket = accessLogsBucket
    });

    It's also possible to specify a prefix for Amazon S3 to assign to all log object keys.

    Bucket accessLogsBucket = new Bucket(this, "AccessLogsBucket");
    
    Bucket bucket = new Bucket(this, "MyBucket", new BucketProps {
        ServerAccessLogsBucket = accessLogsBucket,
        ServerAccessLogsPrefix = "logs"
    });

    S3 Inventory

    An inventory contains a list of the objects in the source bucket and metadata for each object. The inventory lists are stored in the destination bucket as a CSV file compressed with GZIP, as an Apache optimized row columnar (ORC) file compressed with ZLIB, or as an Apache Parquet (Parquet) file compressed with Snappy.

    You can configure multiple inventory lists for a bucket. You can configure what object metadata to include in the inventory, whether to list all object versions or only current versions, where to store the inventory list file output, and whether to generate the inventory on a daily or weekly basis.

    Bucket inventoryBucket = new Bucket(this, "InventoryBucket");
    
    Bucket dataBucket = new Bucket(this, "DataBucket", new BucketProps {
        Inventories = new [] { new Inventory {
            Frequency = InventoryFrequency.DAILY,
            IncludeObjectVersions = InventoryObjectVersion.CURRENT,
            Destination = new InventoryDestination {
                Bucket = inventoryBucket
            }
        }, new Inventory {
            Frequency = InventoryFrequency.WEEKLY,
            IncludeObjectVersions = InventoryObjectVersion.ALL,
            Destination = new InventoryDestination {
                Bucket = inventoryBucket,
                Prefix = "with-all-versions"
            }
        } }
    });

    If the destination bucket is created as part of the same CDK application, the necessary permissions will be automatically added to the bucket policy. However, if you use an imported bucket (i.e Bucket.fromXXX()), you'll have to make sure it contains the following policy document:

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "InventoryAndAnalyticsExamplePolicy",
          "Effect": "Allow",
          "Principal": { "Service": "s3.amazonaws.com" },
          "Action": "s3:PutObject",
          "Resource": ["arn:aws:s3:::destinationBucket/*"]
        }
      ]
    }

    Website redirection

    You can use the two following properties to specify the bucket redirection policy. Please note that these methods cannot both be applied to the same bucket.

    Static redirection

    You can statically redirect a to a given Bucket URL or any other host name with websiteRedirect:

    Bucket bucket = new Bucket(this, "MyRedirectedBucket", new BucketProps {
        WebsiteRedirect = new RedirectTarget { HostName = "www.example.com" }
    });

    Routing rules

    Alternatively, you can also define multiple websiteRoutingRules, to define complex, conditional redirections:

    Bucket bucket = new Bucket(this, "MyRedirectedBucket", new BucketProps {
        WebsiteRoutingRules = new [] { new RoutingRule {
            HostName = "www.example.com",
            HttpRedirectCode = "302",
            Protocol = RedirectProtocol.HTTPS,
            ReplaceKey = ReplaceKey.PrefixWith("test/"),
            Condition = new RoutingRuleCondition {
                HttpErrorCodeReturnedEquals = "200",
                KeyPrefixEquals = "prefix"
            }
        } }
    });

    Filling the bucket as part of deployment

    To put files into a bucket as part of a deployment (for example, to host a website), see the @aws-cdk/aws-s3-deployment package, which provides a resource that can do just that.

    The URL for objects

    S3 provides two types of URLs for accessing objects via HTTP(S). Path-Style and Virtual Hosted-Style URL. Path-Style is a classic way and will be deprecated. We recommend to use Virtual Hosted-Style URL for newly made bucket.

    You can generate both of them.

    Bucket bucket = new Bucket(this, "MyBucket");
    bucket.UrlForObject("objectname"); // Path-Style URL
    bucket.VirtualHostedUrlForObject("objectname"); // Virtual Hosted-Style URL
    bucket.VirtualHostedUrlForObject("objectname", new VirtualHostedStyleUrlOptions { Regional = false });

    Object Ownership

    You can use one of following properties to specify the bucket object Ownership.

    Object writer

    The Uploading account will own the object.

    new Bucket(this, "MyBucket", new BucketProps {
        ObjectOwnership = ObjectOwnership.OBJECT_WRITER
    });

    Bucket owner preferred

    The bucket owner will own the object if the object is uploaded with the bucket-owner-full-control canned ACL. Without this setting and canned ACL, the object is uploaded and remains owned by the uploading account.

    new Bucket(this, "MyBucket", new BucketProps {
        ObjectOwnership = ObjectOwnership.BUCKET_OWNER_PREFERRED
    });

    Bucket owner enforced (recommended)

    ACLs are disabled, and the bucket owner automatically owns and has full control over every object in the bucket. ACLs no longer affect permissions to data in the S3 bucket. The bucket uses policies to define access control.

    new Bucket(this, "MyBucket", new BucketProps {
        ObjectOwnership = ObjectOwnership.BUCKET_OWNER_ENFORCED
    });

    Bucket deletion

    When a bucket is removed from a stack (or the stack is deleted), the S3 bucket will be removed according to its removal policy (which by default will simply orphan the bucket and leave it in your AWS account). If the removal policy is set to RemovalPolicy.DESTROY, the bucket will be deleted as long as it does not contain any objects.

    To override this and force all objects to get deleted during bucket deletion, enable theautoDeleteObjects option.

    Bucket bucket = new Bucket(this, "MyTempFileBucket", new BucketProps {
        RemovalPolicy = RemovalPolicy.DESTROY,
        AutoDeleteObjects = true
    });

    Warning if you have deployed a bucket with autoDeleteObjects: true, switching this to false in a CDK version before 1.126.0 will lead to all objects in the bucket being deleted. Be sure to update your bucket resources by deploying with CDK version 1.126.0 or later before switching this value to false.

    Transfer Acceleration

    Transfer Acceleration can be configured to enable fast, easy, and secure transfers of files over long distances:

    Bucket bucket = new Bucket(this, "MyBucket", new BucketProps {
        TransferAcceleration = true
    });

    To access the bucket that is enabled for Transfer Acceleration, you must use a special endpoint. The URL can be generated using method transferAccelerationUrlForObject:

    Bucket bucket = new Bucket(this, "MyBucket", new BucketProps {
        TransferAcceleration = true
    });
    bucket.TransferAccelerationUrlForObject("objectname");

    Intelligent Tiering

    Intelligent Tiering can be configured to automatically move files to glacier:

    new Bucket(this, "MyBucket", new BucketProps {
        IntelligentTieringConfigurations = new [] { new IntelligentTieringConfiguration {
            Name = "foo",
            Prefix = "folder/name",
            ArchiveAccessTierTime = Duration.Days(90),
            DeepArchiveAccessTierTime = Duration.Days(180),
            Tags = new [] { new Tag { Key = "tagname", Value = "tagvalue" } }
        } }
    });

    Lifecycle Rule

    Managing lifecycle can be configured transition or expiration actions.

    Bucket bucket = new Bucket(this, "MyBucket", new BucketProps {
        LifecycleRules = new [] { new LifecycleRule {
            AbortIncompleteMultipartUploadAfter = Duration.Minutes(30),
            Enabled = false,
            Expiration = Duration.Days(30),
            ExpirationDate = new Date(),
            ExpiredObjectDeleteMarker = false,
            Id = "id",
            NoncurrentVersionExpiration = Duration.Days(30),
    
            // the properties below are optional
            NoncurrentVersionsToRetain = 123,
            NoncurrentVersionTransitions = new [] { new NoncurrentVersionTransition {
                StorageClass = StorageClass.GLACIER,
                TransitionAfter = Duration.Days(30),
    
                // the properties below are optional
                NoncurrentVersionsToRetain = 123
            } },
            ObjectSizeGreaterThan = 500,
            Prefix = "prefix",
            ObjectSizeLessThan = 10000,
            Transitions = new [] { new Transition {
                StorageClass = StorageClass.GLACIER,
    
                // the properties below are optional
                TransitionAfter = Duration.Days(30),
                TransitionDate = new Date()
            } }
        } }
    });

    Classes

    BlockPublicAccess
    BlockPublicAccessOptions
    Bucket

    An S3 bucket with associated policy objects.

    BucketAccessControl

    Default bucket access control types.

    BucketAttributes

    A reference to a bucket outside this stack.

    BucketBase

    Represents an S3 Bucket.

    BucketEncryption

    What kind of server-side encryption to apply to this bucket.

    BucketMetrics

    Specifies a metrics configuration for the CloudWatch request metrics from an Amazon S3 bucket.

    BucketNotificationDestinationConfig

    Represents the properties of a notification destination.

    BucketNotificationDestinationType

    Supported types of notification destinations.

    BucketPolicy

    The bucket policy for an Amazon S3 bucket.

    BucketPolicyProps
    BucketProps
    CfnAccessPoint

    A CloudFormation AWS::S3::AccessPoint.

    CfnAccessPoint.PolicyStatusProperty

    The container element for a bucket's policy status.

    CfnAccessPoint.PublicAccessBlockConfigurationProperty

    The PublicAccessBlock configuration that you want to apply to this Amazon S3 bucket.

    CfnAccessPoint.VpcConfigurationProperty

    The Virtual Private Cloud (VPC) configuration for this access point.

    CfnAccessPointProps

    Properties for defining a CfnAccessPoint.

    CfnBucket

    A CloudFormation AWS::S3::Bucket.

    CfnBucket.AbortIncompleteMultipartUploadProperty

    Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload.

    CfnBucket.AccelerateConfigurationProperty

    Configures the transfer acceleration state for an Amazon S3 bucket.

    CfnBucket.AccessControlTranslationProperty

    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.

    CfnBucket.AnalyticsConfigurationProperty

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

    CfnBucket.BucketEncryptionProperty

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

    CfnBucket.CorsConfigurationProperty

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

    CfnBucket.CorsRuleProperty

    Specifies a cross-origin access rule for an Amazon S3 bucket.

    CfnBucket.DataExportProperty

    Specifies how data related to the storage class analysis for an Amazon S3 bucket should be exported.

    CfnBucket.DefaultRetentionProperty

    The container element for specifying the default Object Lock retention settings for new objects placed in the specified bucket.

    CfnBucket.DeleteMarkerReplicationProperty

    Specifies whether Amazon S3 replicates delete markers.

    CfnBucket.DestinationProperty

    Specifies information about where to publish analysis or configuration results for an Amazon S3 bucket.

    CfnBucket.EncryptionConfigurationProperty

    Specifies encryption-related information for an Amazon S3 bucket that is a destination for replicated objects.

    CfnBucket.EventBridgeConfigurationProperty

    Amazon S3 can send events to Amazon EventBridge whenever certain events happen in your bucket, see Using EventBridge in the Amazon S3 User Guide .

    CfnBucket.FilterRuleProperty

    Specifies the Amazon S3 object key name to filter on and whether to filter on the suffix or prefix of the key name.

    CfnBucket.IntelligentTieringConfigurationProperty

    Specifies the S3 Intelligent-Tiering configuration for an Amazon S3 bucket.

    CfnBucket.InventoryConfigurationProperty

    Specifies the inventory configuration for an Amazon S3 bucket.

    CfnBucket.LambdaConfigurationProperty

    Describes the AWS Lambda functions to invoke and the events for which to invoke them.

    CfnBucket.LifecycleConfigurationProperty

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

    CfnBucket.LoggingConfigurationProperty

    Describes where logs are stored and the prefix that Amazon S3 assigns to all log object keys for a bucket.

    CfnBucket.MetricsConfigurationProperty

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

    CfnBucket.MetricsProperty

    A container specifying replication metrics-related settings enabling replication metrics and events.

    CfnBucket.NoncurrentVersionExpirationProperty

    Specifies when noncurrent object versions expire.

    CfnBucket.NoncurrentVersionTransitionProperty

    Container for the transition rule that describes when noncurrent objects transition to the STANDARD_IA , ONEZONE_IA , INTELLIGENT_TIERING , GLACIER_IR , GLACIER , or DEEP_ARCHIVE storage class.

    CfnBucket.NotificationConfigurationProperty

    Describes the notification configuration for an Amazon S3 bucket.

    CfnBucket.NotificationFilterProperty

    Specifies object key name filtering rules.

    CfnBucket.ObjectLockConfigurationProperty

    Places an Object Lock configuration on the specified bucket.

    CfnBucket.ObjectLockRuleProperty

    Specifies the Object Lock rule for the specified object.

    CfnBucket.OwnershipControlsProperty

    Specifies the container element for Object Ownership rules.

    CfnBucket.OwnershipControlsRuleProperty

    Specifies an Object Ownership rule.

    CfnBucket.PublicAccessBlockConfigurationProperty

    The PublicAccessBlock configuration that you want to apply to this Amazon S3 bucket.

    CfnBucket.QueueConfigurationProperty

    Specifies the configuration for publishing messages to an Amazon Simple Queue Service (Amazon SQS) queue when Amazon S3 detects specified events.

    CfnBucket.RedirectAllRequestsToProperty

    Specifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket.

    CfnBucket.RedirectRuleProperty

    Specifies how requests are redirected.

    CfnBucket.ReplicaModificationsProperty

    A filter that you can specify for selection for modifications on replicas.

    CfnBucket.ReplicationConfigurationProperty

    A container for replication rules.

    CfnBucket.ReplicationDestinationProperty

    A container for information about the replication destination and its configurations including enabling the S3 Replication Time Control (S3 RTC).

    CfnBucket.ReplicationRuleAndOperatorProperty

    A container for specifying rule filters.

    CfnBucket.ReplicationRuleFilterProperty

    A filter that identifies the subset of objects to which the replication rule applies.

    CfnBucket.ReplicationRuleProperty

    Specifies which Amazon S3 objects to replicate and where to store the replicas.

    CfnBucket.ReplicationTimeProperty

    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.

    CfnBucket.ReplicationTimeValueProperty

    A container specifying the time value for S3 Replication Time Control (S3 RTC) and replication metrics EventThreshold .

    CfnBucket.RoutingRuleConditionProperty

    A container for describing a condition that must be met for the specified redirect to apply.

    CfnBucket.RoutingRuleProperty

    Specifies the redirect behavior and when a redirect is applied.

    CfnBucket.RuleProperty

    Specifies lifecycle rules for an Amazon S3 bucket.

    CfnBucket.S3KeyFilterProperty

    A container for object key name prefix and suffix filtering rules.

    CfnBucket.ServerSideEncryptionByDefaultProperty

    Describes the default server-side encryption to apply to new objects in the bucket.

    CfnBucket.ServerSideEncryptionRuleProperty

    Specifies the default server-side encryption configuration.

    CfnBucket.SourceSelectionCriteriaProperty

    A container that describes additional filters for identifying the source objects that you want to replicate.

    CfnBucket.SseKmsEncryptedObjectsProperty

    A container for filter information for the selection of S3 objects encrypted with AWS KMS.

    CfnBucket.StorageClassAnalysisProperty

    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.

    CfnBucket.TagFilterProperty

    Specifies tags to use to identify a subset of objects for an Amazon S3 bucket.

    CfnBucket.TieringProperty

    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.

    CfnBucket.TopicConfigurationProperty

    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.

    CfnBucket.TransitionProperty

    Specifies when an object transitions to a specified storage class.

    CfnBucket.VersioningConfigurationProperty

    Describes the versioning state of an Amazon S3 bucket.

    CfnBucket.WebsiteConfigurationProperty

    Specifies website configuration parameters for an Amazon S3 bucket.

    CfnBucketPolicy

    A CloudFormation AWS::S3::BucketPolicy.

    CfnBucketPolicyProps

    Properties for defining a CfnBucketPolicy.

    CfnBucketProps

    Properties for defining a CfnBucket.

    CfnMultiRegionAccessPoint

    A CloudFormation AWS::S3::MultiRegionAccessPoint.

    CfnMultiRegionAccessPoint.PublicAccessBlockConfigurationProperty

    The PublicAccessBlock configuration that you want to apply to this Amazon S3 Multi-Region Access Point.

    CfnMultiRegionAccessPoint.RegionProperty

    A bucket associated with a specific Region when creating Multi-Region Access Points.

    CfnMultiRegionAccessPointPolicy

    A CloudFormation AWS::S3::MultiRegionAccessPointPolicy.

    CfnMultiRegionAccessPointPolicy.PolicyStatusProperty

    The container element for a bucket's policy status.

    CfnMultiRegionAccessPointPolicyProps

    Properties for defining a CfnMultiRegionAccessPointPolicy.

    CfnMultiRegionAccessPointProps

    Properties for defining a CfnMultiRegionAccessPoint.

    CfnStorageLens

    A CloudFormation AWS::S3::StorageLens.

    CfnStorageLens.AccountLevelProperty

    This resource contains the details of the account-level metrics for Amazon S3 Storage Lens.

    CfnStorageLens.ActivityMetricsProperty

    This resource enables Amazon S3 Storage Lens activity metrics.

    CfnStorageLens.AdvancedCostOptimizationMetricsProperty

    This resource enables Amazon S3 Storage Lens advanced cost optimization metrics.

    CfnStorageLens.AdvancedDataProtectionMetricsProperty

    This resource enables Amazon S3 Storage Lens advanced data protection metrics.

    CfnStorageLens.AwsOrgProperty

    This resource contains the details of the AWS Organization for Amazon S3 Storage Lens.

    CfnStorageLens.BucketLevelProperty

    A property for the bucket-level storage metrics for Amazon S3 Storage Lens.

    CfnStorageLens.BucketsAndRegionsProperty

    This resource contains the details of the buckets and Regions for the Amazon S3 Storage Lens configuration.

    CfnStorageLens.CloudWatchMetricsProperty

    This resource enables the Amazon CloudWatch publishing option for Amazon S3 Storage Lens metrics.

    CfnStorageLens.DataExportProperty

    This resource contains the details of the Amazon S3 Storage Lens metrics export.

    CfnStorageLens.DetailedStatusCodesMetricsProperty

    This resource enables Amazon S3 Storage Lens detailed status code metrics.

    CfnStorageLens.EncryptionProperty

    This resource contains the type of server-side encryption used to encrypt an Amazon S3 Storage Lens metrics export.

    CfnStorageLens.PrefixLevelProperty

    This resource contains the details of the prefix-level of the Amazon S3 Storage Lens.

    CfnStorageLens.PrefixLevelStorageMetricsProperty

    This resource contains the details of the prefix-level storage metrics for Amazon S3 Storage Lens.

    CfnStorageLens.S3BucketDestinationProperty

    This resource contains the details of the bucket where the Amazon S3 Storage Lens metrics export will be placed.

    CfnStorageLens.SelectionCriteriaProperty

    This resource contains the details of the Amazon S3 Storage Lens selection criteria.

    CfnStorageLens.SSEKMSProperty

    Specifies the use of server-side encryption using an AWS Key Management Service key (SSE-KMS) to encrypt the delivered S3 Storage Lens metrics export file.

    CfnStorageLens.StorageLensConfigurationProperty

    This is the property of the Amazon S3 Storage Lens configuration.

    CfnStorageLensProps

    Properties for defining a CfnStorageLens.

    CorsRule

    Specifies a cross-origin access rule for an Amazon S3 bucket.

    EventType

    Notification event types.

    HttpMethods

    All http request methods.

    IntelligentTieringConfiguration

    The intelligent tiering configuration.

    Inventory

    Specifies the inventory configuration of an S3 Bucket.

    InventoryDestination

    The destination of the inventory.

    InventoryFormat

    All supported inventory list formats.

    InventoryFrequency

    All supported inventory frequencies.

    InventoryObjectVersion

    Inventory version support.

    LifecycleRule

    Declaration of a Life cycle rule.

    Location

    An interface that represents the location of a specific object in an S3 Bucket.

    NoncurrentVersionTransition

    Describes when noncurrent versions transition to a specified storage class.

    NotificationKeyFilter
    ObjectOwnership

    The ObjectOwnership of the bucket.

    OnCloudTrailBucketEventOptions

    Options for the onCloudTrailPutObject method.

    RedirectProtocol

    All http request methods.

    RedirectTarget

    Specifies a redirect behavior of all requests to a website endpoint of a bucket.

    ReplaceKey
    RoutingRule

    Rule that define when a redirect is applied and the redirect behavior.

    RoutingRuleCondition
    StorageClass

    Storage class to move an object to.

    Tag

    Tag.

    TransferAccelerationUrlOptions

    Options for creating a Transfer Acceleration URL.

    Transition

    Describes when an object transitions to a specified storage class.

    VirtualHostedStyleUrlOptions

    Options for creating Virtual-Hosted style URL.

    Interfaces

    CfnAccessPoint.IPolicyStatusProperty

    The container element for a bucket's policy status.

    CfnAccessPoint.IPublicAccessBlockConfigurationProperty

    The PublicAccessBlock configuration that you want to apply to this Amazon S3 bucket.

    CfnAccessPoint.IVpcConfigurationProperty

    The Virtual Private Cloud (VPC) configuration for this access point.

    CfnBucket.IAbortIncompleteMultipartUploadProperty

    Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload.

    CfnBucket.IAccelerateConfigurationProperty

    Configures the transfer acceleration state for an Amazon S3 bucket.

    CfnBucket.IAccessControlTranslationProperty

    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.

    CfnBucket.IAnalyticsConfigurationProperty

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

    CfnBucket.IBucketEncryptionProperty

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

    CfnBucket.ICorsConfigurationProperty

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

    CfnBucket.ICorsRuleProperty

    Specifies a cross-origin access rule for an Amazon S3 bucket.

    CfnBucket.IDataExportProperty

    Specifies how data related to the storage class analysis for an Amazon S3 bucket should be exported.

    CfnBucket.IDefaultRetentionProperty

    The container element for specifying the default Object Lock retention settings for new objects placed in the specified bucket.

    CfnBucket.IDeleteMarkerReplicationProperty

    Specifies whether Amazon S3 replicates delete markers.

    CfnBucket.IDestinationProperty

    Specifies information about where to publish analysis or configuration results for an Amazon S3 bucket.

    CfnBucket.IEncryptionConfigurationProperty

    Specifies encryption-related information for an Amazon S3 bucket that is a destination for replicated objects.

    CfnBucket.IEventBridgeConfigurationProperty

    Amazon S3 can send events to Amazon EventBridge whenever certain events happen in your bucket, see Using EventBridge in the Amazon S3 User Guide .

    CfnBucket.IFilterRuleProperty

    Specifies the Amazon S3 object key name to filter on and whether to filter on the suffix or prefix of the key name.

    CfnBucket.IIntelligentTieringConfigurationProperty

    Specifies the S3 Intelligent-Tiering configuration for an Amazon S3 bucket.

    CfnBucket.IInventoryConfigurationProperty

    Specifies the inventory configuration for an Amazon S3 bucket.

    CfnBucket.ILambdaConfigurationProperty

    Describes the AWS Lambda functions to invoke and the events for which to invoke them.

    CfnBucket.ILifecycleConfigurationProperty

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

    CfnBucket.ILoggingConfigurationProperty

    Describes where logs are stored and the prefix that Amazon S3 assigns to all log object keys for a bucket.

    CfnBucket.IMetricsConfigurationProperty

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

    CfnBucket.IMetricsProperty

    A container specifying replication metrics-related settings enabling replication metrics and events.

    CfnBucket.INoncurrentVersionExpirationProperty

    Specifies when noncurrent object versions expire.

    CfnBucket.INoncurrentVersionTransitionProperty

    Container for the transition rule that describes when noncurrent objects transition to the STANDARD_IA , ONEZONE_IA , INTELLIGENT_TIERING , GLACIER_IR , GLACIER , or DEEP_ARCHIVE storage class.

    CfnBucket.INotificationConfigurationProperty

    Describes the notification configuration for an Amazon S3 bucket.

    CfnBucket.INotificationFilterProperty

    Specifies object key name filtering rules.

    CfnBucket.IObjectLockConfigurationProperty

    Places an Object Lock configuration on the specified bucket.

    CfnBucket.IObjectLockRuleProperty

    Specifies the Object Lock rule for the specified object.

    CfnBucket.IOwnershipControlsProperty

    Specifies the container element for Object Ownership rules.

    CfnBucket.IOwnershipControlsRuleProperty

    Specifies an Object Ownership rule.

    CfnBucket.IPublicAccessBlockConfigurationProperty

    The PublicAccessBlock configuration that you want to apply to this Amazon S3 bucket.

    CfnBucket.IQueueConfigurationProperty

    Specifies the configuration for publishing messages to an Amazon Simple Queue Service (Amazon SQS) queue when Amazon S3 detects specified events.

    CfnBucket.IRedirectAllRequestsToProperty

    Specifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket.

    CfnBucket.IRedirectRuleProperty

    Specifies how requests are redirected.

    CfnBucket.IReplicaModificationsProperty

    A filter that you can specify for selection for modifications on replicas.

    CfnBucket.IReplicationConfigurationProperty

    A container for replication rules.

    CfnBucket.IReplicationDestinationProperty

    A container for information about the replication destination and its configurations including enabling the S3 Replication Time Control (S3 RTC).

    CfnBucket.IReplicationRuleAndOperatorProperty

    A container for specifying rule filters.

    CfnBucket.IReplicationRuleFilterProperty

    A filter that identifies the subset of objects to which the replication rule applies.

    CfnBucket.IReplicationRuleProperty

    Specifies which Amazon S3 objects to replicate and where to store the replicas.

    CfnBucket.IReplicationTimeProperty

    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.

    CfnBucket.IReplicationTimeValueProperty

    A container specifying the time value for S3 Replication Time Control (S3 RTC) and replication metrics EventThreshold .

    CfnBucket.IRoutingRuleConditionProperty

    A container for describing a condition that must be met for the specified redirect to apply.

    CfnBucket.IRoutingRuleProperty

    Specifies the redirect behavior and when a redirect is applied.

    CfnBucket.IRuleProperty

    Specifies lifecycle rules for an Amazon S3 bucket.

    CfnBucket.IS3KeyFilterProperty

    A container for object key name prefix and suffix filtering rules.

    CfnBucket.IServerSideEncryptionByDefaultProperty

    Describes the default server-side encryption to apply to new objects in the bucket.

    CfnBucket.IServerSideEncryptionRuleProperty

    Specifies the default server-side encryption configuration.

    CfnBucket.ISourceSelectionCriteriaProperty

    A container that describes additional filters for identifying the source objects that you want to replicate.

    CfnBucket.ISseKmsEncryptedObjectsProperty

    A container for filter information for the selection of S3 objects encrypted with AWS KMS.

    CfnBucket.IStorageClassAnalysisProperty

    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.

    CfnBucket.ITagFilterProperty

    Specifies tags to use to identify a subset of objects for an Amazon S3 bucket.

    CfnBucket.ITieringProperty

    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.

    CfnBucket.ITopicConfigurationProperty

    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.

    CfnBucket.ITransitionProperty

    Specifies when an object transitions to a specified storage class.

    CfnBucket.IVersioningConfigurationProperty

    Describes the versioning state of an Amazon S3 bucket.

    CfnBucket.IWebsiteConfigurationProperty

    Specifies website configuration parameters for an Amazon S3 bucket.

    CfnMultiRegionAccessPoint.IPublicAccessBlockConfigurationProperty

    The PublicAccessBlock configuration that you want to apply to this Amazon S3 Multi-Region Access Point.

    CfnMultiRegionAccessPoint.IRegionProperty

    A bucket associated with a specific Region when creating Multi-Region Access Points.

    CfnMultiRegionAccessPointPolicy.IPolicyStatusProperty

    The container element for a bucket's policy status.

    CfnStorageLens.IAccountLevelProperty

    This resource contains the details of the account-level metrics for Amazon S3 Storage Lens.

    CfnStorageLens.IActivityMetricsProperty

    This resource enables Amazon S3 Storage Lens activity metrics.

    CfnStorageLens.IAdvancedCostOptimizationMetricsProperty

    This resource enables Amazon S3 Storage Lens advanced cost optimization metrics.

    CfnStorageLens.IAdvancedDataProtectionMetricsProperty

    This resource enables Amazon S3 Storage Lens advanced data protection metrics.

    CfnStorageLens.IAwsOrgProperty

    This resource contains the details of the AWS Organization for Amazon S3 Storage Lens.

    CfnStorageLens.IBucketLevelProperty

    A property for the bucket-level storage metrics for Amazon S3 Storage Lens.

    CfnStorageLens.IBucketsAndRegionsProperty

    This resource contains the details of the buckets and Regions for the Amazon S3 Storage Lens configuration.

    CfnStorageLens.ICloudWatchMetricsProperty

    This resource enables the Amazon CloudWatch publishing option for Amazon S3 Storage Lens metrics.

    CfnStorageLens.IDataExportProperty

    This resource contains the details of the Amazon S3 Storage Lens metrics export.

    CfnStorageLens.IDetailedStatusCodesMetricsProperty

    This resource enables Amazon S3 Storage Lens detailed status code metrics.

    CfnStorageLens.IEncryptionProperty

    This resource contains the type of server-side encryption used to encrypt an Amazon S3 Storage Lens metrics export.

    CfnStorageLens.IPrefixLevelProperty

    This resource contains the details of the prefix-level of the Amazon S3 Storage Lens.

    CfnStorageLens.IPrefixLevelStorageMetricsProperty

    This resource contains the details of the prefix-level storage metrics for Amazon S3 Storage Lens.

    CfnStorageLens.IS3BucketDestinationProperty

    This resource contains the details of the bucket where the Amazon S3 Storage Lens metrics export will be placed.

    CfnStorageLens.ISelectionCriteriaProperty

    This resource contains the details of the Amazon S3 Storage Lens selection criteria.

    CfnStorageLens.ISSEKMSProperty

    Specifies the use of server-side encryption using an AWS Key Management Service key (SSE-KMS) to encrypt the delivered S3 Storage Lens metrics export file.

    CfnStorageLens.IStorageLensConfigurationProperty

    This is the property of the Amazon S3 Storage Lens configuration.

    IBlockPublicAccessOptions
    IBucket
    IBucketAttributes

    A reference to a bucket outside this stack.

    IBucketMetrics

    Specifies a metrics configuration for the CloudWatch request metrics from an Amazon S3 bucket.

    IBucketNotificationDestination

    Implemented by constructs that can be used as bucket notification destinations.

    IBucketNotificationDestinationConfig

    Represents the properties of a notification destination.

    IBucketPolicyProps
    IBucketProps
    ICfnAccessPointProps

    Properties for defining a CfnAccessPoint.

    ICfnBucketPolicyProps

    Properties for defining a CfnBucketPolicy.

    ICfnBucketProps

    Properties for defining a CfnBucket.

    ICfnMultiRegionAccessPointPolicyProps

    Properties for defining a CfnMultiRegionAccessPointPolicy.

    ICfnMultiRegionAccessPointProps

    Properties for defining a CfnMultiRegionAccessPoint.

    ICfnStorageLensProps

    Properties for defining a CfnStorageLens.

    ICorsRule

    Specifies a cross-origin access rule for an Amazon S3 bucket.

    IIntelligentTieringConfiguration

    The intelligent tiering configuration.

    IInventory

    Specifies the inventory configuration of an S3 Bucket.

    IInventoryDestination

    The destination of the inventory.

    ILifecycleRule

    Declaration of a Life cycle rule.

    ILocation

    An interface that represents the location of a specific object in an S3 Bucket.

    INoncurrentVersionTransition

    Describes when noncurrent versions transition to a specified storage class.

    INotificationKeyFilter
    IOnCloudTrailBucketEventOptions

    Options for the onCloudTrailPutObject method.

    IRedirectTarget

    Specifies a redirect behavior of all requests to a website endpoint of a bucket.

    IRoutingRule

    Rule that define when a redirect is applied and the redirect behavior.

    IRoutingRuleCondition
    ITag

    Tag.

    ITransferAccelerationUrlOptions

    Options for creating a Transfer Acceleration URL.

    ITransition

    Describes when an object transitions to a specified storage class.

    IVirtualHostedStyleUrlOptions

    Options for creating Virtual-Hosted style URL.

    Back to top Generated by DocFX