Show / Hide Table of Contents

Class CfnBucketProps

Properties for defining a CfnBucket.

Inheritance
object
CfnBucketProps
Implements
ICfnBucketProps
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.S3
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnBucketProps : ICfnBucketProps
Syntax (vb)
Public Class CfnBucketProps Implements ICfnBucketProps
Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html

ExampleMetadata: infused

Examples
var rawBucket = new CfnBucket(this, "Bucket", new CfnBucketProps { });
             // -or-
             var rawBucketAlt = (CfnBucket)myBucket.Node.DefaultChild;

             // then
             rawBucket.CfnOptions.Condition = new CfnCondition(this, "EnableBucket", new CfnConditionProps { });
             rawBucket.CfnOptions.Metadata = new Dictionary<string, object> {
                 { "metadataKey", "MetadataValue" }
             };

Synopsis

Constructors

CfnBucketProps()

Properties for defining a CfnBucket.

Properties

AbacStatus

The ABAC status of the general purpose bucket.

AccelerateConfiguration

Configures the transfer acceleration state for an Amazon S3 bucket.

AccessControl

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

AnalyticsConfigurations

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

BucketEncryption

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

BucketName

A name for the bucket.

CorsConfiguration

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

IntelligentTieringConfigurations

Defines how Amazon S3 handles Intelligent-Tiering storage.

InventoryConfigurations

Specifies the S3 Inventory configuration for an Amazon S3 bucket.

LifecycleConfiguration

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

LoggingConfiguration

Settings that define where logs are stored.

MetadataConfiguration

The S3 Metadata configuration for a general purpose bucket.

MetadataTableConfiguration

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

MetricsConfigurations

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

NotificationConfiguration

Configuration that defines how Amazon S3 handles bucket notifications.

ObjectLockConfiguration

This operation is not supported for directory buckets.

ObjectLockEnabled

Indicates whether this bucket has an Object Lock configuration enabled.

OwnershipControls

Configuration that defines how Amazon S3 handles Object Ownership rules.

PublicAccessBlockConfiguration

Configuration that defines how Amazon S3 handles public access.

ReplicationConfiguration

Configuration for replicating objects in an S3 bucket.

Tags

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

VersioningConfiguration

Enables multiple versions of all objects in this bucket.

WebsiteConfiguration

Information used to configure the bucket as a static website.

Constructors

CfnBucketProps()

Properties for defining a CfnBucket.

public CfnBucketProps()
Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html

ExampleMetadata: infused

Examples
var rawBucket = new CfnBucket(this, "Bucket", new CfnBucketProps { });
             // -or-
             var rawBucketAlt = (CfnBucket)myBucket.Node.DefaultChild;

             // then
             rawBucket.CfnOptions.Condition = new CfnCondition(this, "EnableBucket", new CfnConditionProps { });
             rawBucket.CfnOptions.Metadata = new Dictionary<string, object> {
                 { "metadataKey", "MetadataValue" }
             };

Properties

AbacStatus

The ABAC status of the general purpose bucket.

public string? AbacStatus { get; set; }
Property Value

string

Remarks

When ABAC is enabled for the general purpose bucket, you can use tags to manage access to the general purpose buckets as well as for cost tracking purposes. When ABAC is disabled for the general purpose buckets, you can only use tags for cost tracking purposes. For more information, see Using tags with S3 general purpose buckets .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-abacstatus

AccelerateConfiguration

Configures the transfer acceleration state for an Amazon S3 bucket.

public object? AccelerateConfiguration { get; set; }
Property Value

object

Remarks

For more information, see Amazon S3 Transfer Acceleration in the Amazon S3 User Guide .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-accelerateconfiguration

Type union: either IResolvable or CfnBucket.IAccelerateConfigurationProperty

AccessControl

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

public string? AccessControl { get; set; }
Property Value

string

Remarks

A majority of modern use cases in Amazon S3 no longer require the use of ACLs, and we recommend that you keep ACLs disabled. For more information, see Controlling object ownership in the Amazon S3 User Guide .

A canned access control list (ACL) that grants predefined permissions to the bucket. For more information about canned ACLs, see Canned ACL in the Amazon S3 User Guide .

S3 buckets are created with ACLs disabled by default. Therefore, unless you explicitly set the AWS::S3::OwnershipControls property to enable ACLs, your resource will fail to deploy with any value other than Private. Use cases requiring ACLs are uncommon.

The majority of access control configurations can be successfully and more easily achieved with bucket policies. For more information, see AWS::S3::BucketPolicy . For examples of common policy configurations, including S3 Server Access Logs buckets and more, see Bucket policy examples in the Amazon S3 User Guide .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-accesscontrol

AnalyticsConfigurations

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

public object? AnalyticsConfigurations { get; set; }
Property Value

object

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-analyticsconfigurations

Type union: either IResolvable or (either IResolvable or CfnBucket.IAnalyticsConfigurationProperty)[]

BucketEncryption

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

public object? BucketEncryption { get; set; }
Property Value

object

Remarks

For information about the Amazon S3 default encryption feature, see Amazon S3 Default Encryption for S3 Buckets in the Amazon S3 User Guide .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-bucketencryption

Type union: either IResolvable or CfnBucket.IBucketEncryptionProperty

BucketName

A name for the bucket.

public string? BucketName { get; set; }
Property Value

string

Remarks

If you don't specify a name, AWS CloudFormation generates a unique ID and uses that ID for the bucket name. The bucket name must contain only lowercase letters, numbers, periods (.), and dashes (-) and must follow Amazon S3 bucket restrictions and limitations . For more information, see Rules for naming Amazon S3 buckets in the Amazon S3 User Guide .

