class Database (construct)
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Glue.Alpha.Database |
Go | github.com/aws/aws-cdk-go/awscdkgluealpha/v2#Database |
Java | software.amazon.awscdk.services.glue.alpha.Database |
Python | aws_cdk.aws_glue_alpha.Database |
TypeScript (source) | @aws-cdk/aws-glue-alpha ยป Database |
Implements
IConstruct, IDependable, IResource, IEnvironment, IDatabase
A Glue database.
Example
import { RemovalPolicy } from 'aws-cdk-lib';
new glue.Database(this, 'MyDatabase', {
databaseName: 'my_database',
removalPolicy: RemovalPolicy.DESTROY,
});
Initializer
new Database(scope: Construct, id: string, props?: DatabaseProps)
Parameters
- scope
Construct - id
string - props
DatabaseProps
Construct Props
| Name | Type | Description |
|---|---|---|
| catalog? | ICatalog | The catalog in which the database will be placed. |
| database | string | The name of the database. |
| description? | string | A description of the database. |
| location | string | The location of the database (for example, an HDFS path). |
| removal | Removal | Policy to apply when the database is removed from the stack. |
catalog?
Type:
ICatalog
(optional, default: The default, account-wide catalog.)
The catalog in which the database will be placed.
databaseName?
Type:
string
(optional, default: generated by CDK.)
The name of the database.
description?
Type:
string
(optional, default: no database description)
A description of the database.
locationUri?
Type:
string
(optional, default: undefined. This field is optional in AWS::Glue::Database DatabaseInput)
The location of the database (for example, an HDFS path).
removalPolicy?
Type:
Removal
(optional, default: RemovalPolicy.RETAIN)
Policy to apply when the database is removed from the stack.
A database is a container for tables and their metadata, so it is retained by default to avoid accidental data loss when it is removed from a stack.
Properties
| Name | Type | Description |
|---|---|---|
| catalog | ICatalog | The catalog this database belongs to. |
| database | string | The ARN of the database. |
| database | string | The name of the database. |
| env | Resource | The environment this resource belongs to. |
| node | Node | The tree node. |
| stack | Stack | The stack in which this resource is defined. |
| location | string | Location URI of this database. |
| static PROPERTY_INJECTION_ID | string | Uniquely identifies this class. |
catalog
Type:
ICatalog
The catalog this database belongs to.
Defaults to the implicit, account-wide catalog, materialized on first access.
databaseArn
Type:
string
The ARN of the database.
databaseName
Type:
string
The name of the database.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
locationUri?
Type:
string
(optional)
Location URI of this database.
static PROPERTY_INJECTION_ID
Type:
string
Uniquely identifies this class.
Methods
| Name | Description |
|---|---|
| apply | Override the cross-stack reference strength for this resource. |
| apply | Apply the given removal policy to this resource. |
| to | Returns a string representation of this construct. |
| with(...mixins) | Applies one or more mixins to this construct. |
| static from |
applyCrossStackReferenceStrength(strength)
public applyCrossStackReferenceStrength(strength: ReferenceStrength): void
Parameters
- strength
Referenceโ - The reference strength to use for this resource.Strength
Override the cross-stack reference strength for this resource.
When set, any cross-stack reference to this resource will use the specified
mechanism instead of the global default determined by the
@aws-cdk/core:defaultCrossStackReferences context key. This is useful for
selectively weakening specific references to avoid the "deadly embrace" problem
without changing the app-wide default.
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
RemovalPolicy
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.
with(...mixins)
public with(...mixins: IMixin[]): IConstruct
Parameters
- mixins
IMixin
Returns
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.
static fromDatabaseArn(scope, id, databaseArn)
public static fromDatabaseArn(scope: Construct, id: string, databaseArn: string): IDatabase
Parameters
- scope
Construct - id
string - databaseArn
string
Returns

.NET
Go
Java
Python
TypeScript (