Show / Hide Table of Contents

Interface IBucketAttributes

A reference to a bucket outside this stack.

Namespace: Amazon.CDK.AWS.S3
Assembly: Amazon.CDK.AWS.S3.dll
Syntax (csharp)
public interface IBucketAttributes
Syntax (vb)
Public Interface IBucketAttributes
Remarks

ExampleMetadata: infused

Examples
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/*" });

Synopsis

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

The format of the website URL of the bucket.

BucketWebsiteUrl

The website URL of the bucket (if static web hosting is enabled).

EncryptionKey
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.

Properties

Account

The account this existing bucket belongs to.

virtual string Account { get; }
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.

virtual string BucketArn { get; }
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.

virtual string BucketDomainName { get; }
Property Value

System.String

Remarks

Default: Inferred from bucket name

BucketDualStackDomainName

The IPv6 DNS name of the specified bucket.

virtual string BucketDualStackDomainName { get; }
Property Value

System.String

BucketName

The name of the bucket.

virtual string BucketName { get; }
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.

virtual string BucketRegionalDomainName { get; }
Property Value

System.String

BucketWebsiteNewUrlFormat

The format of the website URL of the bucket.

virtual Nullable<bool> BucketWebsiteNewUrlFormat { get; }
Property Value

System.Nullable<System.Boolean>

Remarks

This should be true for regions launched since 2014.

Default: false

BucketWebsiteUrl

The website URL of the bucket (if static web hosting is enabled).

virtual string BucketWebsiteUrl { get; }
Property Value

System.String

Remarks

Default: Inferred from bucket name

EncryptionKey

virtual IKey EncryptionKey { get; }
Property Value

IKey

IsWebsite

If this bucket has been configured for static website hosting.

virtual Nullable<bool> IsWebsite { get; }
Property Value

System.Nullable<System.Boolean>

Remarks

Default: false

NotificationsHandlerRole

The role to be used by the notifications handler.

virtual IRole NotificationsHandlerRole { get; }
Property Value

IRole

Remarks

Default: - a new role will be created.

Region

The region this existing bucket is in.

virtual string Region { get; }
Property Value

System.String

Remarks

Default: - it's assumed the bucket is in the same region as the scope it's being imported into

Back to top Generated by DocFX