Class BucketAttributes
A reference to a bucket outside this stack.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.S3
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class BucketAttributes : Object, IBucketAttributes
Syntax (vb)
Public Class BucketAttributes
Inherits Object
Implements IBucketAttributes
Remarks
ExampleMetadata: infused
Examples
Function myLambda;
var 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/*"
});
Synopsis
Constructors
BucketAttributes() |
Properties
Account | The account this existing bucket belongs to. |
BucketArn | The ARN of the bucket. |
BucketDomainName | The domain name of the bucket. |
BucketDualStackDomainName | The IPv6 DNS name of the specified bucket. |
BucketName | The name of the bucket. |
BucketRegionalDomainName | The regional domain name of the specified bucket. |
BucketWebsiteNewUrlFormat | (deprecated) Force the format of the website URL of the bucket. |
BucketWebsiteUrl | The website URL of the bucket (if static web hosting is enabled). |
EncryptionKey | KMS encryption key associated with this bucket. |
IsWebsite | If this bucket has been configured for static website hosting. |
NotificationsHandlerRole | The role to be used by the notifications handler. |
Region | The region this existing bucket is in. |
Constructors
BucketAttributes()
public BucketAttributes()
Properties
Account
The account this existing bucket belongs to.
public string Account { get; set; }
Property Value
System.String
Remarks
Default: - it's assumed the bucket belongs to the same account as the scope it's being imported into
BucketArn
The ARN of the bucket.
public string BucketArn { get; set; }
Property Value
System.String
Remarks
At least one of bucketArn or bucketName must be defined in order to initialize a bucket ref.
BucketDomainName
The domain name of the bucket.
public string BucketDomainName { get; set; }
Property Value
System.String
Remarks
Default: - Inferred from bucket name
BucketDualStackDomainName
The IPv6 DNS name of the specified bucket.
public string BucketDualStackDomainName { get; set; }
Property Value
System.String
BucketName
The name of the bucket.
public string BucketName { get; set; }
Property Value
System.String
Remarks
If the underlying value of ARN is a string, the name will be parsed from the ARN. Otherwise, the name is optional, but some features that require the bucket name such as auto-creating a bucket policy, won't work.
BucketRegionalDomainName
The regional domain name of the specified bucket.
public string BucketRegionalDomainName { get; set; }
Property Value
System.String
BucketWebsiteNewUrlFormat
(deprecated) Force the format of the website URL of the bucket.
public Nullable<bool> BucketWebsiteNewUrlFormat { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
This should be true for regions launched since 2014.
Default: - inferred from available region information, false
otherwise
Stability: Deprecated
BucketWebsiteUrl
The website URL of the bucket (if static web hosting is enabled).
public string BucketWebsiteUrl { get; set; }
Property Value
System.String
Remarks
Default: - Inferred from bucket name and region
EncryptionKey
KMS encryption key associated with this bucket.
public IKey EncryptionKey { get; set; }
Property Value
Remarks
Default: - no encryption key
IsWebsite
If this bucket has been configured for static website hosting.
public Nullable<bool> IsWebsite { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
NotificationsHandlerRole
The role to be used by the notifications handler.
public IRole NotificationsHandlerRole { get; set; }
Property Value
Remarks
Default: - a new role will be created.
Region
The region this existing bucket is in.
public string Region { get; set; }
Property Value
System.String
Remarks
Features that require the region (e.g. bucketWebsiteUrl
) won't fully work
if the region cannot be correctly inferred.
Default: - it's assumed the bucket is in the same region as the scope it's being imported into