Class Database
(experimental) A Glue database.
Inherited Members
Namespace: Amazon.CDK.AWS.Glue.Alpha
Assembly: Amazon.CDK.AWS.Glue.Alpha.dll
Syntax (csharp)
public class Database : Resource, IDatabase, IResource
Syntax (vb)
Public Class Database
Inherits Resource
Implements IDatabase, IResource
Remarks
Stability: Experimental
ExampleMetadata: infused
Examples
using Amazon.CDK;
using Amazon.CDK.AWS.Glue.Alpha;
using Amazon.CDK.AWS.LakeFormation;
Stack stack;
string accountId;
var tagKey = "aws";
var tagValues = new [] { "dev" };
var database = new Database(this, "Database");
var table = new S3Table(this, "Table", new S3TableProps {
Database = database,
Columns = new [] { new Column {
Name = "col1",
Type = Schema.STRING
}, new Column {
Name = "col2",
Type = Schema.STRING
} },
DataFormat = DataFormat.CSV
});
var synthesizer = (DefaultStackSynthesizer)stack.Synthesizer;
new CfnDataLakeSettings(this, "DataLakeSettings", new CfnDataLakeSettingsProps {
Admins = new [] { new DataLakePrincipalProperty {
DataLakePrincipalIdentifier = stack.FormatArn(new ArnComponents {
Service = "iam",
Resource = "role",
Region = "",
Account = accountId,
ResourceName = "Admin"
})
}, new DataLakePrincipalProperty {
// The CDK cloudformation execution role.
DataLakePrincipalIdentifier = synthesizer.CloudFormationExecutionRoleArn.Replace("${AWS::Partition}", "aws")
} }
});
var tag = new CfnTag(this, "Tag", new CfnTagProps {
CatalogId = accountId,
TagKey = tagKey,
TagValues = tagValues
});
var lfTagPairProperty = new LFTagPairProperty {
CatalogId = accountId,
TagKey = tagKey,
TagValues = tagValues
};
var tagAssociation = new CfnTagAssociation(this, "TagAssociation", new CfnTagAssociationProps {
LfTags = new [] { lfTagPairProperty },
Resource = new ResourceProperty {
TableWithColumns = new TableWithColumnsResourceProperty {
DatabaseName = database.DatabaseName,
ColumnNames = new [] { "col1", "col2" },
CatalogId = accountId,
Name = table.TableName
}
}
});
tagAssociation.Node.AddDependency(tag);
tagAssociation.Node.AddDependency(table);
Synopsis
Constructors
Database(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Database(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Database(Construct, String, IDatabaseProps) |
Properties
CatalogArn | (experimental) ARN of the Glue catalog in which this database is stored. |
CatalogId | (experimental) The catalog id of the database (usually, the AWS account id). |
DatabaseArn | (experimental) ARN of this database. |
DatabaseName | (experimental) Name of this database. |
LocationUri | (experimental) Location URI of this database. |
Methods
FromDatabaseArn(Construct, String, String) |
Constructors
Database(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Database(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Database(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Database(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Database(Construct, String, IDatabaseProps)
public Database(Construct scope, string id, IDatabaseProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props IDatabaseProps
Remarks
Stability: Experimental
Properties
CatalogArn
(experimental) ARN of the Glue catalog in which this database is stored.
public virtual string CatalogArn { get; }
Property Value
System.String
Remarks
Stability: Experimental
CatalogId
(experimental) The catalog id of the database (usually, the AWS account id).
public virtual string CatalogId { get; }
Property Value
System.String
Remarks
Stability: Experimental
DatabaseArn
(experimental) ARN of this database.
public virtual string DatabaseArn { get; }
Property Value
System.String
Remarks
Stability: Experimental
DatabaseName
(experimental) Name of this database.
public virtual string DatabaseName { get; }
Property Value
System.String
Remarks
Stability: Experimental
LocationUri
(experimental) Location URI of this database.
public virtual string LocationUri { get; }
Property Value
System.String
Remarks
Stability: Experimental
Methods
FromDatabaseArn(Construct, String, String)
public static IDatabase FromDatabaseArn(Construct scope, string id, string databaseArn)
Parameters
- scope Constructs.Construct
- id System.String
- databaseArn System.String
Returns
Remarks
Stability: Experimental