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
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" {
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" {
resource "aws_glue_catalog_database" "data_lake_raw" {
name = "data_lake_raw"
}
resource "aws_glue_catalog_database" "data_lake_curated" {
name = "data_lake_curated"
resource "aws_glue_catalog_database" "aws_glue_catalog_database" {
name = var.name
description = var.description
Parameters
-
arn
optional computed - string -
catalog_id
optional computed - string -
description
optional - string -
id
optional computed - string -
location_uri
optional - string -
name
required - string -
parameters
optional - map from string to string
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
Type: AWS::Glue::Database
Properties:
CatalogId: !Ref AWS::AccountId
DatabaseInput:
Description: Raw data
LocationUri: !Join ['/', ['s3:/', !ImportValue data-lake-DataLakeRawBucketName]]
Type: AWS::Glue::Database
Properties:
CatalogId: !Ref AWS::AccountId
DatabaseInput:
Description: Raw data
LocationUri: !Join ['/', ['s3:/', !ImportValue data-lake-DataLakeRawBucketName]]
Type: AWS::Glue::Database
Properties:
CatalogId: !Ref AWS::AccountId
DatabaseInput:
Description: Raw data
LocationUri: !Join ['/', ['s3:/', !ImportValue data-lake-DataLakeRawBucketName]]
Type: AWS::Glue::Database
Properties:
CatalogId: !Ref AWS::AccountId
DatabaseInput:
Description: Raw data
LocationUri: !Join ['/', ['s3:/', !ImportValue data-lake-DataLakeRawBucketName]]
Type: AWS::Glue::Database
Properties:
CatalogId: !Ref AWS::AccountId
DatabaseInput:
Name: ${self:custom.stage}_level_1_database
Level1GlueAccess:
"Type" : "AWS::Glue::Database",
"Properties" : {
"CatalogId" : { "Ref" : "AWS::AccountId" },
"DatabaseInput" : {
"Name" : "porter_raw_dev"
}
"Type": "AWS::Glue::Database",
"Condition": "Always",
"DependsOn": "AnotherThing",
"Properties": {
"CatalogId": "123456",
"DatabaseInput": {
"Type": "AWS::Glue::Database",
"Properties": {
"CatalogId": {
"Ref": "AWS::AccountId"
},
"DatabaseInput": {
"Type": "AWS::Glue::Database",
"Properties": {
"CatalogId": {
"Ref": "AWS::AccountId"
},
"DatabaseInput": {
"Type": "AWS::Glue::Database",
"Properties": {
"CatalogId": {
"Ref": "AWS::AccountId"
},
"DatabaseInput": {
Parameters
-
DatabaseInput
required - DatabaseInput -
CatalogId
required - String
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, adrianosouzaa/engenharia-dados and marianabernado/bootcamp-eng-dados source code examples are useful. See the CloudFormation Example section for further details.