Class CfnBucket
A CloudFormation AWS::S3::Bucket
.
Inherited Members
Namespace: Amazon.CDK.AWS.S3
Assembly: Amazon.CDK.AWS.S3.dll
Syntax (csharp)
public class CfnBucket : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnBucket
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
The AWS::S3::Bucket
resource creates an Amazon S3 bucket in the same AWS Region where you create the AWS CloudFormation stack.
To control how AWS CloudFormation handles the bucket when the stack is deleted, you can set a deletion policy for your bucket. You can choose to retain the bucket or to delete the bucket. For more information, see DeletionPolicy Attribute .
You can only delete empty buckets. Deletion fails for buckets that have contents.
CloudformationResource: AWS::S3::Bucket
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html
ExampleMetadata: infused
Examples
CfnInclude cfnTemplate;
var cfnBucket = (CfnBucket)cfnTemplate.GetResource("Bucket");
var role = new Role(this, "Role", new RoleProps {
AssumedBy = new AnyPrincipal()
});
role.AddToPolicy(new PolicyStatement(new PolicyStatementProps {
Actions = new [] { "s3:*" },
Resources = new [] { cfnBucket.AttrArn }
}));
Synopsis
Constructors
CfnBucket(Construct, String, ICfnBucketProps) | Create a new |
CfnBucket(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnBucket(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
AccelerateConfiguration | Configures the transfer acceleration state for an Amazon S3 bucket. |
AccessControl | A canned access control list (ACL) that grants predefined permissions to the bucket. |
AnalyticsConfigurations | Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket. |
AttrArn | Returns the Amazon Resource Name (ARN) of the specified bucket. |
AttrDomainName | Returns the IPv4 DNS name of the specified bucket. |
AttrDualStackDomainName | Returns the IPv6 DNS name of the specified bucket. |
AttrRegionalDomainName | Returns the regional domain name of the specified bucket. |
AttrWebsiteUrl | Returns the Amazon S3 website endpoint for the specified bucket. |
BucketEncryption | 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. |
BucketName | A name for the bucket. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
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 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. |
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 | Places an Object Lock configuration on the specified bucket. |
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. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnBucket(Construct, String, ICfnBucketProps)
Create a new AWS::S3::Bucket
.
public CfnBucket(Construct scope, string id, ICfnBucketProps props = null)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnBucketProps
- resource properties.
CfnBucket(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnBucket(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnBucket(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnBucket(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
AccelerateConfiguration
Configures the transfer acceleration state for an Amazon S3 bucket.
public virtual object AccelerateConfiguration { get; set; }
Property Value
System.Object
Remarks
For more information, see Amazon S3 Transfer Acceleration in the Amazon S3 User Guide .
AccessControl
A canned access control list (ACL) that grants predefined permissions to the bucket.
public virtual string AccessControl { get; set; }
Property Value
System.String
Remarks
For more information about canned ACLs, see Canned ACL in the Amazon S3 User Guide .
Be aware that the syntax for this property differs from the information provided in the Amazon S3 User Guide . The AccessControl property is case-sensitive and must be one of the following values: Private, PublicRead, PublicReadWrite, AuthenticatedRead, LogDeliveryWrite, BucketOwnerRead, BucketOwnerFullControl, or AwsExecRead.
AnalyticsConfigurations
Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket.
public virtual object AnalyticsConfigurations { get; set; }
Property Value
System.Object
Remarks
AttrArn
Returns the Amazon Resource Name (ARN) of the specified bucket.
public virtual string AttrArn { get; }
Property Value
System.String
Remarks
Example: arn:aws:s3:::DOC-EXAMPLE-BUCKET
CloudformationAttribute: Arn
AttrDomainName
Returns the IPv4 DNS name of the specified bucket.
public virtual string AttrDomainName { get; }
Property Value
System.String
Remarks
Example: DOC-EXAMPLE-BUCKET.s3.amazonaws.com
CloudformationAttribute: DomainName
AttrDualStackDomainName
Returns the IPv6 DNS name of the specified bucket.
public virtual string AttrDualStackDomainName { get; }
Property Value
System.String
Remarks
Example: DOC-EXAMPLE-BUCKET.s3.dualstack.us-east-2.amazonaws.com
For more information about dual-stack endpoints, see Using Amazon S3 Dual-Stack Endpoints .
CloudformationAttribute: DualStackDomainName
AttrRegionalDomainName
Returns the regional domain name of the specified bucket.
public virtual string AttrRegionalDomainName { get; }
Property Value
System.String
Remarks
Example: DOC-EXAMPLE-BUCKET.s3.us-east-2.amazonaws.com
CloudformationAttribute: RegionalDomainName
AttrWebsiteUrl
Returns the Amazon S3 website endpoint for the specified bucket.
public virtual string AttrWebsiteUrl { get; }
Property Value
System.String
Remarks
Example (IPv4): http://DOC-EXAMPLE-BUCKET.s3-website.us-east-2.amazonaws.com
Example (IPv6): http://DOC-EXAMPLE-BUCKET.s3.dualstack.us-east-2.amazonaws.com
CloudformationAttribute: WebsiteURL
BucketEncryption
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.
public virtual object BucketEncryption { get; set; }
Property Value
System.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 .
BucketName
A name for the bucket.
public virtual string BucketName { get; set; }
Property Value
System.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.
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
CorsConfiguration
Describes the cross-origin access configuration for objects in an Amazon S3 bucket.
public virtual object CorsConfiguration { get; set; }
Property Value
System.Object
Remarks
For more information, see Enabling Cross-Origin Resource Sharing in the Amazon S3 User Guide .
IntelligentTieringConfigurations
Defines how Amazon S3 handles Intelligent-Tiering storage.
public virtual object IntelligentTieringConfigurations { get; set; }
Property Value
System.Object
Remarks
InventoryConfigurations
Specifies the inventory configuration for an Amazon S3 bucket.
public virtual object InventoryConfigurations { get; set; }
Property Value
System.Object
Remarks
For more information, see GET Bucket inventory in the Amazon S3 API Reference .
LifecycleConfiguration
Specifies the lifecycle configuration for objects in an Amazon S3 bucket.
public virtual object LifecycleConfiguration { get; set; }
Property Value
System.Object
Remarks
For more information, see Object Lifecycle Management in the Amazon S3 User Guide .
LoggingConfiguration
Settings that define where logs are stored.
public virtual object LoggingConfiguration { get; set; }
Property Value
System.Object
Remarks
MetricsConfigurations
Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket.
public virtual object MetricsConfigurations { get; set; }
Property Value
System.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 .
NotificationConfiguration
Configuration that defines how Amazon S3 handles bucket notifications.
public virtual object NotificationConfiguration { get; set; }
Property Value
System.Object
Remarks
ObjectLockConfiguration
Places an Object Lock configuration on the specified bucket.
public virtual object ObjectLockConfiguration { get; set; }
Property Value
System.Object
Remarks
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 .
ObjectLockEnabled
Indicates whether this bucket has an Object Lock configuration enabled.
public virtual object ObjectLockEnabled { get; set; }
Property Value
System.Object
Remarks
Enable ObjectLockEnabled
when you apply ObjectLockConfiguration
to a bucket.
OwnershipControls
Configuration that defines how Amazon S3 handles Object Ownership rules.
public virtual object OwnershipControls { get; set; }
Property Value
System.Object
Remarks
PublicAccessBlockConfiguration
Configuration that defines how Amazon S3 handles public access.
public virtual object PublicAccessBlockConfiguration { get; set; }
Property Value
System.Object
Remarks
ReplicationConfiguration
Configuration for replicating objects in an S3 bucket.
public virtual object ReplicationConfiguration { get; set; }
Property Value
System.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.
Tags
An arbitrary set of tags (key-value pairs) for this S3 bucket.
public virtual TagManager Tags { get; }
Property Value
Remarks
VersioningConfiguration
Enables multiple versions of all objects in this bucket.
public virtual object VersioningConfiguration { get; set; }
Property Value
System.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.
WebsiteConfiguration
Information used to configure the bucket as a static website.
public virtual object WebsiteConfiguration { get; set; }
Property Value
System.Object
Remarks
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>