UNPKG

2.39 kBTypeScriptView Raw
1import * as iam from '@aws-cdk/aws-iam';
2import * as cdk from '@aws-cdk/core';
3import { Construct } from 'constructs';
4import { ILogGroup } from './log-group';
5import { ILogSubscriptionDestination, LogSubscriptionDestinationConfig } from './subscription-filter';
6import { Construct as CoreConstruct } from '@aws-cdk/core';
7/**
8 * Properties for a CrossAccountDestination
9 */
10export interface CrossAccountDestinationProps {
11 /**
12 * The name of the log destination.
13 *
14 * @default Automatically generated
15 */
16 readonly destinationName?: string;
17 /**
18 * The role to assume that grants permissions to write to 'target'.
19 *
20 * The role must be assumable by 'logs.{REGION}.amazonaws.com'.
21 */
22 readonly role: iam.IRole;
23 /**
24 * The log destination target's ARN
25 */
26 readonly targetArn: string;
27}
28/**
29 * A new CloudWatch Logs Destination for use in cross-account scenarios
30 *
31 * CrossAccountDestinations are used to subscribe a Kinesis stream in a
32 * different account to a CloudWatch Subscription.
33 *
34 * Consumers will hardly ever need to use this class. Instead, directly
35 * subscribe a Kinesis stream using the integration class in the
36 * `@aws-cdk/aws-logs-destinations` package; if necessary, a
37 * `CrossAccountDestination` will be created automatically.
38 *
39 * @resource AWS::Logs::Destination
40 */
41export declare class CrossAccountDestination extends cdk.Resource implements ILogSubscriptionDestination {
42 /**
43 * Policy object of this CrossAccountDestination object
44 */
45 readonly policyDocument: iam.PolicyDocument;
46 /**
47 * The name of this CrossAccountDestination object
48 * @attribute
49 */
50 readonly destinationName: string;
51 /**
52 * The ARN of this CrossAccountDestination object
53 * @attribute
54 */
55 readonly destinationArn: string;
56 /**
57 * The inner resource
58 */
59 private readonly resource;
60 constructor(scope: Construct, id: string, props: CrossAccountDestinationProps);
61 addToPolicy(statement: iam.PolicyStatement): void;
62 bind(_scope: CoreConstruct, _sourceLogGroup: ILogGroup): LogSubscriptionDestinationConfig;
63 /**
64 * Generate a unique Destination name in case the user didn't supply one
65 */
66 private generateUniqueName;
67 /**
68 * Return a stringified JSON version of the PolicyDocument
69 */
70 private lazyStringifiedPolicyDocument;
71}