Namespace Amazon.CDK.AWS.LakeFormation
AWS::LakeFormation Construct Library
This module is part of the AWS Cloud Development Kit project.
using Amazon.CDK.AWS.LakeFormation;
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.
using Amazon.CDK;
using Amazon.CDK.AWS.Glue.Alpha;
using Amazon.CDK.AWS.LakeFormation;
Stack stack;
string accountId;
var tagKey = "aws";
var tagValues = new [] { "dev" };
var database = new Database(this, "Database");
var table = new S3Table(this, "Table", new S3TableProps {
Database = database,
Columns = new [] { new Column {
Name = "col1",
Type = Schema.STRING
}, new Column {
Name = "col2",
Type = Schema.STRING
} },
DataFormat = DataFormat.CSV
});
var synthesizer = (DefaultStackSynthesizer)stack.Synthesizer;
new CfnDataLakeSettings(this, "DataLakeSettings", new CfnDataLakeSettingsProps {
Admins = new [] { new DataLakePrincipalProperty {
DataLakePrincipalIdentifier = stack.FormatArn(new ArnComponents {
Service = "iam",
Resource = "role",
Region = "",
Account = accountId,
ResourceName = "Admin"
})
}, new DataLakePrincipalProperty {
// The CDK cloudformation execution role.
DataLakePrincipalIdentifier = synthesizer.CloudFormationExecutionRoleArn.Replace("${AWS::Partition}", "aws")
} }
});
var tag = new CfnTag(this, "Tag", new CfnTagProps {
CatalogId = accountId,
TagKey = tagKey,
TagValues = tagValues
});
var lfTagPairProperty = new LFTagPairProperty {
CatalogId = accountId,
TagKey = tagKey,
TagValues = tagValues
};
var tagAssociation = new CfnTagAssociation(this, "TagAssociation", new CfnTagAssociationProps {
LfTags = new [] { lfTagPairProperty },
Resource = new ResourceProperty {
TableWithColumns = new TableWithColumnsResourceProperty {
DatabaseName = database.DatabaseName,
ColumnNames = new [] { "col1", "col2" },
CatalogId = accountId,
Name = table.TableName
}
}
});
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.
Classes
CfnDataCellsFilter | A structure that represents a data cell filter with column-level, row-level, and/or cell-level security. |
CfnDataCellsFilter.ColumnWildcardProperty | A wildcard object, consisting of an optional list of excluded column names or indexes. |
CfnDataCellsFilter.RowFilterProperty | A PartiQL predicate. |
CfnDataCellsFilterProps | Properties for defining a |
CfnDataLakeSettings | The |
CfnDataLakeSettings.DataLakePrincipalProperty | The Lake Formation principal. |
CfnDataLakeSettings.PrincipalPermissionsProperty | Permissions granted to a principal. |
CfnDataLakeSettingsProps | Properties for defining a |
CfnPermissions | The |
CfnPermissions.ColumnWildcardProperty | A wildcard object, consisting of an optional list of excluded column names or indexes. |
CfnPermissions.DatabaseResourceProperty | A structure for the database object. |
CfnPermissions.DataLakePrincipalProperty | The Lake Formation principal. |
CfnPermissions.DataLocationResourceProperty | A structure for a data location object where permissions are granted or revoked. |
CfnPermissions.ResourceProperty | A structure for the resource. |
CfnPermissions.TableResourceProperty | A structure for the table object. |
CfnPermissions.TableWildcardProperty | |
CfnPermissions.TableWithColumnsResourceProperty | A structure for a table with columns object. This object is only used when granting a SELECT permission. |
CfnPermissionsProps | Properties for defining a |
CfnPrincipalPermissions | The |
CfnPrincipalPermissions.ColumnWildcardProperty | A wildcard object, consisting of an optional list of excluded column names or indexes. |
CfnPrincipalPermissions.DatabaseResourceProperty | A structure for the database object. |
CfnPrincipalPermissions.DataCellsFilterResourceProperty | A structure that describes certain columns on certain rows. |
CfnPrincipalPermissions.DataLakePrincipalProperty | The AWS Lake Formation principal. |
CfnPrincipalPermissions.DataLocationResourceProperty | A structure for a data location object where permissions are granted or revoked. |
CfnPrincipalPermissions.LFTagKeyResourceProperty | A structure containing an LF-tag key and values for a resource. |
CfnPrincipalPermissions.LFTagPolicyResourceProperty | A list of LF-tag conditions that define a resource's LF-tag policy. |
CfnPrincipalPermissions.LFTagProperty | The LF-tag key and values attached to a resource. |
CfnPrincipalPermissions.ResourceProperty | A structure for the resource. |
CfnPrincipalPermissions.TableResourceProperty | A structure for the table object. |
CfnPrincipalPermissions.TableWithColumnsResourceProperty | A structure for a table with columns object. This object is only used when granting a SELECT permission. |
CfnPrincipalPermissionsProps | Properties for defining a |
CfnResource | The |
CfnResourceProps | Properties for defining a |
CfnTag | The |
CfnTagAssociation | The |
CfnTagAssociation.DatabaseResourceProperty | A structure for the database object. |
CfnTagAssociation.LFTagPairProperty | A structure containing the catalog ID, tag key, and tag values of an LF-tag key-value pair. |
CfnTagAssociation.ResourceProperty | A structure for the resource. |
CfnTagAssociation.TableResourceProperty | A structure for the table object. |
CfnTagAssociation.TableWithColumnsResourceProperty | A structure for a table with columns object. This object is only used when granting a SELECT permission. |
CfnTagAssociationProps | Properties for defining a |
CfnTagProps | Properties for defining a |
Interfaces
CfnDataCellsFilter.IColumnWildcardProperty | A wildcard object, consisting of an optional list of excluded column names or indexes. |
CfnDataCellsFilter.IRowFilterProperty | A PartiQL predicate. |
CfnDataLakeSettings.IDataLakePrincipalProperty | The Lake Formation principal. |
CfnDataLakeSettings.IPrincipalPermissionsProperty | Permissions granted to a principal. |
CfnPermissions.IColumnWildcardProperty | A wildcard object, consisting of an optional list of excluded column names or indexes. |
CfnPermissions.IDatabaseResourceProperty | A structure for the database object. |
CfnPermissions.IDataLakePrincipalProperty | The Lake Formation principal. |
CfnPermissions.IDataLocationResourceProperty | A structure for a data location object where permissions are granted or revoked. |
CfnPermissions.IResourceProperty | A structure for the resource. |
CfnPermissions.ITableResourceProperty | A structure for the table object. |
CfnPermissions.ITableWildcardProperty | |
CfnPermissions.ITableWithColumnsResourceProperty | A structure for a table with columns object. This object is only used when granting a SELECT permission. |
CfnPrincipalPermissions.IColumnWildcardProperty | A wildcard object, consisting of an optional list of excluded column names or indexes. |
CfnPrincipalPermissions.IDatabaseResourceProperty | A structure for the database object. |
CfnPrincipalPermissions.IDataCellsFilterResourceProperty | A structure that describes certain columns on certain rows. |
CfnPrincipalPermissions.IDataLakePrincipalProperty | The AWS Lake Formation principal. |
CfnPrincipalPermissions.IDataLocationResourceProperty | A structure for a data location object where permissions are granted or revoked. |
CfnPrincipalPermissions.ILFTagKeyResourceProperty | A structure containing an LF-tag key and values for a resource. |
CfnPrincipalPermissions.ILFTagPolicyResourceProperty | A list of LF-tag conditions that define a resource's LF-tag policy. |
CfnPrincipalPermissions.ILFTagProperty | The LF-tag key and values attached to a resource. |
CfnPrincipalPermissions.IResourceProperty | A structure for the resource. |
CfnPrincipalPermissions.ITableResourceProperty | A structure for the table object. |
CfnPrincipalPermissions.ITableWithColumnsResourceProperty | A structure for a table with columns object. This object is only used when granting a SELECT permission. |
CfnTagAssociation.IDatabaseResourceProperty | A structure for the database object. |
CfnTagAssociation.ILFTagPairProperty | A structure containing the catalog ID, tag key, and tag values of an LF-tag key-value pair. |
CfnTagAssociation.IResourceProperty | A structure for the resource. |
CfnTagAssociation.ITableResourceProperty | A structure for the table object. |
CfnTagAssociation.ITableWithColumnsResourceProperty | A structure for a table with columns object. This object is only used when granting a SELECT permission. |
ICfnDataCellsFilterProps | Properties for defining a |
ICfnDataLakeSettingsProps | Properties for defining a |
ICfnPermissionsProps | Properties for defining a |
ICfnPrincipalPermissionsProps | Properties for defining a |
ICfnResourceProps | Properties for defining a |
ICfnTagAssociationProps | Properties for defining a |
ICfnTagProps | Properties for defining a |