CfnTagAssociationProps
- class aws_cdk.aws_lakeformation.CfnTagAssociationProps(*, lf_tags, resource)
Bases:
object
Properties for defining a
CfnTagAssociation
.- Parameters:
lf_tags (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,LFTagPairProperty
,Dict
[str
,Any
]]]]) – A structure containing an LF-tag key-value pair.resource (
Union
[IResolvable
,ResourceProperty
,Dict
[str
,Any
]]) – UTF-8 string (valid values:DATABASE | TABLE
). The resource for which the LF-tag policy applies.
- See:
- ExampleMetadata:
infused
Example:
import aws_cdk as cdk from aws_cdk.aws_glue_alpha import S3Table, Database, DataFormat, Schema from aws_cdk.aws_lakeformation import CfnDataLakeSettings, CfnTag, CfnTagAssociation # stack: cdk.Stack # account_id: str tag_key = "aws" tag_values = ["dev"] database = Database(self, "Database") table = S3Table(self, "Table", database=database, columns=[Column( name="col1", type=Schema.STRING ), Column( name="col2", type=Schema.STRING ) ], data_format=DataFormat.CSV ) synthesizer = stack.synthesizer CfnDataLakeSettings(self, "DataLakeSettings", admins=[CfnDataLakeSettings.DataLakePrincipalProperty( data_lake_principal_identifier=stack.format_arn( service="iam", resource="role", region="", account=account_id, resource_name="Admin" ) ), CfnDataLakeSettings.DataLakePrincipalProperty( # The CDK cloudformation execution role. data_lake_principal_identifier=synthesizer.cloud_formation_execution_role_arn.replace("${AWS::Partition}", "aws") ) ] ) tag = CfnTag(self, "Tag", catalog_id=account_id, tag_key=tag_key, tag_values=tag_values ) lf_tag_pair_property = CfnTagAssociation.LFTagPairProperty( catalog_id=account_id, tag_key=tag_key, tag_values=tag_values ) tag_association = CfnTagAssociation(self, "TagAssociation", lf_tags=[lf_tag_pair_property], resource=CfnTagAssociation.ResourceProperty( table_with_columns=CfnTagAssociation.TableWithColumnsResourceProperty( database_name=database.database_name, column_names=["col1", "col2"], catalog_id=account_id, name=table.table_name ) ) ) tag_association.node.add_dependency(tag) tag_association.node.add_dependency(table)
Attributes
- lf_tags
A structure containing an LF-tag key-value pair.
- resource
DATABASE | TABLE
).The resource for which the LF-tag policy applies.
- See:
- Type:
UTF-8 string (valid values