1 | import * as cloudwatch from '@aws-cdk/aws-cloudwatch';
|
2 | import { RemovalPolicy } from '@aws-cdk/core';
|
3 | import { Construct } from 'constructs';
|
4 | import { Alias, AliasOptions } from './alias';
|
5 | import { Architecture } from './architecture';
|
6 | import { EventInvokeConfigOptions } from './event-invoke-config';
|
7 | import { IFunction, QualifiedFunctionBase } from './function-base';
|
8 | export interface IVersion extends IFunction {
|
9 | |
10 |
|
11 |
|
12 |
|
13 | readonly version: string;
|
14 | |
15 |
|
16 |
|
17 | readonly lambda: IFunction;
|
18 | |
19 |
|
20 |
|
21 | readonly edgeArn: string;
|
22 | |
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | addAlias(aliasName: string, options?: AliasOptions): Alias;
|
30 | }
|
31 |
|
32 |
|
33 |
|
34 | export interface VersionOptions extends EventInvokeConfigOptions {
|
35 | |
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | readonly codeSha256?: string;
|
43 | |
44 |
|
45 |
|
46 |
|
47 |
|
48 | readonly description?: string;
|
49 | |
50 |
|
51 |
|
52 |
|
53 |
|
54 | readonly provisionedConcurrentExecutions?: number;
|
55 | |
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 | readonly removalPolicy?: RemovalPolicy;
|
62 | }
|
63 |
|
64 |
|
65 |
|
66 | export interface VersionProps extends VersionOptions {
|
67 | |
68 |
|
69 |
|
70 | readonly lambda: IFunction;
|
71 | }
|
72 | export interface VersionAttributes {
|
73 | |
74 |
|
75 |
|
76 | readonly version: string;
|
77 | |
78 |
|
79 |
|
80 | readonly lambda: IFunction;
|
81 | }
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 | export declare class Version extends QualifiedFunctionBase implements IVersion {
|
100 | |
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 | static fromVersionArn(scope: Construct, id: string, versionArn: string): IVersion;
|
108 | static fromVersionAttributes(scope: Construct, id: string, attrs: VersionAttributes): IVersion;
|
109 | readonly version: string;
|
110 | readonly lambda: IFunction;
|
111 | readonly functionArn: string;
|
112 | readonly functionName: string;
|
113 | readonly architecture: Architecture;
|
114 | protected readonly qualifier: string;
|
115 | protected readonly canCreatePermissions = true;
|
116 | constructor(scope: Construct, id: string, props: VersionProps);
|
117 | get grantPrincipal(): import("@aws-cdk/aws-iam").IPrincipal;
|
118 | get role(): import("@aws-cdk/aws-iam").IRole | undefined;
|
119 | metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
|
120 | /**
|
121 | * Defines an alias for this version.
|
122 | * @param aliasName The name of the alias (e.g. "live")
|
123 | * @param options Alias options
|
124 | * @deprecated Calling `addAlias` on a `Version` object will cause the Alias to be replaced on every function update. Call `function.addAlias()` or `new Alias()` instead.
|
125 | */
|
126 | addAlias(aliasName: string, options?: AliasOptions): Alias;
|
127 | get edgeArn(): string;
|
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 | * Given an opaque (token) ARN, returns a CloudFormation expression that extracts the
|
137 | * qualifier (= version or alias) from the ARN.
|
138 | *
|
139 | * Version ARNs look like this:
|
140 | *
|
141 | * arn:aws:lambda:region:account-id:function:function-name:qualifier
|
142 | *
|
143 | * ..which means that in order to extract the `qualifier` component from the ARN, we can
|
144 | * split the ARN using ":" and select the component in index 7.
|
145 | *
|
146 | * @returns `FnSelect(7, FnSplit(':', arn))`
|
147 | */
|
148 | export declare function extractQualifierFromArn(arn: string): string;
|