UNPKG

@aws-cdk/aws-s3tables-alpha

Version:

CDK Constructs for S3 Tables

82 lines (81 loc) 2.35 kB
import { Construct } from 'constructs'; import { IResource, RemovalPolicy, Resource } from 'aws-cdk-lib/core'; import { ITableBucket } from './table-bucket'; /** * Represents an S3 Tables Namespace. */ export interface INamespace extends IResource { /** * The name of this namespace * @attribute */ readonly namespaceName: string; /** * The table bucket which this namespace belongs to * @attribute */ readonly tableBucket: ITableBucket; } /** * Parameters for constructing a Namespace */ export interface NamespaceProps { /** * A name for the namespace */ readonly namespaceName: string; /** * The table bucket this namespace belongs to. */ readonly tableBucket: ITableBucket; /** * Policy to apply when the policy is removed from this stack. * @default RemovalPolicy.DESTROY */ readonly removalPolicy?: RemovalPolicy; } /** * Attributes for importing an existing namespace */ export interface NamespaceAttributes { /** * The name of the namespace */ readonly namespaceName: string; /** * The table bucket this namespace belongs to */ readonly tableBucket: ITableBucket; } /** * An S3 Tables Namespace with helpers. * * A namespace is a logical container for tables within a table bucket. */ export declare class Namespace extends Resource implements INamespace { /** Uniquely identifies this class. */ static readonly PROPERTY_INJECTION_ID: string; /** * Import an existing namespace from its attributes */ static fromNamespaceAttributes(scope: Construct, id: string, attrs: NamespaceAttributes): INamespace; /** * See https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets-naming.html * @param namespaceName Name of the namespace * @throws UnscopedValidationError if any naming errors are detected */ static validateNamespaceName(namespaceName: string): void; /** * @internal The underlying namespace resource. */ private readonly _resource; /** * The name of this namespace */ readonly namespaceName: string; /** * The table bucket which this namespace belongs to */ readonly tableBucket: ITableBucket; constructor(scope: Construct, id: string, props: NamespaceProps); }