class Namespace (construct)
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.S3Tables.Alpha.Namespace |
![]() | software.amazon.awscdk.services.s3tables.alpha.Namespace |
![]() | aws_cdk.aws_s3tables_alpha.Namespace |
![]() | @aws-cdk/aws-s3tables-alpha ยป Namespace |
Implements
IConstruct
, IDependable
, IResource
, INamespace
An S3 Tables Namespace with helpers.
A namespace is a logical container for tables within a table bucket.
Example
// Build a namespace
const sampleNamespace = new Namespace(scope, 'ExampleNamespace', {
namespaceName: 'example-namespace-1',
tableBucket: tableBucket,
});
Initializer
new Namespace(scope: Construct, id: string, props: NamespaceProps)
Parameters
- scope
Construct
- id
string
- props
Namespace
Props
Construct Props
Name | Type | Description |
---|---|---|
namespace | string | A name for the namespace. |
table | ITable | The table bucket this namespace belongs to. |
removal | Removal | Policy to apply when the policy is removed from this stack. |
namespaceName
Type:
string
A name for the namespace.
tableBucket
Type:
ITable
The table bucket this namespace belongs to.
removalPolicy?
Type:
Removal
(optional, default: RemovalPolicy.DESTROY)
Policy to apply when the policy is removed from this stack.
Properties
Name | Type | Description |
---|---|---|
env | Resource | The environment this resource belongs to. |
namespace | string | The name of this namespace. |
node | Node | The tree node. |
stack | Stack | The stack in which this resource is defined. |
table | ITable | The table bucket which this namespace belongs to. |
static PROPERTY_INJECTION_ID | string | Uniquely identifies this class. |
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
namespaceName
Type:
string
The name of this namespace.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
tableBucket
Type:
ITable
The table bucket which this namespace belongs to.
static PROPERTY_INJECTION_ID
Type:
string
Uniquely identifies this class.
Methods
Name | Description |
---|---|
apply | Apply the given removal policy to this resource. |
to | Returns a string representation of this construct. |
static from | Import an existing namespace from its attributes. |
static validate | See https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets-naming.html. |
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
static fromNamespaceAttributes(scope, id, attrs)
public static fromNamespaceAttributes(scope: Construct, id: string, attrs: NamespaceAttributes): INamespace
Parameters
- scope
Construct
- id
string
- attrs
Namespace
Attributes
Returns
Import an existing namespace from its attributes.
static validateNamespaceName(namespaceName)
public static validateNamespaceName(namespaceName: string): void
Parameters
- namespaceName
string
โ Name of the namespace.