aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
60 lines (59 loc) • 2.16 kB
TypeScript
import type { CfnBucket, CfnBucketPolicy } from './s3.generated';
import type { CfnKey } from '../../aws-kms';
import type { IBucketRef } from '../../interfaces/generated/aws-s3-interfaces.generated';
/**
* Provides read-only reflection on the configuration of an S3 Bucket's
* underlying CfnBucket resource.
*
* Use `BucketReflection.of()` to obtain an instance from any Bucket reference.
* All getters read directly from the L1 resource, providing a single source of
* truth regardless of whether the bucket was created as an L2, imported, or
* constructed directly as a CfnBucket.
*/
export declare class BucketReflection {
/**
* Creates a BucketReflection for the given bucket reference.
*
* Resolves the underlying CfnBucket from the construct tree.
*
* @param bucketRef - The bucket reference to reflect on.
* @throws If the underlying CfnBucket resource cannot be found.
*/
static of(bucketRef: IBucketRef): BucketReflection;
/**
* The CfnBucket L1 resource that is reflected on.
*
* @throws If the underlying CfnBucket resource cannot be found.
*/
get bucket(): CfnBucket;
private readonly ref;
private readonly _bucket;
private constructor();
/**
* The domain name of the static website endpoint.
*
* Derived from the bucket's website URL attribute.
*/
get bucketWebsiteDomainName(): string;
/**
* Whether the bucket is configured for static website hosting.
*/
get isWebsite(): boolean | undefined;
/**
* Whether the bucket's public access block configuration blocks public bucket policies.
*/
get disallowPublicAccess(): boolean | undefined;
/**
* The bucket policy associated with this bucket, if any.
*
* Searches the construct tree for a CfnBucketPolicy that references this bucket.
*/
get policy(): CfnBucketPolicy | undefined;
/**
* The KMS key used for server-side encryption, if any.
*
* Searches the construct tree for a CfnKey referenced by the bucket's
* encryption configuration.
*/
get encryptionKey(): CfnKey | undefined;
}