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 | addAlias(aliasName: string, options?: AliasOptions): Alias;
|
28 | }
|
29 |
|
30 |
|
31 |
|
32 | export interface VersionOptions extends EventInvokeConfigOptions {
|
33 | |
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 | readonly codeSha256?: string;
|
41 | |
42 |
|
43 |
|
44 |
|
45 |
|
46 | readonly description?: string;
|
47 | |
48 |
|
49 |
|
50 |
|
51 |
|
52 | readonly provisionedConcurrentExecutions?: number;
|
53 | |
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 | readonly removalPolicy?: RemovalPolicy;
|
60 | }
|
61 |
|
62 |
|
63 |
|
64 | export interface VersionProps extends VersionOptions {
|
65 | |
66 |
|
67 |
|
68 | readonly lambda: IFunction;
|
69 | }
|
70 | export interface VersionAttributes {
|
71 | |
72 |
|
73 |
|
74 | readonly version: string;
|
75 | |
76 |
|
77 |
|
78 | readonly lambda: IFunction;
|
79 | }
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 | export declare class Version extends QualifiedFunctionBase implements IVersion {
|
98 | |
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 | static fromVersionArn(scope: Construct, id: string, versionArn: string): IVersion;
|
106 | static fromVersionAttributes(scope: Construct, id: string, attrs: VersionAttributes): IVersion;
|
107 | readonly version: string;
|
108 | readonly lambda: IFunction;
|
109 | readonly functionArn: string;
|
110 | readonly functionName: string;
|
111 | readonly architecture: Architecture;
|
112 | protected readonly qualifier: string;
|
113 | protected readonly canCreatePermissions = true;
|
114 | constructor(scope: Construct, id: string, props: VersionProps);
|
115 | get grantPrincipal(): import("@aws-cdk/aws-iam").IPrincipal;
|
116 | get role(): import("@aws-cdk/aws-iam").IRole | undefined;
|
117 | metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
|
118 | /**
|
119 | * Defines an alias for this version.
|
120 | * @param aliasName The name of the alias (e.g. "live")
|
121 | * @param options Alias options
|
122 | */
|
123 | addAlias(aliasName: string, options?: AliasOptions): Alias;
|
124 | get edgeArn(): string;
|
125 | /**
|
126 | * Validate that the provisionedConcurrentExecutions makes sense
|
127 | *
|
128 | * Member must have value greater than or equal to 1
|
129 | */
|
130 | private determineProvisionedConcurrency;
|
131 | }
|
132 | /**
|
133 | * Given an opaque (token) ARN, returns a CloudFormation expression that extracts the
|
134 | * qualifier (= version or alias) from the ARN.
|
135 | *
|
136 | * Version ARNs look like this:
|
137 | *
|
138 | * arn:aws:lambda:region:account-id:function:function-name:qualifier
|
139 | *
|
140 | * ..which means that in order to extract the `qualifier` component from the ARN, we can
|
141 | * split the ARN using ":" and select the component in index 7.
|
142 | *
|
143 | * @returns `FnSelect(7, FnSplit(':', arn))`
|
144 | */
|
145 | export declare function extractQualifierFromArn(arn: string): string;
|