UNPKG

1.66 kBTypeScriptView Raw
1import * as iam from '@aws-cdk/aws-iam';
2import { Resource } from '@aws-cdk/core';
3import { Construct } from 'constructs';
4import { ILogGroup, SubscriptionFilterOptions } from './log-group';
5import { Construct as CoreConstruct } from '@aws-cdk/core';
6/**
7 * Interface for classes that can be the destination of a log Subscription
8 */
9export interface ILogSubscriptionDestination {
10 /**
11 * Return the properties required to send subscription events to this destination.
12 *
13 * If necessary, the destination can use the properties of the SubscriptionFilter
14 * object itself to configure its permissions to allow the subscription to write
15 * to it.
16 *
17 * The destination may reconfigure its own permissions in response to this
18 * function call.
19 */
20 bind(scope: CoreConstruct, sourceLogGroup: ILogGroup): LogSubscriptionDestinationConfig;
21}
22/**
23 * Properties returned by a Subscription destination
24 */
25export interface LogSubscriptionDestinationConfig {
26 /**
27 * The ARN of the subscription's destination
28 */
29 readonly arn: string;
30 /**
31 * The role to assume to write log events to the destination
32 *
33 * @default No role assumed
34 */
35 readonly role?: iam.IRole;
36}
37/**
38 * Properties for a SubscriptionFilter
39 */
40export interface SubscriptionFilterProps extends SubscriptionFilterOptions {
41 /**
42 * The log group to create the subscription on.
43 */
44 readonly logGroup: ILogGroup;
45}
46/**
47 * A new Subscription on a CloudWatch log group.
48 */
49export declare class SubscriptionFilter extends Resource {
50 constructor(scope: Construct, id: string, props: SubscriptionFilterProps);
51}