AWS Glue Catalog Database

This page shows how to write Terraform and CloudFormation for AWS Glue Catalog Database and write them securely.

aws_glue_catalog_database (Terraform)

The Catalog Database in AWS Glue can be configured in Terraform with the resource name aws_glue_catalog_database. The following sections describe 4 examples of how to use the resource and its parameters.

Example Usage from GitHub

glue.tf#L1
resource "aws_glue_catalog_database" "twitter_streaming_raw" {
  name = "twitter_streaming_raw"
  description = "Raw database for all twitter streaming data"
}

resource "aws_glue_catalog_database" "twitter_streaming_modeled" {
test_database.tf#L1
resource "aws_glue_catalog_database" "test_analytical_dataset_generation" {
  name        = "test_analytical_dataset_generation"
  description = "Database for the Analytical E2E Tests"
}

resource "aws_glue_catalog_database" "test_analytical_metrics_database" {
glue.tf#L34
resource "aws_glue_catalog_database" "data_lake_raw" {
  name = "data_lake_raw"
}

resource "aws_glue_catalog_database" "data_lake_curated" {
  name = "data_lake_curated"
main.tf#L1
resource "aws_glue_catalog_database" "aws_glue_catalog_database" {
  name          = var.name
  description   = var.description

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

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

AWS::Glue::Database (CloudFormation)

The Database in Glue can be configured in CloudFormation with the resource name AWS::Glue::Database. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

glue.yml#L6
    Type: AWS::Glue::Database
    Properties:
      CatalogId: !Ref AWS::AccountId
      DatabaseInput:
        Description: Raw data
        LocationUri: !Join ['/', ['s3:/', !ImportValue data-lake-DataLakeRawBucketName]]
1.glue_datalake.yml#L6
    Type: AWS::Glue::Database
    Properties:
      CatalogId: !Ref AWS::AccountId
      DatabaseInput:
        Description: Raw data
        LocationUri: !Join ['/', ['s3:/', !ImportValue data-lake-DataLakeRawBucketName]]
1.glue_datalake.yml#L6
    Type: AWS::Glue::Database
    Properties:
      CatalogId: !Ref AWS::AccountId
      DatabaseInput:
        Description: Raw data
        LocationUri: !Join ['/', ['s3:/', !ImportValue data-lake-DataLakeRawBucketName]]
glue_datalake.yml#L6
    Type: AWS::Glue::Database
    Properties:
      CatalogId: !Ref AWS::AccountId
      DatabaseInput:
        Description: Raw data
        LocationUri: !Join ['/', ['s3:/', !ImportValue data-lake-DataLakeRawBucketName]]
serverless.yml#L22
      Type: AWS::Glue::Database
      Properties:
        CatalogId: !Ref AWS::AccountId
        DatabaseInput:
          Name: ${self:custom.stage}_level_1_database
    Level1GlueAccess:
porter_stack.json#L91
            "Type" : "AWS::Glue::Database",
            "Properties" : {
                "CatalogId" : { "Ref" : "AWS::AccountId" },
                "DatabaseInput" : {
                    "Name" : "porter_raw_dev"
                }
glue-database-no-defaults.json#L20
      "Type": "AWS::Glue::Database",
      "Condition": "Always",
      "DependsOn": "AnotherThing",
      "Properties": {
        "CatalogId": "123456",
        "DatabaseInput": {
glue.json#L108
            "Type": "AWS::Glue::Database",
            "Properties": {
                "CatalogId": {
                    "Ref": "AWS::AccountId"
                },
                "DatabaseInput": {
glue.json#L105
            "Type": "AWS::Glue::Database",
            "Properties": {
                "CatalogId": {
                    "Ref": "AWS::AccountId"
                },
                "DatabaseInput": {
glue-database-defaults.json#L10
      "Type": "AWS::Glue::Database",
      "Properties": {
        "CatalogId": {
          "Ref": "AWS::AccountId"
        },
        "DatabaseInput": {

Parameters

Explanation in CloudFormation Registry

The AWS::Glue::Database resource specifies a logical grouping of tables in AWS Glue. For more information, see Defining a Database in Your Data Catalog and Database Structure in the AWS Glue Developer Guide.

Frequently asked questions

What is AWS Glue Catalog Database?

AWS Glue Catalog Database is a resource for Glue of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Glue Catalog Database?

For Terraform, the BuildSomethingCool/twitter_terraform_deploy, dwp/aws-analytical-env and AdastraCZ/aws_data_platform source code examples are useful. See the Terraform Example section for further details.

For CloudFormation, the gabrielosluz/engenharia-de-dados, marianabernado/bootcamp-eng-dados and adrianosouzaa/engenharia-dados source code examples are useful. See the CloudFormation Example section for further details.