Resource: aws_athena_data_catalog

Provides an Athena data catalog.

More information about Athena and Athena data catalogs can be found in the Athena User Guide.

Example Usage

resource "aws_athena_data_catalog" "example" {
  name        = "athena-data-catalog"
  description = "Example Athena data catalog"
  type        = "LAMBDA"

  parameters = {
    "function" = "arn:aws:lambda:eu-central-1:123456789012:function:not-important-lambda-function"
  }

  tags = {
    Name = "example-athena-data-catalog"
  }
}

Hive based Data Catalog

resource "aws_athena_data_catalog" "example" {
  name        = "hive-data-catalog"
  description = "Hive based Data Catalog"
  type        = "HIVE"

  parameters = {
    "metadata-function" = "arn:aws:lambda:eu-central-1:123456789012:function:not-important-lambda-function"
  }
}

Glue based Data Catalog

resource "aws_athena_data_catalog" "example" {
  name        = "glue-data-catalog"
  description = "Glue based Data Catalog"
  type        = "GLUE"

  parameters = {
    "catalog-id" = "123456789012"
  }
}

Lambda based Data Catalog

resource "aws_athena_data_catalog" "example" {
  name        = "lambda-data-catalog"
  description = "Lambda based Data Catalog"
  type        = "LAMBDA"

  parameters = {
    "metadata-function" = "arn:aws:lambda:eu-central-1:123456789012:function:not-important-lambda-function-1"
    "record-function"   = "arn:aws:lambda:eu-central-1:123456789012:function:not-important-lambda-function-2"
  }
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import data catalogs using their name. For example:

import {
  to = aws_athena_data_catalog.example
  id = "example-data-catalog"
}

Using terraform import, import data catalogs using their name. For example:

% terraform import aws_athena_data_catalog.example example-data-catalog