1 | import * as cloudwatch from '@aws-cdk/aws-cloudwatch';
|
2 | import * as iam from '@aws-cdk/aws-iam';
|
3 | import { Construct } from 'constructs';
|
4 | import { Architecture } from './architecture';
|
5 | import { EventInvokeConfigOptions } from './event-invoke-config';
|
6 | import { IFunction, QualifiedFunctionBase } from './function-base';
|
7 | import { IVersion } from './lambda-version';
|
8 | import { AutoScalingOptions, IScalableFunctionAttribute } from './scalable-attribute-api';
|
9 | export interface IAlias extends IFunction {
|
10 | |
11 |
|
12 |
|
13 |
|
14 |
|
15 | readonly aliasName: string;
|
16 | |
17 |
|
18 |
|
19 | readonly version: IVersion;
|
20 | }
|
21 |
|
22 |
|
23 |
|
24 | export interface AliasOptions extends EventInvokeConfigOptions {
|
25 | |
26 |
|
27 |
|
28 |
|
29 |
|
30 | readonly description?: string;
|
31 | |
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 | readonly additionalVersions?: VersionWeight[];
|
49 | |
50 |
|
51 |
|
52 |
|
53 |
|
54 | readonly provisionedConcurrentExecutions?: number;
|
55 | }
|
56 |
|
57 |
|
58 |
|
59 | export interface AliasProps extends AliasOptions {
|
60 | |
61 |
|
62 |
|
63 | readonly aliasName: string;
|
64 | |
65 |
|
66 |
|
67 |
|
68 |
|
69 | readonly version: IVersion;
|
70 | }
|
71 | export interface AliasAttributes {
|
72 | readonly aliasName: string;
|
73 | readonly aliasVersion: IVersion;
|
74 | }
|
75 |
|
76 |
|
77 |
|
78 | export declare class Alias extends QualifiedFunctionBase implements IAlias {
|
79 | static fromAliasAttributes(scope: Construct, id: string, attrs: AliasAttributes): IAlias;
|
80 | |
81 |
|
82 |
|
83 |
|
84 |
|
85 | readonly aliasName: string;
|
86 | |
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 | readonly functionName: string;
|
93 | readonly lambda: IFunction;
|
94 | readonly architecture: Architecture;
|
95 | readonly version: IVersion;
|
96 | |
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 | readonly functionArn: string;
|
103 | protected readonly qualifier: string;
|
104 | protected readonly canCreatePermissions: boolean;
|
105 | private scalableAlias?;
|
106 | private readonly scalingRole;
|
107 | constructor(scope: Construct, id: string, props: AliasProps);
|
108 | get grantPrincipal(): iam.IPrincipal;
|
109 | get role(): iam.IRole | undefined;
|
110 | metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
|
111 | /**
|
112 | * Configure provisioned concurrency autoscaling on a function alias. Returns a scalable attribute that can call
|
113 | * `scaleOnUtilization()` and `scaleOnSchedule()`.
|
114 | *
|
115 | * @param options Autoscaling options
|
116 | */
|
117 | addAutoScaling(options: AutoScalingOptions): IScalableFunctionAttribute;
|
118 | /**
|
119 | * Calculate the routingConfig parameter from the input props
|
120 | */
|
121 | private determineRoutingConfig;
|
122 | /**
|
123 | * Validate that the additional version weights make sense
|
124 | *
|
125 | * We validate that they are positive and add up to something <= 1.
|
126 | */
|
127 | private validateAdditionalWeights;
|
128 | /**
|
129 | * Validate that the provisionedConcurrentExecutions makes sense
|
130 | *
|
131 | * Member must have value greater than or equal to 1
|
132 | */
|
133 | private determineProvisionedConcurrency;
|
134 | }
|
135 | /**
|
136 | * A version/weight pair for routing traffic to Lambda functions
|
137 | */
|
138 | export interface VersionWeight {
|
139 | |
140 |
|
141 |
|
142 | readonly version: IVersion;
|
143 | |
144 |
|
145 |
|
146 | readonly weight: number;
|
147 | }
|