UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

80 lines (79 loc) 2.44 kB
import type { Construct } from 'constructs'; import type { IResource, RemovalPolicy } from '../../core'; import { Resource } from '../../core'; import type { ILogGroupRef, ILogStreamRef, LogStreamReference } from '../../interfaces/generated/aws-logs-interfaces.generated'; export interface ILogStream extends IResource, ILogStreamRef { /** * The name of this log stream * @attribute */ readonly logStreamName: string; } /** * Attributes for importing a LogStream */ export interface LogStreamAttributes { /** * The name of the log stream */ readonly logStreamName: string; /** * The name of the log group * * @default - When not provided, logStreamRef will throw an error */ readonly logGroupName: string; } /** * Properties for a LogStream */ export interface LogStreamProps { /** * The log group to create a log stream for. */ readonly logGroup: ILogGroupRef; /** * The name of the log stream to create. * * The name must be unique within the log group. * * @default Automatically generated */ readonly logStreamName?: string; /** * Determine what happens when the log stream resource is removed from the * app. * * Normally you want to retain the log stream so you can diagnose issues from * logs even after a deployment that no longer includes the log stream. * * The date-based retention policy of your log group will age out the logs * after a certain time. * * @default RemovalPolicy.Retain */ readonly removalPolicy?: RemovalPolicy; } /** * Define a Log Stream in a Log Group */ export declare class LogStream extends Resource implements ILogStream { /** Uniquely identifies this class. */ static readonly PROPERTY_INJECTION_ID: string; /** * Import an existing LogStream */ static fromLogStreamName(scope: Construct, id: string, logStreamName: string): ILogStream; /** * Import an existing LogStream using its attributes */ static fromLogStreamAttributes(scope: Construct, id: string, attrs: LogStreamAttributes): ILogStream; private readonly resource; private readonly logGroupName; /** * The name of this log stream */ get logStreamName(): string; constructor(scope: Construct, id: string, props: LogStreamProps); get logStreamRef(): LogStreamReference; }