Class CfnBucket
The AWS::S3::Bucket
resource creates an Amazon S3 bucket in the same AWS Region where you create the AWS CloudFormation stack.
Inherited Members
Namespace: Amazon.CDK.AWS.S3
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnBucket : CfnResource, IInspectable, ITaggable
Syntax (vb)
Public Class CfnBucket
Inherits CfnResource
Implements IInspectable, ITaggable
Remarks
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.
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-bucket.html
CloudformationResource: AWS::S3::Bucket
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(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 |
CfnBucket(Construct, String, ICfnBucketProps) |
Properties
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. |
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), AWS KMS-managed keys (SSE-KMS), or dual-layer server-side encryption with KMS-managed keys (DSSE-KMS). |
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 | This operation is not supported by 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 | Tag Manager which manages the tags for this resource. |
TagsRaw | 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(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
CfnBucket(Construct, String, ICfnBucketProps)
public CfnBucket(Construct scope, string id, ICfnBucketProps props = null)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnBucketProps
Resource properties.
Properties
AccelerateConfiguration
Configures the transfer acceleration state for an Amazon S3 bucket.
public virtual object AccelerateConfiguration { get; set; }
Property Value
System.Object
AccessControl
This is a legacy property, and it is not recommended for most use cases.
public virtual string AccessControl { get; set; }
Property Value
System.String
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
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), AWS KMS-managed keys (SSE-KMS), or dual-layer server-side encryption with KMS-managed keys (DSSE-KMS).
public virtual object BucketEncryption { get; set; }
Property Value
System.Object
BucketName
A name for the bucket.
public virtual string BucketName { get; set; }
Property Value
System.String
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
IntelligentTieringConfigurations
Defines how Amazon S3 handles Intelligent-Tiering storage.
public virtual object IntelligentTieringConfigurations { get; set; }
Property Value
System.Object
InventoryConfigurations
Specifies the inventory configuration for an Amazon S3 bucket.
public virtual object InventoryConfigurations { get; set; }
Property Value
System.Object
LifecycleConfiguration
Specifies the lifecycle configuration for objects in an Amazon S3 bucket.
public virtual object LifecycleConfiguration { get; set; }
Property Value
System.Object
LoggingConfiguration
Settings that define where logs are stored.
public virtual object LoggingConfiguration { get; set; }
Property Value
System.Object
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
NotificationConfiguration
Configuration that defines how Amazon S3 handles bucket notifications.
public virtual object NotificationConfiguration { get; set; }
Property Value
System.Object
ObjectLockConfiguration
This operation is not supported by directory buckets.
public virtual object ObjectLockConfiguration { get; set; }
Property Value
System.Object
ObjectLockEnabled
Indicates whether this bucket has an Object Lock configuration enabled.
public virtual object ObjectLockEnabled { get; set; }
Property Value
System.Object
OwnershipControls
Configuration that defines how Amazon S3 handles Object Ownership rules.
public virtual object OwnershipControls { get; set; }
Property Value
System.Object
PublicAccessBlockConfiguration
Configuration that defines how Amazon S3 handles public access.
public virtual object PublicAccessBlockConfiguration { get; set; }
Property Value
System.Object
ReplicationConfiguration
Configuration for replicating objects in an S3 bucket.
public virtual object ReplicationConfiguration { get; set; }
Property Value
System.Object
Tags
Tag Manager which manages the tags for this resource.
public virtual TagManager Tags { get; }
Property Value
TagsRaw
An arbitrary set of tags (key-value pairs) for this S3 bucket.
public virtual ICfnTag[] TagsRaw { get; set; }
Property Value
ICfnTag[]
VersioningConfiguration
Enables multiple versions of all objects in this bucket.
public virtual object VersioningConfiguration { get; set; }
Property Value
System.Object
WebsiteConfiguration
Information used to configure the bucket as a static website.
public virtual object WebsiteConfiguration { get; set; }
Property Value
System.Object
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>