Skip to content

loadBalancerLogsTable

View Source

Load balancers in AWS write access logs to an S3 bucket. This component can be used to create an AWS Glue table configured to query those logs with Athena. This component can be used on its own or automatically created by passing accessLogsTable parameter to the loadBalancer component.

import * as saws from '@stackattack/aws';
const ctx = saws.context();
const vpc = saws.vpc(ctx);
const logsBucket = saws.bucket(ctx);
const loadBalancer = saws.loadBalancer(ctx, {
network: vpc.network("public")
});
function loadBalancerLogsTable(ctx: Context, args: LoadBalancerLogsTableArgs): CatalogTable
  • (CatalogTable) -

Configuration options for create a load balancer logs table

  • bucket (Input<BucketInput>) - Bucket where load balancer logs are stored
  • database? (Input<string>) - Database name to create the table in; default to “default”
  • name (Input<string>) - Name of the table used for query logs
  • noPrefix? (boolean) - Whether to skip adding a prefix to the context
  • prefix? (Input<string>) - Prefix within the bucket where load balancer logs are stored. Note that all load balancer logs are stored with a prefix like “AWSLogs/<account_id>/elasticloadbalancing//”. That will be appended automatically—if specified this should only include the prefix before “AWSLogs/…”.