interface CfnTagAssociationProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.LakeFormation.CfnTagAssociationProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awslakeformation#CfnTagAssociationProps |
Java | software.amazon.awscdk.services.lakeformation.CfnTagAssociationProps |
Python | aws_cdk.aws_lakeformation.CfnTagAssociationProps |
TypeScript | aws-cdk-lib » aws_lakeformation » CfnTagAssociationProps |
Properties for defining a CfnTagAssociation.
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 | |
|---|---|---|---|
| lf | IResolvable | (IResolvable | LFTag)[] | A structure containing an LF-tag key-value pair. | |
| resource | IResolvable | Resource | UTF-8 string (valid values: `DATABASE | TABLE` ). |
lfTags
Type:
IResolvable | (IResolvable | LFTag)[]
A structure containing an LF-tag key-value pair.
resource
Type:
IResolvable | Resource
UTF-8 string (valid values: DATABASE | TABLE ).
The resource for which the LF-tag policy applies.

.NET
Go
Java
Python
TypeScript