interface CfnTagProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.LakeFormation.CfnTagProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awslakeformation#CfnTagProps |
![]() | software.amazon.awscdk.services.lakeformation.CfnTagProps |
![]() | aws_cdk.aws_lakeformation.CfnTagProps |
![]() | aws-cdk-lib » aws_lakeformation » CfnTagProps |
Properties for defining a CfnTag
.
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lakeformation-tag.html
Example
import * as cdk from 'aws-cdk-lib';
import { S3Table, Database, DataFormat, Schema } from '@aws-cdk/aws-glue-alpha';
import { CfnDataLakeSettings, CfnTag, CfnTagAssociation } from 'aws-cdk-lib/aws-lakeformation';
declare const stack: cdk.Stack;
declare const accountId: string;
const tagKey = 'aws';
const tagValues = ['dev'];
const database = new Database(this, 'Database');
const table = new S3Table(this, 'Table', {
database,
columns: [
{
name: 'col1',
type: Schema.STRING,
},
{
name: 'col2',
type: Schema.STRING,
}
],
dataFormat: DataFormat.CSV,
});
const synthesizer = stack.synthesizer as cdk.DefaultStackSynthesizer;
new CfnDataLakeSettings(this, 'DataLakeSettings', {
admins: [
{
dataLakePrincipalIdentifier: stack.formatArn({
service: 'iam',
resource: 'role',
region: '',
account: accountId,
resourceName: 'Admin',
}),
},
{
// The CDK cloudformation execution role.
dataLakePrincipalIdentifier: synthesizer.cloudFormationExecutionRoleArn.replace('${AWS::Partition}', 'aws'),
},
],
});
const tag = new CfnTag(this, 'Tag', {
catalogId: accountId,
tagKey,
tagValues,
});
const lfTagPairProperty: CfnTagAssociation.LFTagPairProperty = {
catalogId: accountId,
tagKey,
tagValues,
};
const tagAssociation = new CfnTagAssociation(this, 'TagAssociation', {
lfTags: [lfTagPairProperty],
resource: {
tableWithColumns: {
databaseName: database.databaseName,
columnNames: ['col1', 'col2'],
catalogId: accountId,
name: table.tableName,
}
}
});
tagAssociation.node.addDependency(tag);
tagAssociation.node.addDependency(table);
Properties
Name | Type | Description |
---|---|---|
tag | string | UTF-8 string, not less than 1 or more than 255 bytes long, matching the single-line string pattern . |
tag | string[] | An array of UTF-8 strings, not less than 1 or more than 50 strings. |
catalog | string | Catalog id string, not less than 1 or more than 255 bytes long, matching the single-line string pattern . |
tagKey
Type:
string
UTF-8 string, not less than 1 or more than 255 bytes long, matching the single-line string pattern .
The key-name for the LF-tag.
tagValues
Type:
string[]
An array of UTF-8 strings, not less than 1 or more than 50 strings.
A list of possible values of the corresponding TagKey
of an LF-tag key-value pair.
catalogId?
Type:
string
(optional)
Catalog id string, not less than 1 or more than 255 bytes long, matching the single-line string pattern .
The identifier for the Data Catalog . By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your AWS Lake Formation environment.