AWSCDK::LakeFormation

14 types

AWS::LakeFormation Construct Library

This module is part of the AWS Cloud Development Kit project.

require 'aws-cdk-lib'

There are no official hand-written (L2) constructs for this service yet. Here are some suggestions on how to proceed:

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.

require 'aws-cdk-lib'
require 'aws-cdk-aws-glue-alpha'

stack = nil # AWSCDK::Stack
 = nil


tag_key = "aws"
tag_values = ["dev"]

database = Database.new(self, "Database")

table = S3Table.new(self, "Table", {
    database: database,
    columns: [
        {
            name: "col1",
            type: Schema.STRING,
        },
        {
            name: "col2",
            type: Schema.STRING,
        },
    ],
    data_format: DataFormat.CSV,
})

synthesizer = stack.synthesizer
AWSCDK::LakeFormation::CfnDataLakeSettings.new(self, "DataLakeSettings", {
    admins: [
        {
            data_lake_principal_identifier: stack.format_arn({
                service: "iam",
                resource: "role",
                region: "",
                account: ,
                resource_name: "Admin",
            }),
        },
        {
            # The CDK cloudformation execution role.
            data_lake_principal_identifier: synthesizer.cloud_formation_execution_role_arn.replace("${AWS::Partition}", "aws"),
        },
    ],
})

tag = AWSCDK::LakeFormation::CfnTag.new(self, "Tag", {
    catalog_id: ,
    tag_key: tag_key,
    tag_values: tag_values,
})

lf_tag_pair_property = {
    catalog_id: ,
    tag_key: tag_key,
    tag_values: tag_values,
}

tag_association = AWSCDK::LakeFormation::CfnTagAssociation.new(self, "TagAssociation", {
    lf_tags: [lf_tag_pair_property],
    resource: {
        table_with_columns: {
            database_name: database.database_name,
            column_names: ["col1", "col2"],
            catalog_id: ,
            name: table.table_name,
        },
    },
})

tag_association.node.add_dependency(tag)
tag_association.node.add_dependency(table)

Additionally, you may need to use the lakeformation console to give permissions, particularly to give the cdk-exec-role tagging permissions.

API Reference

Classes 7

CfnDataCellsFilterA structure that represents a data cell filter with column-level, row-level, and/or cell-l CfnDataLakeSettingsThe `AWS::LakeFormation::DataLakeSettings` resource is an AWS Lake Formation resource type CfnPermissionsThe `AWS::LakeFormation::Permissions` resource represents the permissions that a principal CfnPrincipalPermissionsThe `AWS::LakeFormation::PrincipalPermissions` resource represents the permissions that a CfnResourceThe `AWS::LakeFormation::Resource` represents the data ( buckets and folders) that is bei CfnTagThe `AWS::LakeFormation::Tag` resource represents an LF-tag, which consists of a key and o CfnTagAssociationThe `AWS::LakeFormation::TagAssociation` resource represents an assignment of an LF-tag to

Interfaces 7

CfnDataCellsFilterPropsProperties for defining a `CfnDataCellsFilter`. CfnDataLakeSettingsPropsProperties for defining a `CfnDataLakeSettings`. CfnPermissionsPropsProperties for defining a `CfnPermissions`. CfnPrincipalPermissionsPropsProperties for defining a `CfnPrincipalPermissions`. CfnResourcePropsProperties for defining a `CfnResource`. CfnTagAssociationPropsProperties for defining a `CfnTagAssociation`. CfnTagPropsProperties for defining a `CfnTag`.