UNPKG

2.52 kBTypeScriptView Raw
1import * as api from '@aws-cdk/aws-apigateway';
2import * as events from '@aws-cdk/aws-events';
3import * as iam from '@aws-cdk/aws-iam';
4import { TargetBaseProps } from './util';
5/**
6 * Customize the API Gateway Event Target
7 */
8export interface ApiGatewayProps extends TargetBaseProps {
9 /**
10 * The method for api resource invoked by the rule.
11 *
12 * @default '*' that treated as ANY
13 */
14 readonly method?: string;
15 /**
16 * The api resource invoked by the rule.
17 * We can use wildcards('*') to specify the path. In that case,
18 * an equal number of real values must be specified for pathParameterValues.
19 *
20 * @default '/'
21 */
22 readonly path?: string;
23 /**
24 * The deploy stage of api gateway invoked by the rule.
25 *
26 * @default the value of deploymentStage.stageName of target api gateway.
27 */
28 readonly stage?: string;
29 /**
30 * The headers to be set when requesting API
31 *
32 * @default no header parameters
33 */
34 readonly headerParameters?: {
35 [key: string]: (string);
36 };
37 /**
38 * The path parameter values to be used to
39 * populate to wildcards("*") of requesting api path
40 *
41 * @default no path parameters
42 */
43 readonly pathParameterValues?: string[];
44 /**
45 * The query parameters to be set when requesting API.
46 *
47 * @default no querystring parameters
48 */
49 readonly queryStringParameters?: {
50 [key: string]: (string);
51 };
52 /**
53 * This will be the post request body send to the API.
54 *
55 * @default the entire EventBridge event
56 */
57 readonly postBody?: events.RuleTargetInput;
58 /**
59 * The role to assume before invoking the target
60 * (i.e., the pipeline) when the given rule is triggered.
61 *
62 * @default - a new role will be created
63 */
64 readonly eventRole?: iam.IRole;
65}
66/**
67 * Use an API Gateway REST APIs as a target for Amazon EventBridge rules.
68 */
69export declare class ApiGateway implements events.IRuleTarget {
70 readonly restApi: api.RestApi;
71 private readonly props?;
72 constructor(restApi: api.RestApi, props?: ApiGatewayProps | undefined);
73 /**
74 * Returns a RuleTarget that can be used to trigger this API Gateway REST APIs
75 * as a result from an EventBridge event.
76 *
77 * @see https://docs.aws.amazon.com/eventbridge/latest/userguide/resource-based-policies-eventbridge.html#sqs-permissions
78 */
79 bind(rule: events.IRule, _id?: string): events.RuleTargetConfig;
80}