Class Database
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.glue.alpha.Database
- All Implemented Interfaces:
IResource,IDatabase,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-24T13:34:50.078Z")
@Stability(Experimental)
public class Database
extends Resource
implements IDatabase
(experimental) A Glue database.
Example:
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.glue.alpha.S3Table;
import software.amazon.awscdk.services.glue.alpha.Database;
import software.amazon.awscdk.services.glue.alpha.DataFormat;
import software.amazon.awscdk.services.glue.alpha.Schema;
import software.amazon.awscdk.services.lakeformation.CfnDataLakeSettings;
import software.amazon.awscdk.services.lakeformation.CfnTag;
import software.amazon.awscdk.services.lakeformation.CfnTagAssociation;
Stack stack;
String accountId;
String tagKey = "aws";
String[] tagValues = List.of("dev");
Database database = new Database(this, "Database");
S3Table table = S3Table.Builder.create(this, "Table")
.database(database)
.columns(List.of(Column.builder()
.name("col1")
.type(Schema.STRING)
.build(), Column.builder()
.name("col2")
.type(Schema.STRING)
.build()))
.dataFormat(DataFormat.CSV)
.build();
DefaultStackSynthesizer synthesizer = (DefaultStackSynthesizer)stack.getSynthesizer();
CfnDataLakeSettings.Builder.create(this, "DataLakeSettings")
.admins(List.of(DataLakePrincipalProperty.builder()
.dataLakePrincipalIdentifier(stack.formatArn(ArnComponents.builder()
.service("iam")
.resource("role")
.region("")
.account(accountId)
.resourceName("Admin")
.build()))
.build(), DataLakePrincipalProperty.builder()
// The CDK cloudformation execution role.
.dataLakePrincipalIdentifier(synthesizer.cloudFormationExecutionRoleArn.replace("${AWS::Partition}", "aws"))
.build()))
.build();
CfnTag tag = CfnTag.Builder.create(this, "Tag")
.catalogId(accountId)
.tagKey(tagKey)
.tagValues(tagValues)
.build();
LFTagPairProperty lfTagPairProperty = LFTagPairProperty.builder()
.catalogId(accountId)
.tagKey(tagKey)
.tagValues(tagValues)
.build();
CfnTagAssociation tagAssociation = CfnTagAssociation.Builder.create(this, "TagAssociation")
.lfTags(List.of(lfTagPairProperty))
.resource(ResourceProperty.builder()
.tableWithColumns(TableWithColumnsResourceProperty.builder()
.databaseName(database.getDatabaseName())
.columnNames(List.of("col1", "col2"))
.catalogId(accountId)
.name(table.getTableName())
.build())
.build())
.build();
tagAssociation.node.addDependency(tag);
tagAssociation.node.addDependency(table);
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class(experimental) A fluent builder forDatabase.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.glue.alpha.IDatabase
IDatabase.Jsii$Default, IDatabase.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String(experimental) Uniquely identifies this class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDatabase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedDatabase(software.amazon.jsii.JsiiObjectRef objRef) Database(software.constructs.Construct scope, String id, DatabaseProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IDatabasefromDatabaseArn(software.constructs.Construct scope, String id, String databaseArn) (experimental) ARN of the Glue catalog in which this database is stored.(experimental) The catalog id of the database (usually, the AWS account id).(experimental) ARN of this database.(experimental) Name of this database.(experimental) Location URI of this database.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
(experimental) Uniquely identifies this class.
-
-
Constructor Details
-
Database
protected Database(software.amazon.jsii.JsiiObjectRef objRef) -
Database
protected Database(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Database
@Stability(Experimental) public Database(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable DatabaseProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props-
-
Database
@Stability(Experimental) public Database(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope- This parameter is required.id- This parameter is required.
-
-
Method Details
-
fromDatabaseArn
@Stability(Experimental) @NotNull public static IDatabase fromDatabaseArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String databaseArn) - Parameters:
scope- This parameter is required.id- This parameter is required.databaseArn- This parameter is required.
-
getCatalogArn
(experimental) ARN of the Glue catalog in which this database is stored.- Specified by:
getCatalogArnin interfaceIDatabase
-
getCatalogId
(experimental) The catalog id of the database (usually, the AWS account id).- Specified by:
getCatalogIdin interfaceIDatabase
-
getDatabaseArn
(experimental) ARN of this database.- Specified by:
getDatabaseArnin interfaceIDatabase
-
getDatabaseName
(experimental) Name of this database.- Specified by:
getDatabaseNamein interfaceIDatabase
-
getLocationUri
(experimental) Location URI of this database.
-