cdk-athena-log
Version:
A CDK construct to create an Athena table for querying ALB logs.
43 lines (42 loc) • 1.46 kB
TypeScript
import { aws_glue as glue } from 'aws-cdk-lib';
import { Construct } from 'constructs';
/**
* Properties for the AthenaTableForAlb construct.
*/
export interface AthenaTableForAlbProps {
/**
* The name of the S3 bucket where the ALB access logs are stored.
*/
readonly logBucketName: string;
/**
* The name of the Glue database where the table will be created.
* The user is responsible for ensuring this database exists.
*/
readonly databaseName: string;
/**
* The name for the Glue table.
*/
readonly tableName: string;
/**
* The start date for the partition projection.
* You must provide a value in 'YYYY/MM/DD' format.
*/
readonly projectionStartDate: string;
/**
* The prefix where ALB access logs are stored within the bucket.
* e.g., if logs are at `s3://my-bucket/my-prefix/AWSLogs/...`, specify 'my-prefix'.
* @default Logs are expected at the root level (`s3://bucket-name/AWSLogs/...`).
*/
readonly logPrefix?: string;
}
/**
* A CDK construct to create an AWS Glue table for querying ALB access logs with Athena.
* It automatically configures partition projection by date, simplifying log analysis.
*/
export declare class AthenaTableForAlb extends Construct {
/**
* The created Glue Table resource.
*/
readonly table: glue.CfnTable;
constructor(scope: Construct, id: string, props: AthenaTableForAlbProps);
}