Skip to content

Resource: awsGlueCatalogDatabase

Provides a Glue Catalog Database Resource. You can refer to the Glue Developer Guide for a full explanation of the Glue Data Catalog functionality

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.glueCatalogDatabase.GlueCatalogDatabase(
  this,
  "aws_glue_catalog_database",
  {
    name: "MyCatalogDatabase",
  }
);

Create Table Default Permissions

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.glueCatalogDatabase.GlueCatalogDatabase(
  this,
  "aws_glue_catalog_database",
  {
    createTableDefaultPermission: [
      {
        permissions: ["SELECT"],
        principal: {
          dataLakePrincipalIdentifier: "IAM_ALLOWED_PRINCIPALS",
        },
      },
    ],
    name: "MyCatalogDatabase",
  }
);

Argument Reference

The following arguments are supported:

  • catalogId - (Optional) ID of the Glue Catalog to create the database in. If omitted, this defaults to the AWS Account ID.
  • createTableDefaultPermission - (Optional) Creates a set of default permissions on the table for principals. See createTableDefaultPermission below.
  • description - (Optional) Description of the database.
  • locationUri - (Optional) Location of the database (for example, an HDFS path).
  • name - (Required) Name of the database. The acceptable characters are lowercase letters, numbers, and the underscore character.
  • parameters - (Optional) List of key-value pairs that define parameters and properties of the database.
  • targetDatabase - (Optional) Configuration block for a target database for resource linking. See targetDatabase below.

targetDatabase

  • catalogId - (Required) ID of the Data Catalog in which the database resides.
  • databaseName - (Required) Name of the catalog database.

createTableDefaultPermission

  • permissions - (Optional) The permissions that are granted to the principal.
  • principal - (Optional) The principal who is granted permissions.. See principal below.

principal

  • dataLakePrincipalIdentifier - (Optional) An identifier for the Lake Formation principal.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - ARN of the Glue Catalog Database.
  • id - Catalog ID and name of the database

Import

Glue Catalog Databases can be imported using the catalogId:name. If you have not set a Catalog ID specify the AWS Account ID that the database is in, e.g.,

$ terraform import aws_glue_catalog_database.database 123456789012:my_database