UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

60 lines (59 loc) 2.57 kB
import * as pulumi from "@pulumi/pulumi"; import * as lambda from "../lambda"; import * as logGroup from "./logGroup"; import * as logSubscriptionFilter from "./logSubscriptionFilter"; /** * Arguments to control the event rule subscription. Currently empty, but still defined in case of * future need. */ export interface LogGroupEventSubscriptionArgs { /** * A valid CloudWatch Logs filter pattern for subscribing to a filtered stream of log events. If * not provided, the empty-string pattern will be used. */ filterPattern?: string; } export interface LogGroupEvent { awslogs: { data: string; }; } export interface DecodedLogGroupEvent { owner: string; logGroup: string; logStream: string; subscriptionFilters: string[]; messageType: string; logEvents: LogGroupEventRecord[]; } export interface LogGroupEventRecord { id: string; timestamp: number; message: string; } export type LogGroupEventHandler = lambda.EventHandler<LogGroupEvent, void>; export declare class LogGroupEventSubscription extends lambda.EventSubscription { readonly logGroup: logGroup.LogGroup; readonly logSubscriptionFilter: logSubscriptionFilter.LogSubscriptionFilter; constructor(name: string, logGroup: logGroup.LogGroup, handler: LogGroupEventHandler, args?: LogGroupEventSubscriptionArgs, opts?: pulumi.ComponentResourceOptions); } declare module "./logGroup" { interface LogGroup { /** * Creates a new subscription to events fired from this LogGroup to the handler provided, * along with options to control the behavior of the subscription. * * The events will be produced in raw (gzipped + base64 encoded) form. */ onEvent(name: string, handler: LogGroupEventHandler, args?: LogGroupEventSubscriptionArgs, opts?: pulumi.ComponentResourceOptions): LogGroupEventSubscription; /** * Creates a new subscription to events fired from this LogGroup to the callback provided, * along with options to control the behavior of the subscription. * * The events will be provided in their decoded form. Because this event hookup needs to * execute code to convert the raw messages, it can only be passed an [EntryPoint] callback, * not a [lambda.Function] instance. */ onDecodedEvent(name: string, callback: lambda.Callback<DecodedLogGroupEvent, void>, args?: LogGroupEventSubscriptionArgs, opts?: pulumi.ComponentResourceOptions): LogGroupEventSubscription; } }