If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you need to replace the resource, specify a new name.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-bucketname

CorsConfiguration

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

public object? CorsConfiguration { get; set; }
Property Value

object

Remarks

For more information, see Enabling Cross-Origin Resource Sharing in the Amazon S3 User Guide .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-corsconfiguration

Type union: either IResolvable or CfnBucket.ICorsConfigurationProperty

IntelligentTieringConfigurations

Defines how Amazon S3 handles Intelligent-Tiering storage.

public object? IntelligentTieringConfigurations { get; set; }
Property Value

object

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-intelligenttieringconfigurations

Type union: either IResolvable or (either IResolvable or CfnBucket.IIntelligentTieringConfigurationProperty)[]

InventoryConfigurations

Specifies the S3 Inventory configuration for an Amazon S3 bucket.

public object? InventoryConfigurations { get; set; }
Property Value

object

Remarks

For more information, see GET Bucket inventory in the Amazon S3 API Reference .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-inventoryconfigurations

Type union: either IResolvable or (either IResolvable or CfnBucket.IInventoryConfigurationProperty)[]

LifecycleConfiguration

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

public object? LifecycleConfiguration { get; set; }
Property Value

object

Remarks

For more information, see Object Lifecycle Management in the Amazon S3 User Guide .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-lifecycleconfiguration

Type union: either IResolvable or CfnBucket.ILifecycleConfigurationProperty

LoggingConfiguration

Settings that define where logs are stored.

public object? LoggingConfiguration { get; set; }
Property Value

object

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-loggingconfiguration

Type union: either IResolvable or CfnBucket.ILoggingConfigurationProperty

MetadataConfiguration

The S3 Metadata configuration for a general purpose bucket.

public object? MetadataConfiguration { get; set; }
Property Value

object

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-metadataconfiguration

Type union: either IResolvable or CfnBucket.IMetadataConfigurationProperty

MetadataTableConfiguration

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

public object? MetadataTableConfiguration { get; set; }
Property Value

object

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-metadatatableconfiguration

Type union: either IResolvable or CfnBucket.IMetadataTableConfigurationProperty

MetricsConfigurations

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

public object? MetricsConfigurations { get; set; }
Property Value

object

Remarks

If you're updating an existing metrics configuration, note that this is a full replacement of the existing metrics configuration. If you don't include the elements you want to keep, they are erased. For more information, see PutBucketMetricsConfiguration .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-metricsconfigurations

Type union: either IResolvable or (either IResolvable or CfnBucket.IMetricsConfigurationProperty)[]

NotificationConfiguration

Configuration that defines how Amazon S3 handles bucket notifications.

public object? NotificationConfiguration { get; set; }
Property Value

object

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-notificationconfiguration

Type union: either IResolvable or CfnBucket.INotificationConfigurationProperty

ObjectLockConfiguration

This operation is not supported for directory buckets.

public object? ObjectLockConfiguration { get; set; }
Property Value

object

Remarks

Places an Object Lock configuration on the specified bucket. The rule specified in the Object Lock configuration will be applied by default to every new object placed in the specified bucket. For more information, see Locking Objects .

<ul></ul>

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-objectlockconfiguration

Type union: either IResolvable or CfnBucket.IObjectLockConfigurationProperty

ObjectLockEnabled

Indicates whether this bucket has an Object Lock configuration enabled.

public object? ObjectLockEnabled { get; set; }
Property Value

object

Remarks

Enable ObjectLockEnabled when you apply ObjectLockConfiguration to a bucket.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-objectlockenabled

Type union: either bool or IResolvable

OwnershipControls

Configuration that defines how Amazon S3 handles Object Ownership rules.

public object? OwnershipControls { get; set; }
Property Value

object

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-ownershipcontrols

Type union: either IResolvable or CfnBucket.IOwnershipControlsProperty

PublicAccessBlockConfiguration

Configuration that defines how Amazon S3 handles public access.

public object? PublicAccessBlockConfiguration { get; set; }
Property Value

object

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-publicaccessblockconfiguration

Type union: either IResolvable or CfnBucket.IPublicAccessBlockConfigurationProperty

ReplicationConfiguration

Configuration for replicating objects in an S3 bucket.

public object? ReplicationConfiguration { get; set; }
Property Value

object

Remarks

To enable replication, you must also enable versioning by using the VersioningConfiguration property.

Amazon S3 can store replicated objects in a single destination bucket or multiple destination buckets. The destination bucket or buckets must already exist.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-replicationconfiguration

Type union: either IResolvable or CfnBucket.IReplicationConfigurationProperty

Tags

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

public ICfnTag[]? Tags { get; set; }
Property Value

ICfnTag[]

Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-tags

VersioningConfiguration

Enables multiple versions of all objects in this bucket.

public object? VersioningConfiguration { get; set; }
Property Value

object

Remarks

You might enable versioning to prevent objects from being deleted or overwritten by mistake or to archive objects so that you can retrieve previous versions of them.

When you enable versioning on a bucket for the first time, it might take a short amount of time for the change to be fully propagated. We recommend that you wait for 15 minutes after enabling versioning before issuing write operations ( <code>PUT</code> or <code>DELETE</code> ) on objects in the bucket.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-versioningconfiguration

Type union: either IResolvable or CfnBucket.IVersioningConfigurationProperty

WebsiteConfiguration

Information used to configure the bucket as a static website.

public object? WebsiteConfiguration { get; set; }
Property Value

object

Remarks

For more information, see Hosting Websites on Amazon S3 .

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html#cfn-s3-bucket-websiteconfiguration

Type union: either IResolvable or CfnBucket.IWebsiteConfigurationProperty

Implements

ICfnBucketProps
Back to top Generated by DocFX