Skip to content

Resource: awsAthenaDataCatalog

Provides an Athena data catalog.

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

-> Tip: for a more detailed explanation on the usage of parameters, see the DataCatalog API documentation

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.athenaDataCatalog.AthenaDataCatalog(this, "example", {
  description: "Example Athena data catalog",
  name: "athena-data-catalog",
  parameters: {
    function:
      "arn:aws:lambda:eu-central-1:123456789012:function:not-important-lambda-function",
  },
  tags: {
    Name: "example-athena-data-catalog",
  },
  type: "LAMBDA",
});

Hive based Data Catalog

/*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.athenaDataCatalog.AthenaDataCatalog(this, "example", {
  description: "Hive based Data Catalog",
  name: "hive-data-catalog",
  parameters: {
    "metadata-function":
      "arn:aws:lambda:eu-central-1:123456789012:function:not-important-lambda-function",
  },
  type: "HIVE",
});

Glue based Data Catalog

/*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.athenaDataCatalog.AthenaDataCatalog(this, "example", {
  description: "Glue based Data Catalog",
  name: "glue-data-catalog",
  parameters: {
    "catalog-id": "123456789012",
  },
  type: "GLUE",
});

Lambda based Data Catalog

/*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.athenaDataCatalog.AthenaDataCatalog(this, "example", {
  description: "Lambda based Data Catalog",
  name: "lambda-data-catalog",
  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",
  },
  type: "LAMBDA",
});

Argument Reference

The following arguments are supported:

  • name - (Required) Name of the data catalog. The catalog name must be unique for the AWS account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.
  • type - (Required) Type of data catalog: lambda for a federated catalog, glue for AWS Glue Catalog, or hive for an external hive metastore.
  • parameters - (Required) Key value pairs that specifies the Lambda function or functions to use for the data catalog. The mapping used depends on the catalog type.
  • description - (Required) Description of the data catalog.
  • tags - (Optional) Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Attributes Reference

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

  • id - Name of the data catalog.
  • arn - ARN of the data catalog.
  • tagsAll - Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Import

Data catalogs can be imported using their name, e.g.,

$ terraform import aws_athena_data_catalog.example example-data-catalog