Package software.amazon.awscdk.services.lakeformation
AWS::LakeFormation Construct Library
This module is part of the AWS Cloud Development Kit project.
import software.amazon.awscdk.services.lakeformation.*;
There are no official hand-written (L2) constructs for this service yet. Here are some suggestions on how to proceed:
- Search Construct Hub for LakeFormation construct libraries
- Use the automatically generated L1 constructs, in the same way you would use the CloudFormation AWS::LakeFormation resources directly.
There are no hand-written (L2) constructs for this service yet. However, you can still use the automatically generated L1 constructs, and use this service exactly as you would using CloudFormation directly.
For more information on the resources and properties available for this service, see the CloudFormation documentation for AWS::LakeFormation.
(Read the CDK Contributing Guide and submit an RFC if you are interested in contributing to this construct library.)
Example
Here is an example of creating a glue table and putting lakeformation tags on it. Note: this example uses deprecated constructs and overly permissive IAM roles. This example is meant to give a general idea of using the L1s; it is not production level.
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);
Additionally, you may need to use the lakeformation console to give permissions, particularly to give the cdk-exec-role tagging permissions.
-
ClassDescriptionA structure that represents a data cell filter with column-level, row-level, and/or cell-level security.A fluent builder for
CfnDataCellsFilter.A wildcard object, consisting of an optional list of excluded column names or indexes.A builder forCfnDataCellsFilter.ColumnWildcardPropertyAn implementation forCfnDataCellsFilter.ColumnWildcardPropertyA PartiQL predicate.A builder forCfnDataCellsFilter.RowFilterPropertyAn implementation forCfnDataCellsFilter.RowFilterPropertyProperties for defining aCfnDataCellsFilter.A builder forCfnDataCellsFilterPropsAn implementation forCfnDataCellsFilterPropsTheAWS::LakeFormation::DataLakeSettingsresource is an AWS Lake Formation resource type that manages the data lake settings for your account.A fluent builder forCfnDataLakeSettings.The Lake Formation principal.A builder forCfnDataLakeSettings.DataLakePrincipalPropertyAn implementation forCfnDataLakeSettings.DataLakePrincipalPropertyPermissions granted to a principal.A builder forCfnDataLakeSettings.PrincipalPermissionsPropertyAn implementation forCfnDataLakeSettings.PrincipalPermissionsPropertyProperties for defining aCfnDataLakeSettings.A builder forCfnDataLakeSettingsPropsAn implementation forCfnDataLakeSettingsPropsTheAWS::LakeFormation::Permissionsresource represents the permissions that a principal has on an AWS Glue Data Catalog resource (such as AWS Glue database or AWS Glue tables).A fluent builder forCfnPermissions.A wildcard object, consisting of an optional list of excluded column names or indexes.A builder forCfnPermissions.ColumnWildcardPropertyAn implementation forCfnPermissions.ColumnWildcardPropertyA structure for the database object.A builder forCfnPermissions.DatabaseResourcePropertyAn implementation forCfnPermissions.DatabaseResourcePropertyThe Lake Formation principal.A builder forCfnPermissions.DataLakePrincipalPropertyAn implementation forCfnPermissions.DataLakePrincipalPropertyA structure for a data location object where permissions are granted or revoked.A builder forCfnPermissions.DataLocationResourcePropertyAn implementation forCfnPermissions.DataLocationResourcePropertyA structure for the resource.A builder forCfnPermissions.ResourcePropertyAn implementation forCfnPermissions.ResourcePropertyA structure for the table object.A builder forCfnPermissions.TableResourcePropertyAn implementation forCfnPermissions.TableResourcePropertyExample:A builder forCfnPermissions.TableWildcardPropertyAn implementation forCfnPermissions.TableWildcardPropertyA structure for a table with columns object.A builder forCfnPermissions.TableWithColumnsResourcePropertyAn implementation forCfnPermissions.TableWithColumnsResourcePropertyProperties for defining aCfnPermissions.A builder forCfnPermissionsPropsAn implementation forCfnPermissionsPropsTheAWS::LakeFormation::PrincipalPermissionsresource represents the permissions that a principal has on a Data Catalog resource (such as AWS Glue databases or AWS Glue tables).A fluent builder forCfnPrincipalPermissions.A wildcard object, consisting of an optional list of excluded column names or indexes.A builder forCfnPrincipalPermissions.ColumnWildcardPropertyAn implementation forCfnPrincipalPermissions.ColumnWildcardPropertyA structure for the database object.A builder forCfnPrincipalPermissions.DatabaseResourcePropertyAn implementation forCfnPrincipalPermissions.DatabaseResourcePropertyA structure that describes certain columns on certain rows.A builder forCfnPrincipalPermissions.DataCellsFilterResourcePropertyAn implementation forCfnPrincipalPermissions.DataCellsFilterResourcePropertyThe AWS Lake Formation principal.A builder forCfnPrincipalPermissions.DataLakePrincipalPropertyAn implementation forCfnPrincipalPermissions.DataLakePrincipalPropertyA structure for a data location object where permissions are granted or revoked.A builder forCfnPrincipalPermissions.DataLocationResourcePropertyAn implementation forCfnPrincipalPermissions.DataLocationResourcePropertyA structure containing an LF-tag key and values for a resource.A builder forCfnPrincipalPermissions.LFTagKeyResourcePropertyAn implementation forCfnPrincipalPermissions.LFTagKeyResourcePropertyA list of LF-tag conditions that define a resource's LF-tag policy.A builder forCfnPrincipalPermissions.LFTagPolicyResourcePropertyAn implementation forCfnPrincipalPermissions.LFTagPolicyResourcePropertyThe LF-tag key and values attached to a resource.A builder forCfnPrincipalPermissions.LFTagPropertyAn implementation forCfnPrincipalPermissions.LFTagPropertyA structure for the resource.A builder forCfnPrincipalPermissions.ResourcePropertyAn implementation forCfnPrincipalPermissions.ResourcePropertyA structure for the table object.A builder forCfnPrincipalPermissions.TableResourcePropertyAn implementation forCfnPrincipalPermissions.TableResourcePropertyA structure for a table with columns object.A builder forCfnPrincipalPermissions.TableWithColumnsResourcePropertyAn implementation forCfnPrincipalPermissions.TableWithColumnsResourcePropertyProperties for defining aCfnPrincipalPermissions.A builder forCfnPrincipalPermissionsPropsAn implementation forCfnPrincipalPermissionsPropsTheAWS::LakeFormation::Resourcerepresents the data ( buckets and folders) that is being registered with AWS Lake Formation .A fluent builder forCfnResource.Properties for defining aCfnResource.A builder forCfnResourcePropsAn implementation forCfnResourcePropsTheAWS::LakeFormation::Tagresource represents an LF-tag, which consists of a key and one or more possible values for the key.A fluent builder forCfnTag.TheAWS::LakeFormation::TagAssociationresource represents an assignment of an LF-tag to a Data Catalog resource (database, table, or column).A fluent builder forCfnTagAssociation.A structure for the database object.A builder forCfnTagAssociation.DatabaseResourcePropertyAn implementation forCfnTagAssociation.DatabaseResourcePropertyA structure containing the catalog ID, tag key, and tag values of an LF-tag key-value pair.A builder forCfnTagAssociation.LFTagPairPropertyAn implementation forCfnTagAssociation.LFTagPairPropertyA structure for the resource.A builder forCfnTagAssociation.ResourcePropertyAn implementation forCfnTagAssociation.ResourcePropertyA structure for the table object.A builder forCfnTagAssociation.TableResourcePropertyAn implementation forCfnTagAssociation.TableResourcePropertyA structure for a table with columns object.A builder forCfnTagAssociation.TableWithColumnsResourcePropertyAn implementation forCfnTagAssociation.TableWithColumnsResourcePropertyProperties for defining aCfnTagAssociation.A builder forCfnTagAssociationPropsAn implementation forCfnTagAssociationPropsProperties for defining aCfnTag.A builder forCfnTagPropsAn implementation forCfnTagPropsA reference to a DataCellsFilter resource.A builder forDataCellsFilterReferenceAn implementation forDataCellsFilterReferenceA reference to a DataLakeSettings resource.A builder forDataLakeSettingsReferenceAn implementation forDataLakeSettingsReference(experimental) Indicates that this resource can be referenced as a DataCellsFilter.Internal default implementation forIDataCellsFilterRef.A proxy class which represents a concrete javascript instance of this type.(experimental) Indicates that this resource can be referenced as a DataLakeSettings.Internal default implementation forIDataLakeSettingsRef.A proxy class which represents a concrete javascript instance of this type.(experimental) Indicates that this resource can be referenced as a Permissions.Internal default implementation forIPermissionsRef.A proxy class which represents a concrete javascript instance of this type.(experimental) Indicates that this resource can be referenced as a PrincipalPermissions.Internal default implementation forIPrincipalPermissionsRef.A proxy class which represents a concrete javascript instance of this type.(experimental) Indicates that this resource can be referenced as a Resource.Internal default implementation forIResourceRef.A proxy class which represents a concrete javascript instance of this type.(experimental) Indicates that this resource can be referenced as a TagAssociation.Internal default implementation forITagAssociationRef.A proxy class which represents a concrete javascript instance of this type.(experimental) Indicates that this resource can be referenced as a Tag.Internal default implementation forITagRef.A proxy class which represents a concrete javascript instance of this type.A reference to a Permissions resource.A builder forPermissionsReferenceAn implementation forPermissionsReferenceA reference to a PrincipalPermissions resource.A builder forPrincipalPermissionsReferenceAn implementation forPrincipalPermissionsReferenceA reference to a Resource resource.A builder forResourceReferenceAn implementation forResourceReferenceA reference to a TagAssociation resource.A builder forTagAssociationReferenceAn implementation forTagAssociationReferenceA reference to a Tag resource.A builder forTagReferenceAn implementation forTagReference